diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d53628fb6274e0..f5f78507aa134d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -391,7 +391,7 @@ jobs: # use that on Darwin. # * the "host clang" build, which uses the pigweed # clang. - "default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false enable_host_gcc_mbedtls_build=false';; + "default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';; "python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';; esac BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index e867790820231a..0ecc922ef25e82 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -110,10 +110,11 @@ jobs: chip_build_tests=false \ chip_enable_wifi=false \ chip_im_force_fabric_quota_check=true \ + enable_default_builds=false \ enable_host_gcc_build=true \ - enable_host_gcc_mbedtls_build=false \ - enable_host_clang_build=false \ - enable_fake_tests=false + enable_standalone_chip_tool_build=true \ + enable_linux_all_clusters_app_build=true \ + enable_linux_lighting_app_build=true - name: Run Tests timeout-minutes: 25 run: | diff --git a/.github/workflows/docker_img.yaml b/.github/workflows/docker_img.yaml index 9ea7ae9c7ea06a..b706dbcac39e42 100644 --- a/.github/workflows/docker_img.yaml +++ b/.github/workflows/docker_img.yaml @@ -65,9 +65,3 @@ jobs: run: | cd integrations/docker/images/chip-build${{ matrix.img }} ./build.sh --latest - - name: Scan for vulnerabilities - uses: crazy-max/docker-scan-action@master - with: - # NOTE: This task validates the images built previously with latest tag - image: connectedhomeip/chip-build${{ matrix.img }}:latest - annotations: true diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 9885e1e43788b6..38f86e5b6f7a6d 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-k32w:0.5.84 + image: connectedhomeip/chip-build-k32w:0.5.87 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -82,15 +82,15 @@ jobs: timeout-minutes: 5 run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - k32w k32w061+release light \ - out/artifacts/k32w-light-release-no-ota/chip-k32w061-light-example \ + k32w k32w0+release light \ + out/artifacts/k32w-light-release-no-ota/chip-k32w0x-light-example \ /tmp/bloat_reports/ - name: Get lock size stats timeout-minutes: 5 run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - k32w k32w061+release lock \ - out/artifacts/k32w-lock-low-power-release/chip-k32w061-lock-example \ + k32w k32w0+release lock \ + out/artifacts/k32w-lock-low-power-release/chip-k32w0x-lock-example \ /tmp/bloat_reports/ - name: Uploading Size Reports uses: actions/upload-artifact@v2 diff --git a/BUILD.gn b/BUILD.gn index 390a4b7706d6a8..775264acacc621 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -235,7 +235,11 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { enable_host_gcc_build = enable_default_builds && host_os != "win" # Enable building chip with gcc & mbedtls. - enable_host_gcc_mbedtls_build = enable_default_builds && host_os != "win" + enable_host_gcc_mbedtls_build = false + + # Enable limited testing with gcc & mbedtls. + enable_host_gcc_mbedtls_crypto_tests = + enable_default_builds && host_os != "win" # Build the chip-cert tool. enable_standalone_chip_cert_build = @@ -349,6 +353,15 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { builds += [ ":host_gcc_mbedtls" ] } + if (enable_host_gcc_mbedtls_crypto_tests) { + chip_build("host_gcc_mbedtls_crypto_tests") { + test_group = "//src:crypto_tests" + toolchain = "${chip_root}/config/mbedtls/toolchain:${host_os}_${host_cpu}_gcc_mbedtls" + } + + builds += [ ":host_gcc_mbedtls_crypto_tests" ] + } + if (enable_android_builds) { chip_build("android_arm") { toolchain = "${build_root}/toolchain/android:android_arm" @@ -376,6 +389,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { if (enable_fake_tests) { chip_build("fake_platform") { + test_group = "//src:fake_platform_tests" toolchain = "${build_root}/toolchain/fake:fake_${host_cpu}_gcc" } diff --git a/build/chip/chip_build.gni b/build/chip/chip_build.gni index 1521f585a8d0ae..ce3a483d1be77d 100644 --- a/build/chip/chip_build.gni +++ b/build/chip/chip_build.gni @@ -20,11 +20,21 @@ template("chip_build") { _build_name = target_name _toolchain = invoker.toolchain + if (defined(invoker.test_group) && chip_build_tests) { + _build_target = invoker.test_group + _check_target = get_label_info(invoker.test_group, "dir") + ":" + + get_label_info(invoker.test_group, "name") + "_run" + } else { + _build_target = ":default" + _check_target = ":check" + not_needed(invoker, [ "test_group" ]) + } + group("${_build_name}") { - deps = [ ":default(${_toolchain})" ] + deps = [ "${_build_target}(${_toolchain})" ] } group("check_${_build_name}") { - deps = [ ":check(${_toolchain})" ] + deps = [ "${_check_target}(${_toolchain})" ] } } diff --git a/build/chip/chip_test_group.gni b/build/chip/chip_test_group.gni index b98622cf71f6f2..bb4c9def4bfb9b 100644 --- a/build/chip/chip_test_group.gni +++ b/build/chip/chip_test_group.gni @@ -60,8 +60,8 @@ template("chip_test_group") { } } - if (chip_link_tests) { - group("${_test_group_name}_run") { + group("${_test_group_name}_run") { + if (chip_link_tests) { deps = [] foreach(_test, invoker.deps) { deps += [ get_label_info(_test, "label_no_toolchain") + "_run" ] 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 e5569355e063e9..f989ede4b43533 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 @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -206,13 +206,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -911,7 +911,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1540,7 +1540,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1632,8 +1631,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1699,10 +1698,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { 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 50a151d154f03d..9ef0f1ff6fe4ff 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 @@ -93,12 +93,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -200,13 +200,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -840,7 +840,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1385,7 +1385,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1477,8 +1476,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1544,10 +1543,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index b4b7248f961b4c..192d27b2c8fff6 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -420,11 +420,19 @@ server cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; + readonly attribute long_char_string<512> setupUrl = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct InstantActionRequest { + INT16U actionID = 0; + optional INT32U invokeID = 1; + } + + command InstantAction(InstantActionRequest): DefaultSuccess = 0; } server cluster Basic = 40 { @@ -593,7 +601,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1222,7 +1230,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1317,8 +1324,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1387,10 +1394,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster UserLabel = 65 { @@ -1723,6 +1730,7 @@ endpoint 1 { server cluster BridgedActions { callback attribute actionList; callback attribute endpointList; + ram attribute setupUrl default = "https://example.com"; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 6d01b0254bb3d5..10bffcd24bbd32 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 71, + "featureLevel": 72, "creator": "zap", "keyValuePairs": [ { @@ -115,7 +115,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -131,7 +131,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -147,7 +147,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -159,7 +159,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -175,7 +175,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -191,7 +191,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -297,7 +297,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -313,7 +313,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -373,7 +373,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -389,7 +389,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -511,7 +511,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "10", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -527,7 +527,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -543,7 +543,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -559,7 +559,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -575,7 +575,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -591,7 +591,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -607,7 +607,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "XX", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -623,7 +623,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -639,7 +639,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -655,7 +655,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -671,7 +671,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -827,7 +827,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 1, "bounded": 0, "defaultValue": "", @@ -843,7 +843,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 1, "bounded": 0, "defaultValue": "", @@ -859,7 +859,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 1, "bounded": 0, "defaultValue": "", @@ -965,7 +965,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "en-US", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -981,7 +981,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -993,7 +993,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1009,7 +1009,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1025,7 +1025,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1131,7 +1131,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1175,7 +1175,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1191,7 +1191,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1207,7 +1207,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1325,7 +1325,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1341,7 +1341,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1357,7 +1357,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1589,7 +1589,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1605,7 +1605,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1621,7 +1621,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1925,7 +1925,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -1941,7 +1941,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2273,7 +2273,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2289,7 +2289,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2305,7 +2305,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4175,7 +4175,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4191,7 +4191,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4207,7 +4207,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4503,7 +4503,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4519,7 +4519,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4535,7 +4535,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4687,7 +4687,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4703,7 +4703,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4719,7 +4719,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4735,7 +4735,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4751,7 +4751,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4767,7 +4767,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4783,7 +4783,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5052,7 +5052,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5068,7 +5068,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5080,7 +5080,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5096,7 +5096,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5112,7 +5112,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5214,7 +5214,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5230,11 +5230,11 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5246,11 +5246,11 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5262,11 +5262,11 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5278,7 +5278,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5294,7 +5294,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5310,7 +5310,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5412,7 +5412,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5428,7 +5428,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5444,7 +5444,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5460,7 +5460,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5510,7 +5510,16 @@ "define": "BRIDGED_ACTIONS_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "InstantAction", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { "name": "FeatureMap", @@ -5562,7 +5571,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5578,7 +5587,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5593,11 +5602,11 @@ "mfgCode": null, "side": "server", "type": "long_char_string", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "https://example.com", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5610,7 +5619,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5626,7 +5635,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -5642,7 +5651,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp index 3b94d192d216e1..0d022828740cfb 100644 --- a/examples/bridge-app/esp32/main/main.cpp +++ b/examples/bridge-app/esp32/main/main.cpp @@ -50,6 +50,7 @@ using namespace ::chip; using namespace ::chip::DeviceManager; using namespace ::chip::Platform; using namespace ::chip::Credentials; +using namespace ::chip::app::Clusters; static AppDeviceCallbacks AppCallback; @@ -328,6 +329,15 @@ void HandleDeviceStatusChanged(Device * dev, Device::Changed_t itemChangedMask) } } +bool emberAfBridgedActionsClusterInstantActionCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + const BridgedActions::Commands::InstantAction::DecodableType & commandData) +{ + // No actions are implemented, just return status NotFound. + commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::NotFound); + return true; +} + const EmberAfDeviceType gBridgedRootDeviceTypes[] = { { DEVICE_TYPE_ROOT_NODE, DEVICE_VERSION_DEFAULT }, { DEVICE_TYPE_BRIDGE, DEVICE_VERSION_DEFAULT } }; diff --git a/examples/bridge-app/linux/Device.cpp b/examples/bridge-app/linux/Device.cpp index e2d2122a49ce25..12e78324ddc04c 100644 --- a/examples/bridge-app/linux/Device.cpp +++ b/examples/bridge-app/linux/Device.cpp @@ -262,3 +262,15 @@ Room::Room(std::string name, uint16_t endpointListId, EndpointListTypeEnum type, mType = type; mIsVisible = isVisible; } + +Action::Action(uint16_t actionId, std::string name, ActionTypeEnum type, uint16_t endpointListId, uint16_t supportedCommands, + ActionStateEnum status, bool isVisible) +{ + mActionId = actionId; + mName = name; + mType = type; + mEndpointListId = endpointListId; + mSupportedCommands = supportedCommands; + mStatus = status; + mIsVisible = isVisible; +} diff --git a/examples/bridge-app/linux/bridged-actions-stub.cpp b/examples/bridge-app/linux/bridged-actions-stub.cpp index 21712982dea9f7..debf2538206d57 100644 --- a/examples/bridge-app/linux/bridged-actions-stub.cpp +++ b/examples/bridge-app/linux/bridged-actions-stub.cpp @@ -57,8 +57,26 @@ constexpr uint16_t BridgedActionsAttrAccess::ClusterRevision; CHIP_ERROR BridgedActionsAttrAccess::ReadActionListAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - // Just return an empty list - return aEncoder.EncodeEmptyList(); + CHIP_ERROR err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { + std::vector actionList = GetActionListInfo(endpoint); + + for (auto action : actionList) + { + if (action->getIsVisible()) + { + BridgedActions::Structs::ActionStruct::Type actionStruct = { action->getActionId(), + CharSpan::fromCharString(action->getName().c_str()), + action->getType(), + action->getEndpointListId(), + action->getSupportedCommands(), + action->getStatus() }; + ReturnErrorOnFailure(encoder.Encode(actionStruct)); + } + } + + return CHIP_NO_ERROR; + }); + return err; } CHIP_ERROR BridgedActionsAttrAccess::ReadEndpointListAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) diff --git a/examples/bridge-app/linux/include/Device.h b/examples/bridge-app/linux/include/Device.h index 1eea58a71a2eb1..75ea521e90d4d8 100644 --- a/examples/bridge-app/linux/include/Device.h +++ b/examples/bridge-app/linux/include/Device.h @@ -217,3 +217,28 @@ class Room uint16_t mEndpointListId; chip::app::Clusters::BridgedActions::EndpointListTypeEnum mType; }; + +class Action +{ +public: + Action(uint16_t actionId, std::string name, chip::app::Clusters::BridgedActions::ActionTypeEnum type, uint16_t endpointListId, + uint16_t supportedCommands, chip::app::Clusters::BridgedActions::ActionStateEnum status, bool isVisible); + inline void setName(std::string name) { mName = name; }; + inline std::string getName() { return mName; }; + inline chip::app::Clusters::BridgedActions::ActionTypeEnum getType() { return mType; }; + inline chip::app::Clusters::BridgedActions::ActionStateEnum getStatus() { return mStatus; }; + inline uint16_t getActionId() { return mActionId; }; + inline uint16_t getEndpointListId() { return mEndpointListId; }; + inline uint16_t getSupportedCommands() { return mSupportedCommands; }; + inline void setIsVisible(bool isVisible) { mIsVisible = isVisible; }; + inline bool getIsVisible() { return mIsVisible; }; + +private: + std::string mName; + chip::app::Clusters::BridgedActions::ActionTypeEnum mType; + chip::app::Clusters::BridgedActions::ActionStateEnum mStatus; + uint16_t mActionId; + uint16_t mEndpointListId; + uint16_t mSupportedCommands; + bool mIsVisible; +}; diff --git a/examples/bridge-app/linux/include/main.h b/examples/bridge-app/linux/include/main.h index fe81d30685f7ec..df7ba595cd6ece 100644 --- a/examples/bridge-app/linux/include/main.h +++ b/examples/bridge-app/linux/include/main.h @@ -19,3 +19,5 @@ #pragma once std::vector GetEndpointListInfo(chip::EndpointId parentId); + +std::vector GetActionListInfo(chip::EndpointId parentId); diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index d0b411446a210b..71486c8fc392bd 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -68,6 +69,7 @@ EndpointId gCurrentEndpointId; EndpointId gFirstDynamicEndpointId; Device * gDevices[CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT]; std::vector gRooms; +std::vector gActions; // ENDPOINT DEFINITIONS: // ================================================================================= @@ -118,6 +120,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(bridgedDeviceBasicAttrs) DECLARE_DYNAMIC_ATTRIBUTE(ZCL_NODE_LABEL_ATTRIBUTE_ID, CHAR_STRING, kNodeLabelSize, 0), /* NodeLabel */ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_REACHABLE_ATTRIBUTE_ID, BOOLEAN, 1, 0), /* Reachable */ + DECLARE_DYNAMIC_ATTRIBUTE(ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID, BITMAP32, 4, 0), /* feature map */ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); // Declare Cluster List for Bridged Light endpoint @@ -168,6 +171,13 @@ Room room1("Room 1", 0xE001, BridgedActions::EndpointListTypeEnum::kRoom, true); Room room2("Room 2", 0xE002, BridgedActions::EndpointListTypeEnum::kRoom, true); Room room3("Zone 3", 0xE003, BridgedActions::EndpointListTypeEnum::kZone, false); +Action action1(0x1001, "Room 1 On", BridgedActions::ActionTypeEnum::kAutomation, 0xE001, 0x1, + BridgedActions::ActionStateEnum::kInactive, true); +Action action2(0x1002, "Turn On Room 2", BridgedActions::ActionTypeEnum::kAutomation, 0xE002, 0x01, + BridgedActions::ActionStateEnum::kInactive, true); +Action action3(0x1003, "Turn Off Room 1", BridgedActions::ActionTypeEnum::kAutomation, 0xE003, 0x01, + BridgedActions::ActionStateEnum::kInactive, false); + // --------------------------------------------------------------------------- // // SWITCH ENDPOINT: contains the following clusters: @@ -195,6 +205,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(switchBridgedDeviceBasicAttrs) DECLARE_DYNAMIC_ATTRIBUTE(ZCL_NODE_LABEL_ATTRIBUTE_ID, CHAR_STRING, kNodeLabelSize, 0), /* NodeLabel */ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_REACHABLE_ATTRIBUTE_ID, BOOLEAN, 1, 0), /* Reachable */ + DECLARE_DYNAMIC_ATTRIBUTE(ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID, BITMAP32, 4, 0), /* feature map */ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); // Declare Cluster List for Bridged Switch endpoint @@ -254,6 +265,7 @@ DataVersion gComposedPowerSourceDataVersions[ArraySize(bridgedPowerSourceCluster #define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u) #define ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_REVISION (1u) +#define ZCL_BRIDGED_DEVICE_BASIC_FEATURE_MAP (0u) #define ZCL_FIXED_LABEL_CLUSTER_REVISION (1u) #define ZCL_ON_OFF_CLUSTER_REVISION (4u) #define ZCL_SWITCH_CLUSTER_REVISION (1u) @@ -360,6 +372,11 @@ std::vector GetEndpointListInfo(chip::EndpointId parentId) return infoList; } +std::vector GetActionListInfo(chip::EndpointId parentId) +{ + return gActions; +} + void HandleDeviceStatusChanged(Device * dev, Device::Changed_t itemChangedMask) { if (itemChangedMask & Device::kChanged_Reachable) @@ -463,6 +480,10 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut { *buffer = (uint16_t) ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_REVISION; } + else if ((attributeId == ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID) && (maxReadLength == 4)) + { + *buffer = (uint32_t) ZCL_BRIDGED_DEVICE_BASIC_FEATURE_MAP; + } else { return EMBER_ZCL_STATUS_FAILURE; @@ -640,6 +661,82 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster return ret; } +void runOnOffRoomAction(Room * room, bool actionOn, EndpointId endpointId, uint16_t actionID, uint32_t invokeID, bool hasInvokeID) +{ + if (hasInvokeID) + { + BridgedActions::Events::StateChanged::Type event{ actionID, invokeID, BridgedActions::ActionStateEnum::kActive }; + EventNumber eventNumber; + chip::app::LogEvent(event, endpointId, eventNumber); + } + + // Check and run the action for ActionLight1 - ActionLight4 + if (room->getName().compare(ActionLight1.GetLocation()) == 0) + { + ActionLight1.SetOnOff(actionOn); + } + if (room->getName().compare(ActionLight2.GetLocation()) == 0) + { + ActionLight2.SetOnOff(actionOn); + } + if (room->getName().compare(ActionLight3.GetLocation()) == 0) + { + ActionLight3.SetOnOff(actionOn); + } + if (room->getName().compare(ActionLight4.GetLocation()) == 0) + { + ActionLight4.SetOnOff(actionOn); + } + + if (hasInvokeID) + { + BridgedActions::Events::StateChanged::Type event{ actionID, invokeID, BridgedActions::ActionStateEnum::kInactive }; + EventNumber eventNumber; + chip::app::LogEvent(event, endpointId, eventNumber); + } +} + +bool emberAfBridgedActionsClusterInstantActionCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + const BridgedActions::Commands::InstantAction::DecodableType & commandData) +{ + bool hasInvokeID = false; + uint32_t invokeID = 0; + EndpointId endpointID = commandPath.mEndpointId; + auto & actionID = commandData.actionID; + + if (commandData.invokeID.HasValue()) + { + hasInvokeID = true; + invokeID = commandData.invokeID.Value(); + } + + if (actionID == action1.getActionId() && action1.getIsVisible()) + { + // Turn On Lights in Room 1 + runOnOffRoomAction(&room1, true, endpointID, actionID, invokeID, hasInvokeID); + commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::Success); + return true; + } + if (actionID == action2.getActionId() && action2.getIsVisible()) + { + // Turn On Lights in Room 2 + runOnOffRoomAction(&room2, true, endpointID, actionID, invokeID, hasInvokeID); + commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::Success); + return true; + } + if (actionID == action3.getActionId() && action3.getIsVisible()) + { + // Turn Off Lights in Room 1 + runOnOffRoomAction(&room1, false, endpointID, actionID, invokeID, hasInvokeID); + commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::Success); + return true; + } + + commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::NotFound); + return true; +} + void ApplicationInit() {} const EmberAfDeviceType gBridgedOnOffDeviceTypes[] = { { DEVICE_TYPE_LO_ON_OFF_LIGHT, DEVICE_VERSION_DEFAULT }, @@ -744,6 +841,21 @@ void * bridge_polling_thread(void * context) room3.setIsVisible(true); ActionLight2.SetZone("Zone 3"); } + if (ch == 'm') + { + // TC-ACT-2.2 step 3c, rename "Turn on Room 1 lights" + action1.setName("Turn On Room 1"); + } + if (ch == 'n') + { + // TC-ACT-2.2 step 3f, remove "Turn on Room 2 lights" + action2.setIsVisible(false); + } + if (ch == 'o') + { + // TC-ACT-2.2 step 3i, add "Turn off Room 1 renamed lights" + action3.setIsVisible(true); + } continue; } @@ -866,6 +978,10 @@ int main(int argc, char * argv[]) gRooms.push_back(&room2); gRooms.push_back(&room3); + gActions.push_back(&action1); + gActions.push_back(&action2); + gActions.push_back(&action3); + { pthread_t poll_thread; int res = pthread_create(&poll_thread, nullptr, bridge_polling_thread, nullptr); diff --git a/examples/chef/cicd_config.json b/examples/chef/cicd_config.json index f78baa7e3d3eee..27eafbe67631d3 100644 --- a/examples/chef/cicd_config.json +++ b/examples/chef/cicd_config.json @@ -2,14 +2,14 @@ "ci_allow_list": ["rootnode_dimmablelight_bCwGYSDpoe"], "cd_platforms": { "linux": { - "linux_x86": ["--cpu_type", "x64"], - "linux_arm64_ipv6only": ["--cpu_type", "arm64", "--ipv6only"] + "linux_x86": ["--cpu_type", "x64", "-a"], + "linux_arm64_ipv6only": ["--cpu_type", "arm64", "--ipv6only", "-a"] }, "esp32": { - "m5stack": [] + "m5stack": ["-a"] }, "nrfconnect": { - "nrf52840dk": [] + "nrf52840dk": ["-a"] } } } diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 3569eb47ec0efb..97da0f40421653 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -709,7 +709,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster DiagnosticLogs = 50 { @@ -1198,7 +1198,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1290,8 +1289,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1357,10 +1356,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 2f553f5d092407..9ea4e7a9963e51 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -465,7 +465,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1088,7 +1088,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1180,8 +1179,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1247,10 +1246,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index c418e260b39905..c6a9904c988bdd 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -709,7 +709,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1332,7 +1332,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1424,8 +1423,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1491,10 +1490,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 91db20992abfe3..141d0f66ecf8e0 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -112,12 +112,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1193,8 +1192,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1260,10 +1259,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 16d8c8f83fae22..b2b5e7487480f0 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -702,7 +702,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1325,7 +1325,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1417,8 +1416,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1484,10 +1483,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 1f8dd74275efa6..ff04b5f9934278 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -112,12 +112,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1193,8 +1192,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1260,10 +1259,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 9bc379a20349fd..bd384a12d8524f 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -112,12 +112,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1193,8 +1192,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1260,10 +1259,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 44c2d10c6975bc..4570dcfa4b4ad1 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -112,12 +112,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1193,8 +1192,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1260,10 +1259,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 0b5ff1eab4d1f8..08849f0bb0845c 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -709,7 +709,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1332,7 +1332,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1424,8 +1423,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1491,10 +1490,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 76f87b241a18c5..b60a868d1b3999 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } client cluster Scenes = 5 { @@ -209,13 +209,13 @@ client cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster Scenes = 5 { @@ -320,13 +320,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } client cluster OnOff = 6 { @@ -779,7 +779,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1402,7 +1402,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1494,8 +1493,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1561,10 +1560,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index e6b811977e2e30..3c6021167fc804 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster OnOff = 6 { @@ -626,7 +626,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1249,7 +1249,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1341,8 +1340,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1408,10 +1407,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 572eb08ca369b8..bfdddb25db7e7e 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -112,12 +112,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1193,8 +1192,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1260,10 +1259,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 66cc663bc4def9..971e68e9f8ee8d 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -96,12 +96,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster OnOff = 6 { @@ -589,7 +589,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1212,7 +1212,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1304,8 +1303,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1371,10 +1370,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 91a5ef6e428cb0..0d7c1ffbde0ea6 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -112,12 +112,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Descriptor = 29 { @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1193,8 +1192,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1260,10 +1259,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 086a3db0aa36c8..638550bb8a7c23 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster Descriptor = 29 { @@ -576,7 +576,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1199,7 +1199,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1291,8 +1290,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1358,10 +1357,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 26b531774f3304..bb699502abca33 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -209,13 +209,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster Descriptor = 29 { @@ -576,7 +576,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1199,7 +1199,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1291,8 +1290,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1358,10 +1357,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index ae8c31908036ca..308151883ecf10 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -134,12 +134,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } client cluster Scenes = 5 { @@ -241,13 +241,13 @@ client cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } client cluster OnOff = 6 { @@ -665,7 +665,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1293,7 +1293,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1385,8 +1384,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1452,10 +1451,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 67b8e0386adecb..5f4d31853f35ed 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -99,12 +99,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster OnOff = 6 { @@ -605,7 +605,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1228,7 +1228,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1320,8 +1319,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1387,10 +1386,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn index 5e811f8900e0d8..c19ccbac46f23a 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn @@ -21,7 +21,6 @@ import("${k32w0_sdk_build_root}/k32w0_sdk.gni") import("${chip_root}/src/crypto/crypto.gni") import("${chip_root}/src/lib/core/core.gni") -import("${chip_root}/src/lib/core/core.gni") import("${chip_root}/src/platform/device.gni") if (chip_pw_tokenizer_logging) { @@ -66,7 +65,7 @@ k32w0_sdk("sdk") { } k32w0_executable("light_app") { - output_name = "chip-k32w061-light-example" + output_name = "chip-k32w0x-light-example" sources = [ "${k32w0_platform_dir}/util/LEDWidget.cpp", @@ -103,7 +102,7 @@ k32w0_executable("light_app") { cflags = [ "-Wconversion" ] - ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w061-linker.ld" + ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w0x-linker.ld" inputs = [ ldscript ] @@ -118,15 +117,24 @@ k32w0_executable("light_app") { ] } + if (chip_enable_ota_requestor) { + ldflags += [ + "-Wl,--defsym", + "-Wl,__app_load_address__=0x4000", + "-Wl,--defsym", + "-Wl,__app_stated_size__=0x99A00", + ] + } + output_dir = root_out_dir } if (chip_pw_tokenizer_logging) { pw_tokenizer_database("light_app.database") { - database = "$root_build_dir/chip-k32w061-light-example-database.bin" + database = "$root_build_dir/chip-k32w0x-light-example-database.bin" create = "binary" deps = [ ":light_app" ] - optional_paths = [ "$root_build_dir/chip-k32w061-light-example" ] + optional_paths = [ "$root_build_dir/chip-k32w0x-light-example" ] } } diff --git a/examples/lighting-app/nxp/k32w/k32w0/README.md b/examples/lighting-app/nxp/k32w/k32w0/README.md index 51385c7d0edba2..6b638d0660447a 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/README.md +++ b/examples/lighting-app/nxp/k32w/k32w0/README.md @@ -174,24 +174,23 @@ will be initiated. In order to build the Project CHIP example, we recommend using a Linux distribution (the demo-application was compiled on Ubuntu 20.04). -- Download [K32W061 SDK 2.6.4 for Project CHIP](https://mcuxpresso.nxp.com/). +- Download [K32W0 SDK 2.6.6 for Project CHIP](https://mcuxpresso.nxp.com/). Creating an nxp.com account is required before being able to download the SDK. Once the account is created, login and follow the steps for downloading - SDK_2_6_4_K32W061DK6. The SDK Builder UI selection should be similar with - the one from the image below. + SDK_2_6_6_K32W061DK6 (required for K32W061 flavor). The SDK Builder UI + selection should be similar with the one from the image below. ![MCUXpresso SDK Download](../../../../platform/nxp/k32w/k32w0/doc/images/mcux-sdk-download.JPG) - Start building the application either with Secure Element or without - without Secure Element ``` -user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W061_SDK_ROOT=/home/user/Desktop/SDK_2_6_4_K32W061DK6/ -user@ubuntu:~/Desktop/git/connectedhomeip$ ./third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh +user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W0_SDK_ROOT=/home/user/Desktop/SDK_2_6_6_K32W061DK6/ user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lighting-app/nxp/k32w/k32w0 -user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ gn gen out/debug --args="k32w0_sdk_root=\"${NXP_K32W061_SDK_ROOT}\" chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"mbedtls\" chip_with_se05x=0 mbedtls_use_tinycrypt=true chip_pw_tokenizer_logging=true mbedtls_repo=\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\"" +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ gn gen out/debug --args="k32w0_sdk_root=\"${NXP_K32W0_SDK_ROOT}\" chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"tinycrypt\" chip_with_se05x=0 chip_pw_tokenizer_logging=true mbedtls_repo=\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\"" user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ ninja -C out/debug -user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ $NXP_K32W061_SDK_ROOT/tools/imagetool/sign_images.sh out/debug/ +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ $NXP_K32W0_SDK_ROOT/tools/imagetool/sign_images.sh out/debug/ ``` - with Secure element @@ -201,8 +200,9 @@ user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ Note that option chip_enable_ota_requestor=false are required for building with Secure Element. These can be changed if building without Secure Element -Note that "patch_k32w_sdk.sh" script must be run for patching the K32W061 SDK -2.6.4. + - for K32W041AM flavor: + Exactly the same steps as above but set build_for_k32w041am=1 in the gn command. + Also, select the K32W041AM SDK from the SDK Builder. Also, in case the OM15082 Expansion Board is not attached to the DK6 board, the build argument (chip_with_OM15082) inside the gn build instruction should be set @@ -225,7 +225,7 @@ pycrypto 2.6.1 pycryptodome 3.9.8 ``` -The resulting output file can be found in out/debug/chip-k32w061-light-example. +The resulting output file can be found in out/debug/chip-k32w0x-light-example. @@ -235,8 +235,8 @@ Program the firmware using the official [OpenThread Flash Instructions](https://github.com/openthread/ot-nxp/tree/main/src/k32w0/k32w061#flash-binaries). All you have to do is to replace the Openthread binaries from the above -documentation with _out/debug/chip-k32w061-light-example.bin_ if DK6Programmer -is used or with _out/debug/chip-k32w061-light-example_ if MCUXpresso is used. +documentation with _out/debug/chip-k32w0x-light-example.bin_ if DK6Programmer is +used or with _out/debug/chip-k32w0x-light-example_ if MCUXpresso is used. @@ -252,8 +252,10 @@ needed for parsing the hashed scripts. ### Detokenizer script The python3 script detokenizer.py is a script that decodes the tokenized logs -either from a file or from a serial port. The script can be used in the -following ways: +either from a file or from a serial port. It is located in the following path +`examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py`. + +The script can be used in the following ways: ``` usage: detokenizer.py serial [-h] -i INPUT -d DATABASE [-o OUTPUT] @@ -268,7 +270,7 @@ the serial to decode from. The third parameter is _-d DATABASE_ and represents the path to the token database to be used for decoding. The default path is -_out/debug/chip-k32w061-light-example-database.bin_ after a successful build. +_out/debug/chip-k32w0x-light-example-database.bin_ after a successful build. The forth parameter is _-o OUTPUT_ and it represents the path to the output file where the decoded logs will be stored. This parameter is required for file usage @@ -284,7 +286,12 @@ argument _chip_pw_tokenizer_logging=true_ was used. The detokenizer script must be run inside the example's folder after a successful run of the _scripts/activate.sh_ script. The pw_tokenizer module used -by the script is loaded by the environment. +by the script is loaded by the environment. An example of running the +detokenizer script to see logs of a lighting app: + +``` +python3 ../../../../../examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py serial -i /dev/ttyACM0 -d out/debug/chip-k32w0x-light-example-database.bin -o device.txt +``` @@ -318,11 +325,12 @@ Note: This solution is temporary. In order to use the tinycrypt ecc operations, use the following build arguments: - Build without Secure element (_chip_with_se05x=0_), with tinycrypt enabled - (_mbedtls_use_tinycrypt=true_) and with the `NXPmicro/mbedtls` library + (_chip_crypto=\"tinycrypt\"_) and with the `NXPmicro/mbedtls` library (_mbedtls_repo=`\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\"`_). -To disable tinycrypt ecc operations, simply build without -_mbedtls_use_tinycrypt=true_ and without _mbedtls_repo_. +To disable tinycrypt ecc operations, simply build with _chip_crypto=\"mbedtls\"_ +and with or without _mbedtls_repo_. If used with _mbedtls_repo_ the mbedtls +implementation from `NXPmicro/mbedtls` library will be used. @@ -406,7 +414,7 @@ CD04 -> 0x4CD pages of 512-bytes (= 614,5kB) DK6Programmer can be used for flashing the application: ``` -DK6Programmer.exe -V2 -s -P 1000000 -Y -p FLASH@0x4000="chip-k32w061-light-example.bin" +DK6Programmer.exe -V2 -s -P 1000000 -Y -p FLASH@0x4000="chip-k32w0x-light-example.bin" ``` If debugging is needed, MCUXpresso can be used then for flashing the @@ -461,9 +469,9 @@ doru@computer1:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examp Build OTA image and start the OTA Provider Application: ``` -doru@computer1:~/connectedhomeip$ : ./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 1 -vs "1.0" -da sha256 chip-k32w061-light-example.bin chip-k32w061-light-example.ota +doru@computer1:~/connectedhomeip$ : ./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 1 -vs "1.0" -da sha256 chip-k32w0x-light-example.bin chip-k32w0x-light-example.ota doru@computer1:~/connectedhomeip$ : rm -rf /tmp/chip_* -doru@computer1:~/connectedhomeip$ : ./out/ota-provider-app/chip-ota-provider-app -f chip-k32w061-light-example.ota +doru@computer1:~/connectedhomeip$ : ./out/ota-provider-app/chip-ota-provider-app -f chip-k32w0x-light-example.ota ``` Build Linux chip-tool: diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/main.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/main.cpp index f3c4096c4d5a8a..58091c8fba4dae 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/main/main.cpp +++ b/examples/lighting-app/nxp/k32w/k32w0/main/main.cpp @@ -43,6 +43,8 @@ extern InitFunc __init_array_end; /* needed for FreeRtos Heap 4 */ uint8_t __attribute__((section(".heap"))) ucHeap[HEAP_SIZE]; +extern "C" void sched_enable(); + extern "C" void main_task(void const * argument) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -85,6 +87,11 @@ extern "C" void main_task(void const * argument) goto exit; } + /* Enable the MAC scheduler after BLEManagerImpl::_Init() and V2MMAC_Enable(). + * This is needed to register properly the active protocols. + */ + sched_enable(); + err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); if (err != CHIP_NO_ERROR) { diff --git a/examples/lighting-app/qpg/include/AppTask.h b/examples/lighting-app/qpg/include/AppTask.h index edc33a5f88a0c3..510478fb9be3e3 100644 --- a/examples/lighting-app/qpg/include/AppTask.h +++ b/examples/lighting-app/qpg/include/AppTask.h @@ -48,12 +48,12 @@ class AppTask friend AppTask & GetAppTask(void); CHIP_ERROR Init(); + static void InitServer(intptr_t arg); + static void OpenCommissioning(intptr_t arg); static void ActionInitiated(LightingManager::Action_t aAction); static void ActionCompleted(LightingManager::Action_t aAction); - void CancelTimer(void); - void DispatchEvent(AppEvent * event); static void FunctionTimerEventHandler(AppEvent * aEvent); @@ -63,6 +63,7 @@ class AppTask static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState); void StartTimer(uint32_t aTimeoutMs); + void CancelTimer(void); enum Function_t { diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index 774754312989d6..13e78387cc4a99 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -208,28 +208,8 @@ CHIP_ERROR AppTask::StartAppTask() return CHIP_NO_ERROR; } -CHIP_ERROR AppTask::Init() +void AppTask::InitServer(intptr_t arg) { - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); - - err = LightingMgr().Init(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "LightingMgr().Init() failed"); - return err; - } - LightingMgr().SetCallbacks(ActionInitiated, ActionCompleted); - - // Subscribe with our button callback to the qvCHIP button handler. - qvIO_SetBtnCallback(ButtonEventHandler); - -#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(); @@ -243,18 +223,52 @@ CHIP_ERROR AppTask::Init() initParams.endpointNativeParams = static_cast(&nativeParams); chip::Server::GetInstance().Init(initParams); +#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs); +#endif + + // Open commissioning after boot if no fabric was available + if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) + { + PlatformMgr().ScheduleWork(OpenCommissioning, 0); + } +} + +void AppTask::OpenCommissioning(intptr_t arg) +{ + // Enable BLE advertisements + chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); +} + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + + // Init ZCL Data Model and start server + PlatformMgr().ScheduleWork(InitServer, 0); + // Initialize device attestation config SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - UpdateClusterState(); + // Setup light + err = LightingMgr().Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "LightingMgr().Init() failed"); + return err; + } + LightingMgr().SetCallbacks(ActionInitiated, ActionCompleted); + // Setup button handler + qvIO_SetBtnCallback(ButtonEventHandler); + + // Log device configuration ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); - // Enable BLE advertisements - chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); - ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); - return err; } diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index a8955e113138db..1473357623a139 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -93,12 +93,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster OnOff = 6 { @@ -582,7 +582,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1170,7 +1170,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1262,8 +1261,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1329,10 +1328,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn index 744bbeb839e402..57d4498ce98ad0 100644 --- a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn @@ -22,6 +22,12 @@ import("${k32w0_sdk_build_root}/k32w0_executable.gni") import("${k32w0_sdk_build_root}/k32w0_sdk.gni") import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/lib/core/core.gni") + +if (chip_pw_tokenizer_logging) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_tokenizer/database.gni") +} assert(current_os == "freertos") @@ -59,7 +65,7 @@ k32w0_sdk("sdk") { } k32w0_executable("lock_app") { - output_name = "chip-k32w061-lock-example" + output_name = "chip-k32w0x-lock-example" sources = [ "${k32w0_platform_dir}/util/LEDWidget.cpp", @@ -100,15 +106,26 @@ k32w0_executable("lock_app") { output_dir = root_out_dir - ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w061-linker.ld" + ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w0x-linker.ld" inputs = [ ldscript ] ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] } +if (chip_pw_tokenizer_logging) { + pw_tokenizer_database("lock_app.database") { + database = "$root_build_dir/chip-k32w0x-lock-example-database.bin" + create = "binary" + deps = [ ":lock_app" ] + optional_paths = [ "$root_build_dir/chip-k32w0x-lock-example" ] + } +} group("k32w0") { deps = [ ":lock_app" ] + if (chip_pw_tokenizer_logging) { + deps += [ ":lock_app.database" ] + } } group("default") { diff --git a/examples/lock-app/nxp/k32w/k32w0/README.md b/examples/lock-app/nxp/k32w/k32w0/README.md index 68be3c11ae03b9..9c1ef8ef3170f2 100644 --- a/examples/lock-app/nxp/k32w/k32w0/README.md +++ b/examples/lock-app/nxp/k32w/k32w0/README.md @@ -25,8 +25,15 @@ network. - [Flashing and debugging](#flashdebug) - [Known Issues](#knownissues) - [Testing the example](#testing-the-example) +- [Pigweed Tokenizer](#tokenizer) + - [Detokenizer script](#detokenizer) + - [Notes](#detokenizer-notes) + - [Known issues](#detokenizer-known-issues) +- [Tinycrypt ECC operations](#tinycrypt) -
+ - [Building steps](#tinycrypt-building-steps) + + @@ -165,10 +172,10 @@ will be initiated. In order to build the Project CHIP example, we recommend using a Linux distribution (the demo-application was compiled on Ubuntu 20.04). -- Download [K32W061 SDK 2.6.4 for Project CHIP](https://mcuxpresso.nxp.com/). +- Download [K32W061 SDK 2.6.6 for Project CHIP](https://mcuxpresso.nxp.com/). Creating an nxp.com account is required before being able to download the SDK. Once the account is created, login and follow the steps for downloading - SDK_2_6_4_K32W061DK6. The SDK Builder UI selection should be similar with + SDK_2_6_6_K32W061DK6. The SDK Builder UI selection should be similar with the one from the image below. ![MCUXpresso SDK Download](../../../../platform/nxp/k32w/k32w0/doc/images/mcux-sdk-download.JPG) @@ -177,25 +184,16 @@ distribution (the demo-application was compiled on Ubuntu 20.04). - without Secure Element ``` -user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W061_SDK_ROOT=/home/user/Desktop/SDK_2_6_4_K32W061DK6/ -user@ubuntu:~/Desktop/git/connectedhomeip$ ./third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh +user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W0_SDK_ROOT=/home/user/Desktop/SDK_2_6_6_K32W061DK6/ user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lock-app/nxp/k32w/k32w0/ -user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ gn gen out/debug --args="k32w0_sdk_root=\"${NXP_K32W061_SDK_ROOT}\" chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"mbedtls\" chip_with_se05x=0" +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ gn gen out/debug --args="k32w0_sdk_root=\"${NXP_K32W0_SDK_ROOT}\" chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"tinycrypt\" chip_with_se05x=0 chip_pw_tokenizer_logging=true mbedtls_repo=\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\"" user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ ninja -C out/debug -user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ $NXP_K32W061_SDK_ROOT/tools/imagetool/sign_images.sh out/debug/ +user@ubuntu:~/Desktop/git/connectedhomeip/examples/lock-app/nxp/k32w/k32w0$ $NXP_K32W0_SDK_ROOT/tools/imagetool/sign_images.sh out/debug/ ``` - with Secure element - Exactly the same steps as above but set chip_with_se05x=1 in the gn command - and add arguments chip_pw_tokenizer_logging=true chip_enable_ota_requestor=false - -Note that options chip_pw_tokenizer_logging=true and -chip_enable_ota_requestor=false are required for building with Secure Element. -These can be changed if building without Secure Element - -Note that "patch_k32w_sdk.sh" script must be run for patching the K32W061 SDK -2.6.4. + Exactly the same steps as above but set chip_with_se05x=1 in the gn command. Also, in case the OM15082 Expansion Board is not attached to the DK6 board, the build argument (chip_with_OM15082) inside the gn build instruction should be set @@ -218,7 +216,7 @@ pycrypto 2.6.1 pycryptodome 3.9.8 ``` -The resulting output file can be found in out/debug/chip-k32w061-lock-example. +The resulting output file can be found in out/debug/chip-k32w0x-lock-example. @@ -228,8 +226,8 @@ Program the firmware using the official [OpenThread Flash Instructions](https://github.com/openthread/ot-nxp/tree/main/src/k32w0/k32w061#flash-binaries). All you have to do is to replace the Openthread binaries from the above -documentation with _out/debug/chip-k32w061-lock-example.bin_ if DK6Programmer is -used or with _out/debug/chip-k32w061-lock-example_ if MCUXpresso is used. +documentation with _out/debug/chip-k32w0x-lock-example.bin_ if DK6Programmer is +used or with _out/debug/chip-k32w0x-lock-example_ if MCUXpresso is used. @@ -282,3 +280,97 @@ for step-by-step instructions. See [Unlocking the Future of Project CHIP Webinar](https://www.nxp.com/design/training/unlocking-the-future-of-project-chip:TIP-EEE-UNLOCKING-THE-FUTURE-OF-PROJECT-CHIP) for an in-depth analysis of NXP capabilities for Project CHIP. + + + +## Pigweed tokenizer + +The tokenizer is a pigweed module that allows hashing the strings. This greatly +reduces the flash needed for logs. The module can be enabled by building with +the gn argument _chip_pw_tokenizer_logging=true_. The detokenizer script is +needed for parsing the hashed scripts. + + + +### Detokenizer script + +The python3 script detokenizer.py is a script that decodes the tokenized logs +either from a file or from a serial port. It is located in the following path +`examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py`. + +The script can be used in the following ways: + +``` +usage: detokenizer.py serial [-h] -i INPUT -d DATABASE [-o OUTPUT] +usage: detokenizer.py file [-h] -i INPUT -d DATABASE -o OUTPUT +``` + +The first parameter is either _serial_ or _file_ and it selects between decoding +from a file or from a serial port. + +The second parameter is _-i INPUT_ and it must se set to the path of the file or +the serial to decode from. + +The third parameter is _-d DATABASE_ and represents the path to the token +database to be used for decoding. The default path is +_out/debug/chip-k32w0x-lock-example-database.bin_ after a successful build. + +The forth parameter is _-o OUTPUT_ and it represents the path to the output file +where the decoded logs will be stored. This parameter is required for file usage +and optional for serial usage. If not provided when used with serial port, it +will show the decoded log only at the stdout and not save it to file. + + + +### Notes + +The token database is created automatically after building the binary if the +argument _chip_pw_tokenizer_logging=true_ was used. + +The detokenizer script must be run inside the example's folder after a +successful run of the _scripts/activate.sh_ script. The pw_tokenizer module used +by the script is loaded by the environment. An example of running the +detokenizer script to see logs of a lock app: + +``` +python3 ../../../../../examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py serial -i /dev/ttyACM0 -d out/debug/chip-k32w0x-lock-example-database.bin -o device.txt +``` + + + +### Known issues + +The building process will not update the token database if it already exists. In +case that new strings are added and the database already exists in the output +folder, it must be deleted so that it will be recreated at the next build. + +Not all tokens will be decoded. This is due to a gcc/pw_tokenizer issue. The +pw_tokenizer creates special elf sections using attributes where the tokens and +strings will be stored. This sections will be used by the database creation +script. For template C++ functions, gcc ignores these attributes and places all +the strings by default in the .rodata section. As a result the database creation +script won't find them in the special-created sections. + +If run, closed and rerun with the serial option on the same serial port, the +detokenization script will get stuck and not show any logs. The solution is to +unplug and plug the board and then rerun the script. + + + +## Tinycrypt ECC operations + + + +### Building steps + +Note: This solution is temporary. + +In order to use the tinycrypt ecc operations, use the following build arguments: + +- Build without Secure element (_chip_with_se05x=0_), with tinycrypt enabled + (_chip_crypto=\"tinycrypt\"_) and with the `NXPmicro/mbedtls` library + (_mbedtls_repo=`\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\"`_). + +To disable tinycrypt ecc operations, simply build with _chip_crypto=\"mbedtls\"_ +and with or without _mbedtls_repo_. If used with _mbedtls_repo_ the mbedtls +implementation from `NXPmicro/mbedtls` library will be used. diff --git a/examples/lock-app/nxp/k32w/k32w0/args.gni b/examples/lock-app/nxp/k32w/k32w0/args.gni index a1b757c6612439..2ace8356337891 100644 --- a/examples/lock-app/nxp/k32w/k32w0/args.gni +++ b/examples/lock-app/nxp/k32w/k32w0/args.gni @@ -20,5 +20,3 @@ k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_stack_lock_tracking = "fatal" chip_enable_ble = true - -chip_progress_logging = false diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index 015784f6d6e8dd..3a78c9c7f632c4 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -166,12 +166,14 @@ CHIP_ERROR AppTask::Init() void LockOpenThreadTask(void) { + PWR_DisallowDeviceToSleep(); chip::DeviceLayer::ThreadStackMgr().LockThreadStack(); } void UnlockOpenThreadTask(void) { chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack(); + PWR_AllowDeviceToSleep(); } void AppTask::InitServer(intptr_t arg) @@ -728,9 +730,10 @@ void AppTask::DispatchEvent(AppEvent * aEvent) { aEvent->Handler(aEvent->param); } + else #endif - if (aEvent->Handler) + if (aEvent->Handler) { aEvent->Handler(aEvent); } diff --git a/examples/lock-app/nxp/k32w/k32w0/main/main.cpp b/examples/lock-app/nxp/k32w/k32w0/main/main.cpp index 216f98328503ee..a792030a7c78b0 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/main.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/main.cpp @@ -36,8 +36,11 @@ using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; using namespace ::chip::Logging; +#define ENABLE_LOW_POWER_LOGS 0 + #if defined(cPWR_UsePowerDownMode) && (cPWR_UsePowerDownMode) #include "Keyboard.h" +#include "OtaSupport.h" #include "PWR_Configuration.h" #include "PWR_Interface.h" #include "RNG_Interface.h" @@ -46,6 +49,8 @@ using namespace ::chip::Logging; #include "radio.h" #endif +#include "MacSched.h" + typedef void (*InitFunc)(void); extern InitFunc __init_array_start; extern InitFunc __init_array_end; @@ -55,6 +60,7 @@ extern InitFunc __init_array_end; extern "C" void vMMAC_IntHandlerBbc(); extern "C" void vMMAC_IntHandlerPhy(); extern "C" void BOARD_SetClockForPowerMode(void); +extern "C" void stopM2(); static void dm_switch_wakeupCallBack(void); static void dm_switch_preSleepCallBack(void); @@ -77,6 +83,8 @@ static sDualModeAppStates dualModeStates; #define THREAD_WARM_BOOT_INIT_DURATION_DEFAULT_VALUE 4000 #endif +extern "C" void sched_enable(); + /* needed for FreeRtos Heap 4 */ uint8_t __attribute__((section(".heap"))) ucHeap[HEAP_SIZE]; @@ -100,7 +108,9 @@ extern "C" void main_task(void const * argument) #if defined(cPWR_UsePowerDownMode) && (cPWR_UsePowerDownMode) PWR_Init(); - PWR_vAddRamRetention((uint32_t) &ucHeap[0], sizeof(ucHeap)); + /* Internal - MATTER-303: keep in retention the entire RAM1 for the moment */ + PWR_vAddRamRetention((uint32_t) 0x4020000, 0x10000); + PWR_RegisterLowPowerExitCallback(dm_switch_wakeupCallBack); PWR_RegisterLowPowerEnterCallback(dm_switch_preSleepCallBack); @@ -132,6 +142,11 @@ extern "C" void main_task(void const * argument) goto exit; } + /* Enable the MAC scheduler after BLEManagerImpl::_Init() and V2MMAC_Enable(). + * This is needed to register properly the active protocols. + */ + sched_enable(); + #if defined(cPWR_UsePowerDownMode) && (cPWR_UsePowerDownMode) dualModeStates.threadWarmBootInitTime = THREAD_WARM_BOOT_INIT_DURATION_DEFAULT_VALUE; dualModeStates.threadInitialized = TRUE; @@ -197,10 +212,15 @@ uint32_t dm_switch_get15_4InitWakeUpTime(void) extern "C" bleResult_t App_PostCallbackMessage(appCallbackHandler_t handler, appCallbackParam_t param) { AppEvent event; - event.Type = AppEvent::kEventType_Lp; + event.Type = AppEvent::kEventType_Lp; + event.Handler = handler; event.param = param; +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("App_PostCallbackMessage %d", (uint32_t) param); +#endif + GetAppTask().PostEvent(&event); return gBleSuccess_c; @@ -210,6 +230,11 @@ static void dm_switch_wakeupCallBack(void) { BOARD_SetClockForWakeup(); +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("dm_switch_wakeupCallBack"); + K32W_LOG("Warm up time actual value: %d", dualModeStates.threadWarmBootInitTime); +#endif + RNG_Init(); SecLib_Init(); @@ -218,25 +243,37 @@ static void dm_switch_wakeupCallBack(void) PWR_WakeupReason_t wakeReason = PWR_GetWakeupReason(); if (wakeReason.Bits.FromBLE_LLTimer == 1) { - SWITCH_DBG_LOG("woken up from LL"); +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("woken up from LL"); +#endif } else if (wakeReason.Bits.FromKeyBoard == 1) { - SWITCH_DBG_LOG("woken up from FromKeyBoard"); +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("woken up from FromKeyBoard"); +#endif } else if (wakeReason.Bits.FromTMR == 1) { - SWITCH_DBG_LOG("woken up from TMR"); +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("woken up from TMR"); +#endif } dm_lp_wakeup(); } static void dm_switch_preSleepCallBack(void) { - SWITCH_DBG_LOG("sleeping"); +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("dm_switch_preSleepCallBack"); +#endif if (dualModeStates.threadInitialized) { + /* stop the internal MAC Scheduler timer */ + stopM2(); + /* disable the MAC scheduler */ + sched_disable(); otPlatRadioDisable(NULL); dualModeStates.threadInitialized = FALSE; } @@ -251,6 +288,12 @@ static void dm_switch_preSleepCallBack(void) BOARD_SetClockForPowerMode(); } +extern "C" void vDynStopAll(void) +{ + vDynRequestState(E_DYN_SLAVE, E_DYN_STATE_OFF); + vDynRequestState(E_DYN_MASTER, E_DYN_STATE_OFF); +} + void dm_switch_init15_4AfterWakeUp(void) { uint32_t tick1 = 0; @@ -271,8 +314,13 @@ void dm_switch_init15_4AfterWakeUp(void) { tick2 = PWR_Get32kTimestamp(); dualModeStates.threadWarmBootInitTime = ((tick2 - tick1) * 15625u) >> 9; + /* Add a margin of 1 ms */ dualModeStates.threadWarmBootInitTime += 1000; + +#if ENABLE_LOW_POWER_LOGS + K32W_LOG("Calibration: %d", dualModeStates.threadWarmBootInitTime); +#endif } } @@ -287,6 +335,8 @@ static void ThreadExitSleep() /* Radio must be re-enabled after waking up from sleep. * The module is completely disabled in power down mode */ otPlatRadioEnable(NULL); + sched_enable(); + dualModeStates.threadInitialized = TRUE; /* wake up the Thread stack and check if any processing needs to be done */ diff --git a/examples/lock-app/p6/src/AppTask.cpp b/examples/lock-app/p6/src/AppTask.cpp index 6f62d3c3d852c8..7c4dd3d10385a8 100644 --- a/examples/lock-app/p6/src/AppTask.cpp +++ b/examples/lock-app/p6/src/AppTask.cpp @@ -66,7 +66,7 @@ using chip::FabricIndex; using chip::GetRequestorInstance; using chip::NodeId; using chip::OTADownloader; -using chip::OTAImageProcessorImpl; +using chip::DeviceLayer::OTAImageProcessorImpl; using chip::System::Layer; using namespace ::chip; @@ -662,34 +662,14 @@ void vApplicationStackOverflowHook(TaskHandle_t pxTask, char * pcTaskName) #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void AppTask::InitOTARequestor() { - CHIP_ERROR err = CHIP_NO_ERROR; SetRequestorInstance(&gRequestorCore); gRequestorStorage.Init(chip::Server::GetInstance().GetPersistentStorage()); gRequestorCore.Init(chip::Server::GetInstance(), gRequestorStorage, gRequestorUser, gDownloader); gImageProcessor.SetOTADownloader(&gDownloader); gDownloader.SetImageProcessorDelegate(&gImageProcessor); + ConfigurationMgr().StoreSoftwareVersion(CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - uint32_t savedSoftwareVersion; - err = ConfigurationMgr().GetSoftwareVersion(savedSoftwareVersion); - if (err != CHIP_NO_ERROR) - { - P6_LOG("Can't get saved software version"); - appError(err); - } - - if (savedSoftwareVersion != CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION) - { - ConfigurationMgr().StoreSoftwareVersion(CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); - - P6_LOG("Confirming update to version: %u", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); - chip::OTARequestorInterface * requestor = chip::GetRequestorInstance(); - if (requestor != nullptr) - { - requestor->NotifyUpdateApplied(); - } - } - P6_LOG("Current Software Version: %u", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); P6_LOG("Current Software Version String: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); } diff --git a/examples/lock-app/qpg/include/AppTask.h b/examples/lock-app/qpg/include/AppTask.h index fd6c1d888a8b7e..005d0aeb9da6e0 100644 --- a/examples/lock-app/qpg/include/AppTask.h +++ b/examples/lock-app/qpg/include/AppTask.h @@ -52,6 +52,7 @@ class AppTask friend AppTask & GetAppTask(void); CHIP_ERROR Init(); + static void InitServer(intptr_t arg); static void ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor); static void ActionCompleted(BoltLockManager::Action_t aAction); diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index e418e1def9fc71..86a28d5e9bb863 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -108,12 +108,38 @@ CHIP_ERROR AppTask::StartAppTask() return CHIP_NO_ERROR; } +void AppTask::InitServer(intptr_t arg) +{ + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + + gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + + 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); + +#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs); +#endif +} CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + // Init ZCL Data Model and start server + PlatformMgr().ScheduleWork(InitServer, 0); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + + // Setup Bolt err = BoltLockMgr().Init(); if (err != CHIP_NO_ERROR) { @@ -122,32 +148,11 @@ CHIP_ERROR AppTask::Init() } BoltLockMgr().SetCallbacks(ActionInitiated, ActionCompleted); - // Subscribe with our button callback to the qvCHIP button handler. + // Setup button handler qvIO_SetBtnCallback(ButtonEventHandler); qvIO_LedSet(LOCK_STATE_LED, !BoltLockMgr().IsUnlocked()); -#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(); - - gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); - chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); - - 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); - - // Initialize device attestation config - SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - UpdateClusterState(); ConfigurationMgr().LogDeviceConfig(); @@ -164,7 +169,6 @@ void AppTask::AppTaskMain(void * pvParameter) if (err != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "AppTask.Init() failed: %" CHIP_ERROR_FORMAT, err.Format()); - return; } ChipLogProgress(NotSpecified, "App Task started"); diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index d21e442b6b0065..75377e1ac9f1a8 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -121,7 +121,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -317,7 +317,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -396,7 +395,7 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 0d7c9f937d3d46..07fd85e68d3432 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -339,7 +339,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -621,7 +621,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -713,8 +712,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -780,10 +779,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 09ffb5b4fad390..80d3b3e88cf779 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -342,7 +342,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -624,7 +624,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -716,8 +715,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -783,10 +782,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index d294fde5d4cddf..a04c825fa58328 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -88,12 +88,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -195,13 +195,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } client cluster OnOff = 6 { @@ -689,7 +689,7 @@ client cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralCommissioning = 48 { @@ -751,7 +751,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1236,7 +1236,6 @@ client cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1301,8 +1300,8 @@ client cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1316,7 +1315,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1401,8 +1399,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index d294fde5d4cddf..a04c825fa58328 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -88,12 +88,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -195,13 +195,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } client cluster OnOff = 6 { @@ -689,7 +689,7 @@ client cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralCommissioning = 48 { @@ -751,7 +751,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1236,7 +1236,6 @@ client cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1301,8 +1300,8 @@ client cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1316,7 +1315,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1401,8 +1399,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } diff --git a/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld b/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld similarity index 93% rename from examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld rename to examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld index 3bb028d183d9dd..359a9ef790336d 100644 --- a/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w061-linker.ld +++ b/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld @@ -28,7 +28,7 @@ /** * @file - * GCC linker script for K32W061. + * GCC linker script for K32W061/K32W041. */ OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") @@ -58,13 +58,15 @@ m_app_start = DEFINED(__app_load_address__) ? __app_load_address__ : m_app_meta_data = 0x400; /* 640K (Total Flash size) - 16K (SSBL + SSBL update region) - 8.5K (PSECT) - m_app_meta_data */ -m_app_size = DEFINED(__app_stated_size__) ? __app_stated_size__ : 0x9FC00; +m_app_size = DEFINED(__app_stated_size__) ? __app_stated_size__ : 0x9DE00; MEMORY { - Flash640 (rx) : ORIGIN = m_app_start, LENGTH = m_app_size - RAM0 (rwx) : ORIGIN = 0x4000400, LENGTH = 0x0015c00 /* 87K bytes (alias RAM) */ - RAM1 (rwx) : ORIGIN = 0x4020000, LENGTH = 0x10000 /* 64K bytes (alias RAM2) */ + Flash640 (rx) : ORIGIN = m_app_start, LENGTH = m_app_size + + SCRATCH_RAM(rwx) : ORIGIN = 0x4000000, LENGTH = 0x400 /* 1K bytes (alias SCRATCH_RAM) */ + RAM0 (rwx) : ORIGIN = 0x4000400, LENGTH = 0x0015c00 /* 87K bytes (alias RAM) */ + RAM1 (rwx) : ORIGIN = 0x4020000, LENGTH = 0x10000 /* 64K bytes (alias RAM2) */ } /* Define a symbol for the top of each memory region */ @@ -234,6 +236,13 @@ SECTIONS . = ALIGN(4); __interrupts_ram_end__ = .; /* Define a global symbol at data end */ } > RAM0 + .scratch_area (NOLOAD): ALIGN(4) + { + __scratch_area_start__ = .; + . = ALIGN(4) ; + . += 0x400; + __scratch_area_top__ = .; + } > SCRATCH_RAM /* MAIN DATA SECTION */ .uninit_RESERVED : ALIGN(4) @@ -340,6 +349,8 @@ SECTIONS PROVIDE(Chip_LOWPOWER_ChipSoftwareReset = 0x03003fa1); PROVIDE(_pvHeapStart = _heap); PROVIDE(_pvHeapLimit = _pvHeapStart + (HEAP_SIZE)); + PROVIDE(_scratch_buf_start = __scratch_area_start__); + PROVIDE(_scratch_buf_end = __scratch_area_top__); __StackLimit = _vStackTop - STACK_SIZE; } diff --git a/examples/platform/nxp/k32w/k32w0/app/project_include/OpenThreadConfig.h b/examples/platform/nxp/k32w/k32w0/app/project_include/OpenThreadConfig.h index 667574786bb91e..ef95988da9ab24 100644 --- a/examples/platform/nxp/k32w/k32w0/app/project_include/OpenThreadConfig.h +++ b/examples/platform/nxp/k32w/k32w0/app/project_include/OpenThreadConfig.h @@ -96,6 +96,8 @@ #undef OPENTHREAD_CONFIG_PLATFORM_CSL_UNCERT +#define UART_USE_SERIAL_MGR 1 + //#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG // Use the NXP-supplied default platform configuration for remainder diff --git a/examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c b/examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c index 5bdb70c6ee21fc..e6a445c1c086ff 100644 --- a/examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c +++ b/examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c @@ -236,7 +236,14 @@ extern void OTAIdleActivities(void); void vApplicationIdleHook(void) { + // Data queued by PDM will be written to external flash + // when PDM_vIdleTask is called. Interrupts are disabled + // to ensure there is no context switch during the actual + // writing, thus avoiding race conditions. + OSA_InterruptDisable(); PDM_vIdleTask(PDM_MAX_WRITES_INFINITE); + OSA_InterruptEnable(); + OTAIdleActivities(); BOARD_ActionOnIdle(); } diff --git a/examples/lighting-app/nxp/k32w/k32w0/detokenizer.py b/examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py similarity index 100% rename from examples/lighting-app/nxp/k32w/k32w0/detokenizer.py rename to examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 6df0cd5539965f..ab85bf6228eb19 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -508,7 +508,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -896,7 +896,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -991,8 +990,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1061,10 +1060,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster PumpConfigurationAndControl = 512 { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 20890f9d4fa567..5448d745c86373 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -423,7 +423,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -811,7 +811,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -906,8 +905,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -976,10 +975,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } client cluster PumpConfigurationAndControl = 512 { diff --git a/examples/shell/nxp/k32w/k32w0/BUILD.gn b/examples/shell/nxp/k32w/k32w0/BUILD.gn index 505373a42bf860..f6c4039783a5dd 100644 --- a/examples/shell/nxp/k32w/k32w0/BUILD.gn +++ b/examples/shell/nxp/k32w/k32w0/BUILD.gn @@ -57,7 +57,7 @@ k32w0_sdk("sdk") { } k32w0_executable("shell_app") { - output_name = "chip-k32w061-shell-example" + output_name = "chip-k32w0x-shell-example" sources = [ "${k32w0_platform_dir}/util/LEDWidget.cpp", @@ -79,7 +79,7 @@ k32w0_executable("shell_app") { output_dir = root_out_dir - ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w061-linker.ld" + ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w0x-linker.ld" inputs = [ ldscript ] diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index cf3ab81c21d6b2..76830d443cbb17 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -237,7 +237,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -651,7 +651,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -743,8 +742,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -810,10 +809,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index da69099d90f4d1..9dedf82c5c8911 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -128,12 +128,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -235,13 +235,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster Descriptor = 29 { @@ -555,7 +555,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1135,7 +1135,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1227,8 +1226,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 414058c5e9e277..553ba3577bd5ca 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -461,7 +461,7 @@ client cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster GeneralCommissioning = 48 { @@ -520,7 +520,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } client cluster NetworkCommissioning = 49 { @@ -1236,7 +1236,6 @@ client cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1323,7 +1322,7 @@ client cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1337,7 +1336,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1429,8 +1427,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1496,10 +1494,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h index 522478444789b0..0bde8e593b2dfb 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h @@ -24,9 +24,23 @@ @interface CastingServerBridge : NSObject -@property void (^_Nullable commissioningCompleteCallback)(bool); - -@property void (^_Nullable launchUrlResponseCallback)(bool); +@property void (^_Nonnull commissioningCompleteCallback)(bool); + +@property void (^_Nonnull contentLauncher_launchUrlResponseCallback)(bool); +@property void (^_Nonnull levelControl_stepResponseCallback)(bool); +@property void (^_Nonnull levelControl_moveToLevelResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_playResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_pauseResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_stopPlaybackResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_nextResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_seekResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_skipForwardResponseCallback)(bool); +@property void (^_Nonnull mediaPlayback_skipBackwardResponseCallback)(bool); +@property void (^_Nonnull applicationLauncher_launchAppResponseCallback)(bool); +@property void (^_Nonnull applicationLauncher_stopAppResponseCallback)(bool); +@property void (^_Nonnull applicationLauncher_hideAppResponseCallback)(bool); +@property void (^_Nonnull targetNavigator_navigateTargetResponseCallback)(bool); +@property void (^_Nonnull keypadInput_sendKeyResponseCallback)(bool); @property OnboardingPayload * _Nonnull onboardingPayload; @@ -91,9 +105,9 @@ @param commissioningWindowRequestedHandler Handler to call on requesting the opening of a commissioning window */ -- (void)openBasicCommissioningWindow:(nullable void (^)(bool))commissioningCompleteCallback +- (void)openBasicCommissioningWindow:(void (^_Nonnull)(bool))commissioningCompleteCallback clientQueue:(dispatch_queue_t _Nonnull)clientQueue - commissioningWindowRequestedHandler:(nullable void (^)(bool))commissioningWindowRequestedHandler; + commissioningWindowRequestedHandler:(void (^_Nonnull)(bool))commissioningWindowRequestedHandler; /*! @brief Send a Content Launcher:LaunchURL request to a TV @@ -102,17 +116,269 @@ @param contentDisplayStr Display string value corresponding to the content - @param launchUrlResponseCallback Callback for when the Launch URL response has been received + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)contentLauncher_launchUrl:(NSString * _Nonnull)contentUrl + contentDisplayStr:(NSString * _Nonnull)contentDisplayStr + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a LevelControl:Step request to a TV + + @param stepMode Increase (0x00) or Decrease (0x01) the device’s level + + @param stepSize Number of units to step the device's level by + + @param transitionTime Time that SHALL be taken to perform the step, in tenths of a second + + @param optionMask Used to create a temporary Options bitmap to construct the Options attribute + + @param optionOverride Used to create a temporary Options bitmap to construct the Options attribute + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on - @param clientQueue Queue to dispatch the call to the launchUrlRequestSentHandler on + @param requestSentHandler Handler to call on sending the request + */ +- (void)levelControl_step:(uint8_t)stepMode + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a LevelControl:MoveToLevel request to a TV + + @param level the level to which the device should move + + @param transitionTime Time that SHALL be taken to perform the step, in tenths of a second + + @param optionMask Used to create a temporary Options bitmap to construct the Options attribute + + @param optionOverride Used to create a temporary Options bitmap to construct the Options attribute - @param launchUrlRequestSentHandler Handler to call on sending the Launch URL request + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request */ -- (void)contentLauncherLaunchUrl:(NSString * _Nonnull)contentUrl - contentDisplayStr:(NSString * _Nonnull)contentDisplayStr - launchUrlResponseCallback:(nullable void (^)(bool))launchUrlResponseCallback +- (void)levelControl_moveToLevel:(uint8_t)level + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseCallback:(void (^_Nonnull)(bool))responseCallback clientQueue:(dispatch_queue_t _Nonnull)clientQueue - launchUrlRequestSentHandler:(nullable void (^)(bool))launchUrlRequestSentHandler; + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:Play request to a TV + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_play:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:Pause request to a TV + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_pause:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:StopPlayback request to a TV + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_stopPlayback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:Next request to a TV + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_next:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:Seek request to a TV + + @param position the position (in milliseconds) in the media to seek to + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_seek:(uint8_t)position + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:SkipForward request to a TV + + @param deltaPositionMilliseconds the duration of the time span to skip forward in the media, in milliseconds + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_skipForward:(uint64_t)deltaPositionMilliseconds + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a MediaPlayback:SkipBackward request to a TV + + @param deltaPositionMilliseconds the duration of the time span to skip backward in the media, in milliseconds + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)mediaPlayback_skipBackward:(uint64_t)deltaPositionMilliseconds + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a ApplicationLauncher:LaunchApp request to a TV + + @param catalogVendorId CSA-issued vendor ID for the catalog + + @param applicationId application identifier, unique within a catalog, expressed as a string, such as "PruneVideo" or "Company X" + + @param data optional app-specific data to be sent to the app + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)applicationLauncher_launchApp:(uint16_t)catalogVendorId + applicationId:(NSString * _Nonnull)applicationId + data:(NSData * _Nullable)data + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a ApplicationLauncher:StopApp request to a TV + + @param catalogVendorId CSA-issued vendor ID for the catalog + + @param applicationId application identifier, unique within a catalog, expressed as a string, such as "PruneVideo" or "Company X" + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)applicationLauncher_stopApp:(uint16_t)catalogVendorId + applicationId:(NSString * _Nonnull)applicationId + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a ApplicationLauncher:HideApp request to a TV + + @param catalogVendorId CSA-issued vendor ID for the catalog + + @param applicationId application identifier, unique within a catalog, expressed as a string, such as "PruneVideo" or "Company X" + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)applicationLauncher_hideApp:(uint16_t)catalogVendorId + applicationId:(NSString * _Nonnull)applicationId + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a TargetNavigator:NavigateTarget request to a TV + + @param target Identifier for the target for UX navigation, contained within one of the TargetInfo objects in the TargetList + attribute list. + + @param data Optional app-specific data + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)targetNavigator_navigateTarget:(uint8_t)target + data:(NSString * _Nullable)data + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a KeypadInput:SendKey request to a TV + + @param keyCode Key Code to process. If a second SendKey request with the same KeyCode value is received within 200ms, then the + endpoint will consider the first key press to be a press and hold. When such a repeat KeyCode value is not received within 200ms, + then the endpoint will consider the last key press to be a release. + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to dispatch the call to the requestSentHandler on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)keypadInput_sendKey:(uint8_t)keyCode + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + @end #endif /* CastingServerBridge_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm index de72fd816071ff..e854db7092e9eb 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm @@ -184,9 +184,9 @@ - (OnboardingPayload *)getOnboardingPaylod return _onboardingPayload; } -- (void)openBasicCommissioningWindow:(nullable void (^)(bool))commissioningCompleteCallback +- (void)openBasicCommissioningWindow:(void (^_Nonnull)(bool))commissioningCompleteCallback clientQueue:(dispatch_queue_t _Nonnull)clientQueue - commissioningWindowRequestedHandler:(nullable void (^)(bool))commissioningWindowRequestedHandler + commissioningWindowRequestedHandler:(void (^_Nonnull)(bool))commissioningWindowRequestedHandler { ChipLogProgress(AppServer, "CastingServerBridge().openBasicCommissioningWindow() called"); @@ -201,21 +201,305 @@ - (void)openBasicCommissioningWindow:(nullable void (^)(bool))commissioningCompl }); } -- (void)contentLauncherLaunchUrl:(NSString * _Nonnull)contentUrl - contentDisplayStr:(NSString * _Nonnull)contentDisplayStr - launchUrlResponseCallback:(nullable void (^)(bool))launchUrlResponseCallback - clientQueue:(dispatch_queue_t _Nonnull)clientQueue - launchUrlRequestSentHandler:(nullable void (^)(bool))launchUrlRequestSentHandler +- (void)contentLauncher_launchUrl:(NSString * _Nonnull)contentUrl + contentDisplayStr:(NSString * _Nonnull)contentDisplayStr + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().contentLauncherLaunchUrl() called"); + ChipLogProgress(AppServer, "CastingServerBridge().contentLauncher_launchUrl() called"); - _launchUrlResponseCallback = launchUrlResponseCallback; + _contentLauncher_launchUrlResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->ContentLauncherLaunchURL( + [contentUrl UTF8String], [contentDisplayStr UTF8String], [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].contentLauncher_launchUrlResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)levelControl_step:(uint8_t)stepMode + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().levelControl_step() called"); + + _levelControl_stepResponseCallback = responseCallback; dispatch_async(_chipWorkQueue, ^{ CHIP_ERROR err - = CastingServer::GetInstance()->ContentLauncherLaunchURL([contentUrl UTF8String], [contentDisplayStr UTF8String], - [](CHIP_ERROR err) { [CastingServerBridge getSharedInstance].launchUrlResponseCallback(CHIP_NO_ERROR == err); }); + = CastingServer::GetInstance()->LevelControl_Step(static_cast(stepMode), + stepSize, transitionTime, optionMask, optionOverride, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].levelControl_stepResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)levelControl_moveToLevel:(uint8_t)level + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().levelControl_moveToLevel() called"); + + _levelControl_moveToLevelResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_MoveToLevel( + level, transitionTime, optionMask, optionOverride, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].levelControl_moveToLevelResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_play:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_play() called"); + + _mediaPlayback_playResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Play([](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_playResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_pause:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_pause() called"); + + _mediaPlayback_pauseResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Pause([](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_pauseResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_stopPlayback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_stopPlayback() called"); + + _mediaPlayback_pauseResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Pause([](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_stopPlaybackResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_next:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_next() called"); + + _mediaPlayback_nextResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Next([](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_nextResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_seek:(uint8_t)position + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_seek() called"); + + _mediaPlayback_seekResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Seek(position, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_seekResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_skipForward:(uint64_t)deltaPositionMilliseconds + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_skipForward() called"); + + _mediaPlayback_skipForwardResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SkipForward(deltaPositionMilliseconds, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_skipForwardResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)mediaPlayback_skipBackward:(uint64_t)deltaPositionMilliseconds + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_skipBackward() called"); + + _mediaPlayback_skipBackwardResponseCallback = responseCallback; + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SkipBackward(deltaPositionMilliseconds, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].mediaPlayback_skipBackwardResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)applicationLauncher_launchApp:(uint16_t)catalogVendorId + applicationId:(NSString * _Nonnull)applicationId + data:(NSData * _Nullable)data + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().applicationLauncher_launchApp() called"); + + _applicationLauncher_launchAppResponseCallback = responseCallback; + + chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; + application.catalogVendorId = catalogVendorId; + application.applicationId = chip::CharSpan::fromCharString([applicationId UTF8String]); + + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationLauncher_LaunchApp(application, + chip::MakeOptional(chip::ByteSpan(static_cast(data.bytes), data.length)), [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].applicationLauncher_launchAppResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)applicationLauncher_stopApp:(uint16_t)catalogVendorId + applicationId:(NSString * _Nonnull)applicationId + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().applicationLauncher_stopApp() called"); + + _applicationLauncher_stopAppResponseCallback = responseCallback; + + chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; + application.catalogVendorId = catalogVendorId; + application.applicationId = chip::CharSpan::fromCharString([applicationId UTF8String]); + + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationLauncher_StopApp(application, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].applicationLauncher_stopAppResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)applicationLauncher_hideApp:(uint16_t)catalogVendorId + applicationId:(NSString * _Nonnull)applicationId + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().applicationLauncher_hideApp() called"); + + _applicationLauncher_hideAppResponseCallback = responseCallback; + + chip::app::Clusters::ApplicationLauncher::Structs::Application::Type application; + application.catalogVendorId = catalogVendorId; + application.applicationId = chip::CharSpan::fromCharString([applicationId UTF8String]); + + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationLauncher_HideApp(application, [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].applicationLauncher_hideAppResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)targetNavigator_navigateTarget:(uint8_t)target + data:(NSString * _Nullable)data + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().targetNavigator_navigateTarget() called"); + + _targetNavigator_navigateTargetResponseCallback = responseCallback; + + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->TargetNavigator_NavigateTarget( + target, chip::MakeOptional(chip::CharSpan::fromCharString([data UTF8String])), [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].targetNavigator_navigateTargetResponseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)keypadInput_sendKey:(uint8_t)keyCode + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().keypadInput_sendKey() called"); + + _keypadInput_sendKeyResponseCallback = responseCallback; + + dispatch_async(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->KeypadInput_SendKey( + static_cast(keyCode), [](CHIP_ERROR err) { + [CastingServerBridge getSharedInstance].keypadInput_sendKeyResponseCallback(CHIP_NO_ERROR == err); + }); dispatch_async(clientQueue, ^{ - launchUrlRequestSentHandler(CHIP_NO_ERROR == err); + requestSentHandler(CHIP_NO_ERROR == err); }); }); } diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/ContentLauncherViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/ContentLauncherViewModel.swift index c3506bfd068aec..ee741f8bcae8f0 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/ContentLauncherViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/ContentLauncherViewModel.swift @@ -32,9 +32,9 @@ class ContentLauncherViewModel: ObservableObject { if let castingServerBridge = CastingServerBridge.getSharedInstance() { castingServerBridge - .contentLauncherLaunchUrl(contentUrl!, + .contentLauncher_launchUrl(contentUrl!, contentDisplayStr: contentDisplayStr!, - launchUrlResponseCallback: + responseCallback: { (result: Bool) -> () in self.Log.info("ContentLauncherViewModel.launchUrl.launchUrlResponseCallback result \(result)") DispatchQueue.main.async { @@ -42,7 +42,7 @@ class ContentLauncherViewModel: ObservableObject { } }, clientQueue: DispatchQueue.main, - launchUrlRequestSentHandler: + requestSentHandler: { (result: Bool) -> () in self.Log.info("ContentLauncherViewModel.launchUrl.launcUrlRequestSentHandler result \(result)") self.status = result ? "Sent Launch URL request" : "Failed to send Launch URL request!" diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index ebf643296e65f0..3047552b9c7abe 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -93,12 +93,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -200,13 +200,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } client cluster OnOff = 6 { @@ -810,7 +810,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1429,7 +1429,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1521,8 +1520,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1580,10 +1579,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index c899c4af42fba7..9efbdd12b4de60 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -105,12 +105,12 @@ server cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } server cluster Scenes = 5 { @@ -215,13 +215,13 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } server cluster Descriptor = 29 { @@ -688,7 +688,7 @@ server cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } server cluster NetworkCommissioning = 49 { @@ -1249,7 +1249,6 @@ server cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1344,8 +1343,8 @@ server cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1414,10 +1413,10 @@ server cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } server cluster FixedLabel = 64 { diff --git a/gn_build.sh b/gn_build.sh index 86e2ff6889c6d3..0615a1833ef40d 100755 --- a/gn_build.sh +++ b/gn_build.sh @@ -154,14 +154,14 @@ fi # K32W SDK setup k32w_sdk_args="" -if [[ -d "$NXP_K32W061_SDK_ROOT" ]]; then - k32w_sdk_args+="k32w0_sdk_root=\"$NXP_K32W061_SDK_ROOT\"" +if [[ -d "$NXP_K32W0_SDK_ROOT" ]]; then + k32w_sdk_args+="k32w0_sdk_root=\"$NXP_K32W0_SDK_ROOT\"" extra_args+=" $k32w0_sdk_args enable_k32w_builds=true" fi echo -if [[ ! -d "$NXP_K32W061_SDK_ROOT" ]]; then - echo "Hint: Set \$NXP_K32W061_SDK_ROOT to enable building for K32W061" +if [[ ! -d "$NXP_K32W0_SDK_ROOT" ]]; then + echo "Hint: Set \$NXP_K32W0_SDK_ROOT to enable building for K32W061" else echo 'To build the K32W lock sample as a standalone project': echo "(cd $CHIP_ROOT/examples/lock-app/nxp/k32w/k32w0; gn gen out/debug --args='$k32w_sdk_args'; ninja -C out/debug)" diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index ce4145250ef011..27e2eaa6773fae 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -54,4 +54,4 @@ artifacts: # slow. options: machineType: "E2_HIGHCPU_32" - diskSizeGb: 200 + diskSizeGb: 500 diff --git a/integrations/docker/build.sh b/integrations/docker/build.sh index 6c4a1a2dc26f98..cb52fe60746e89 100755 --- a/integrations/docker/build.sh +++ b/integrations/docker/build.sh @@ -33,6 +33,12 @@ IMAGE=${DOCKER_BUILD_IMAGE:-$(basename "$(pwd)")} # version VERSION=${DOCKER_BUILD_VERSION:-$(sed 's/ .*//' version)} +if [[ $OSTYPE == 'darwin'* ]]; then + DOCKER_VOLUME_PATH=~/Library/Containers/com.docker.docker/Data/vms/0/ +else + DOCKER_VOLUME_PATH=/var/lib/docker/ +fi + [[ ${*/--help//} != "${*}" ]] && { set +x echo "Usage: $me @@ -59,7 +65,7 @@ set -ex [[ -n $VERSION ]] || die "version cannot be empty" -mb_space_before=$(df -m /var/lib/docker/ | awk 'FNR==2{print $3}') +mb_space_before=$(df -m "$DOCKER_VOLUME_PATH" | awk 'FNR==2{print $3}') # go find and build any CHIP images this image is "FROM" awk -F/ '/^FROM connectedhomeip/ {print $2}' Dockerfile | while read -r dep; do @@ -92,8 +98,9 @@ docker image prune --force } docker images --filter=reference="$ORG/*" -df -h /var/lib/docker/ -mb_space_after=$(df -m /var/lib/docker/ | awk 'FNR==2{print $3}') +df -h "$DOCKER_VOLUME_PATH" +mb_space_after=$(df -m "$DOCKER_VOLUME_PATH" | awk 'FNR==2{print $3}') + printf "%'.f MB total used\n" "$((mb_space_before - mb_space_after))" exit 0 diff --git a/integrations/docker/images/chip-build-crosscompile/Dockerfile b/integrations/docker/images/chip-build-crosscompile/Dockerfile index 7bed01556f202b..59e023ea16f688 100644 --- a/integrations/docker/images/chip-build-crosscompile/Dockerfile +++ b/integrations/docker/images/chip-build-crosscompile/Dockerfile @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - git=1:2.25.1-1ubuntu3.4 \ + git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-doxygen/Dockerfile b/integrations/docker/images/chip-build-doxygen/Dockerfile index 81fa1a7255364f..f9bff774d696b5 100644 --- a/integrations/docker/images/chip-build-doxygen/Dockerfile +++ b/integrations/docker/images/chip-build-doxygen/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.15 RUN apk --no-cache add \ - doxygen=1.9.2-r1 \ - graphviz=2.49.3-r0 \ - bash=5.1.16-r0 \ - git=2.34.2-r0 + doxygen=1.9.2-r1 \ + graphviz=2.49.3-r0 \ + bash \ + git diff --git a/integrations/docker/images/chip-build-esp32-qemu/Dockerfile b/integrations/docker/images/chip-build-esp32-qemu/Dockerfile index ea4ad647a8651c..6e69acf7f72478 100644 --- a/integrations/docker/images/chip-build-esp32-qemu/Dockerfile +++ b/integrations/docker/images/chip-build-esp32-qemu/Dockerfile @@ -4,9 +4,7 @@ FROM connectedhomeip/chip-build-esp32:${VERSION} RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - ninja-build=1.10.0-1build1 \ - git=1:2.25.1-1ubuntu3.4 \ - libgcrypt20-dev=1.8.5-5ubuntu1.1 \ + ninja-build git libgcrypt20-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index 9837ededf21b55..925fa68b03936b 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - git=1:2.25.1-1ubuntu3.4 \ + git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-imx/Dockerfile b/integrations/docker/images/chip-build-imx/Dockerfile index 8acc03833f9fec..815d3512d907e9 100644 --- a/integrations/docker/images/chip-build-imx/Dockerfile +++ b/integrations/docker/images/chip-build-imx/Dockerfile @@ -3,7 +3,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - wget=1.20.3-1ubuntu2 \ + wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-k32w/Dockerfile b/integrations/docker/images/chip-build-k32w/Dockerfile index 8a2887b6afe804..ba925821566384 100644 --- a/integrations/docker/images/chip-build-k32w/Dockerfile +++ b/integrations/docker/images/chip-build-k32w/Dockerfile @@ -4,8 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - wget=1.20.3-1ubuntu2 \ - unzip=6.0-25ubuntu1 \ + wget unzip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-mbed-os/Dockerfile b/integrations/docker/images/chip-build-mbed-os/Dockerfile index ee47fc681eeb89..459bca5d6bdf38 100644 --- a/integrations/docker/images/chip-build-mbed-os/Dockerfile +++ b/integrations/docker/images/chip-build-mbed-os/Dockerfile @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - wget=1.20.3-1ubuntu2 \ + wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index 4c8009bbb11cc1..633a921f4d58e1 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -7,7 +7,7 @@ ARG NCS_REVISION=fd5905aa6b04febd99d00dba6c482ac25eb15222 RUN set -x \ && apt-get update \ && apt-get install --no-install-recommends -fy \ - curl=7.68.0-1ubuntu2.11 \ + curl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-telink/Dockerfile b/integrations/docker/images/chip-build-telink/Dockerfile index 508226089c0401..ba3604f82e47f0 100644 --- a/integrations/docker/images/chip-build-telink/Dockerfile +++ b/integrations/docker/images/chip-build-telink/Dockerfile @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} as build RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - wget=1.20.3-1ubuntu2 \ + wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line @@ -17,21 +17,17 @@ RUN set -x \ && : # last line # Setup Zephyr -ARG ZEPHYR_REVISION=95b54c90b1b7fb2626a9af3a5b7bd16459f35b45 +ARG ZEPHYR_REVISION=8cf9cc52e4de98d0303d8fed6a57ae956954986d WORKDIR /opt/telink/zephyrproject RUN set -x \ && python3 -m pip install -U --no-cache-dir \ west==0.12.0 \ - && git clone https://github.com/rikorsev/zephyr \ + && git clone https://github.com/telink-semi/zephyr \ && cd zephyr \ && git reset ${ZEPHYR_REVISION} --hard \ && west init -l \ && cd .. \ && west update -o=--depth=1 -n -f smart \ - && cd modules/hal/telink \ - && git remote add telink https://github.com/rikorsev/hal_telink \ - && git fetch telink telink_crypto \ - && git checkout telink_crypto \ && west zephyr-export \ && : # last line diff --git a/integrations/docker/images/chip-build-ti/Dockerfile b/integrations/docker/images/chip-build-ti/Dockerfile index 593b434c5a6df9..5e99fb9f44fc5a 100644 --- a/integrations/docker/images/chip-build-ti/Dockerfile +++ b/integrations/docker/images/chip-build-ti/Dockerfile @@ -4,7 +4,7 @@ FROM connectedhomeip/chip-build:${VERSION} RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - wget=1.20.3-1ubuntu2 \ + wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-tizen/Dockerfile b/integrations/docker/images/chip-build-tizen/Dockerfile index 3ae8192ec138c9..13fb66e234f1db 100644 --- a/integrations/docker/images/chip-build-tizen/Dockerfile +++ b/integrations/docker/images/chip-build-tizen/Dockerfile @@ -18,8 +18,8 @@ RUN set -x \ RUN set -x \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - cpio=2.13+dfsg-2 \ - obs-build=20180831-3ubuntu1 \ + cpio \ + obs-build \ openjdk-8-jre-headless \ zip \ # Cleanup diff --git a/integrations/docker/images/chip-build-vscode/Dockerfile b/integrations/docker/images/chip-build-vscode/Dockerfile index 5bbad09fa8a521..394adea2e19aa3 100644 --- a/integrations/docker/images/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/chip-build-vscode/Dockerfile @@ -41,7 +41,7 @@ COPY --from=crosscompile /opt/ubuntu-21.04-aarch64-sysroot /opt/ubuntu-21.04-aar COPY --from=ameba /opt/ameba /opt/ameba -COPY --from=k32w /opt/sdk/sdks /opt/sdk/sdks +COPY --from=k32w /opt/sdk /opt/k32w_sdk COPY --from=imx /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland @@ -75,7 +75,7 @@ ENV IDF_PATH=/opt/espressif/esp-idf/ ENV IDF_TOOLS_PATH=/opt/espressif/tools ENV IMX_SDK_ROOT=/opt/fsl-imx-xwayland/5.10-hardknott/ ENV NRF5_TOOLS_ROOT=/opt/NordicSemiconductor/nRF5_tools -ENV NXP_K32W061_SDK_ROOT=/opt/sdk/sdks +ENV NXP_K32W0_SDK_ROOT=/opt/k32w_sdk ENV OPENOCD_PATH=/opt/openocd/ ENV PW_ENVIRONMENT_ROOT=/home/vscode/pigweed/env ENV QEMU_ESP32=/opt/espressif/qemu/xtensa-softmmu/qemu-system-xtensa diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 816febab140ec8..7a3b5745b791b0 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.87 Version bump reason: K32W0-SDK 2.6.6 update +0.5.89 Version bump reason: match K32W sdk paths and logic with K32W Dockerfile diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index a4d3d859558bca..0ae6f05a9f328e 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -534,7 +534,7 @@ def K32WTargets(): target = Target('k32w', K32WBuilder) yield target.Extend('light-ota-se', app=K32WApp.LIGHT, release=True, disable_ble=True, se05x=True).GlobBlacklist("Only on demand build") - yield target.Extend('light-release-no-ota', app=K32WApp.LIGHT, tokenizer=True, disable_ota=True, release=True) + yield target.Extend('light-release-no-ota', app=K32WApp.LIGHT, tokenizer=True, disable_ota=True, release=True, tinycrypt=True) yield target.Extend('shell-release', app=K32WApp.SHELL, release=True) yield target.Extend('lock-release', app=K32WApp.LOCK, release=True) yield target.Extend('lock-low-power-release', app=K32WApp.LOCK, diff --git a/scripts/build/builders/k32w.py b/scripts/build/builders/k32w.py index ea446ec8a40e88..39828157e934eb 100644 --- a/scripts/build/builders/k32w.py +++ b/scripts/build/builders/k32w.py @@ -35,11 +35,13 @@ def ExampleName(self): def AppNamePrefix(self): if self == K32WApp.LIGHT: - return 'chip-k32w061-light-example' + return 'chip-k32w0x-light-example' elif self == K32WApp.LOCK: - return 'chip-k32w061-lock-example' + return 'chip-k32w0x-lock-example' elif self == K32WApp.SHELL: - return 'chip-k32w061-shell-example' + return 'chip-k32w0x-shell-example' + elif self == K32WApp.CONTACT: + return 'chip-k32w0x-contact-example' else: raise Exception('Unknown app type: %r' % self) @@ -58,7 +60,8 @@ def __init__(self, tokenizer: bool = False, disable_ble: bool = False, disable_ota: bool = False, - se05x: bool = False): + se05x: bool = False, + tinycrypt: bool = False): super(K32WBuilder, self).__init__( root=app.BuildRoot(root), runner=runner) @@ -70,10 +73,11 @@ def __init__(self, self.disable_ble = disable_ble self.disable_ota = disable_ota self.se05x = se05x + self.tinycrypt = tinycrypt def GnBuildArgs(self): args = [ - 'k32w0_sdk_root="%s"' % os.environ['NXP_K32W061_SDK_ROOT'], + 'k32w0_sdk_root="%s"' % os.environ['NXP_K32W0_SDK_ROOT'], ] if self.low_power: @@ -96,6 +100,9 @@ def GnBuildArgs(self): if self.se05x: args.append('chip_with_se05x=true') + if self.tinycrypt: + args.append('chip_crypto=\"tinycrypt\" mbedtls_repo=\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\"') + return args def generate(self): diff --git a/scripts/build/test.py b/scripts/build/test.py index 5559847adf50d9..056d34166a40ef 100644 --- a/scripts/build/test.py +++ b/scripts/build/test.py @@ -44,7 +44,7 @@ def build_actual_output(root: str, out: str, args: List[str]) -> List[str]: 'TIZEN_SDK_SYSROOT': 'TEST_TIZEN_SDK_SYSROOT', 'TELINK_ZEPHYR_SDK_DIR': 'TELINK_ZEPHYR_SDK_DIR', 'SYSROOT_AARCH64': 'SYSROOT_AARCH64', - 'NXP_K32W061_SDK_ROOT': 'TEST_NXP_K32W061_SDK_ROOT', + 'NXP_K32W0_SDK_ROOT': 'TEST_NXP_K32W0_SDK_ROOT', 'IMX_SDK_ROOT': 'IMX_SDK_ROOT', 'TI_SYSCONFIG_ROOT': 'TEST_TI_SYSCONFIG_ROOT', }) diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index fa887aca49fb73..e365f295f08c20 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -858,27 +858,27 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa {root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh # Generating k32w-light-ota-se -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 is_debug=false chip_enable_ble=false chip_with_se05x=true' {out}/k32w-light-ota-se +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W0_SDK_ROOT" chip_with_low_power=0 is_debug=false chip_enable_ble=false chip_with_se05x=true' {out}/k32w-light-ota-se {root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh # Generating k32w-light-release-no-ota -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 chip_pw_tokenizer_logging=true is_debug=false chip_enable_ota_requestor=false' {out}/k32w-light-release-no-ota +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W0_SDK_ROOT" chip_with_low_power=0 chip_pw_tokenizer_logging=true is_debug=false chip_enable_ota_requestor=false chip_crypto="tinycrypt" mbedtls_repo="//third_party/connectedhomeip/third_party/nxp/libs/mbedtls"' {out}/k32w-light-release-no-ota {root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh # Generating k32w-lock-low-power-release -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=1 is_debug=false' {out}/k32w-lock-low-power-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W0_SDK_ROOT" chip_with_low_power=1 is_debug=false' {out}/k32w-lock-low-power-release {root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh # Generating k32w-lock-release -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-lock-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W0_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-lock-release {root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh # Generating k32w-shell-release -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/shell/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-shell-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/shell/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W0_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-shell-release # Generating config mbed-CY8CPROTO_062_4343W-all-clusters-debug mbed-tools configure -t GCC_ARM -m CY8CPROTO_062_4343W -p {root}/examples/all-clusters-app/mbed -o {out}/mbed-CY8CPROTO_062_4343W-all-clusters-debug --mbed-os-path {root}/third_party/mbed-os/repo diff --git a/scripts/examples/k32w_se_example.sh b/scripts/examples/k32w_se_example.sh index 27c0b5a29fe48c..9815dc9f49a06c 100755 --- a/scripts/examples/k32w_se_example.sh +++ b/scripts/examples/k32w_se_example.sh @@ -27,5 +27,5 @@ env "$(dirname "$0")"/../../third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh -gn gen --check --fail-on-unused-args --root="$1" "$2" --args="k32w0_sdk_root=\"$NXP_K32W061_SDK_ROOT\" is_debug=false chip_crypto=\"mbedtls\" chip_with_se05x=1" +gn gen --check --fail-on-unused-args --root="$1" "$2" --args="k32w0_sdk_root=\"$NXP_K32W0_SDK_ROOT\" is_debug=false chip_crypto=\"mbedtls\" chip_with_se05x=1" ninja -C "$2" diff --git a/src/BUILD.gn b/src/BUILD.gn index bdc11442fc672e..c495ca83d1d908 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -128,4 +128,12 @@ if (chip_build_tests) { chip_test_group("fake_platform_tests") { deps = [ "${chip_root}/src/lib/dnssd/platform/tests" ] } + + # Tests to run with each Crypto PAL + chip_test_group("crypto_tests") { + deps = [ + "${chip_root}/src/credentials/tests", + "${chip_root}/src/crypto/tests", + ] + } } diff --git a/src/app/FailSafeContext.cpp b/src/app/FailSafeContext.cpp index f85e538d2e5543..ceadf923c59624 100644 --- a/src/app/FailSafeContext.cpp +++ b/src/app/FailSafeContext.cpp @@ -86,6 +86,8 @@ void FailSafeContext::ScheduleFailSafeCleanup(FabricIndex fabricIndex, bool addN CHIP_ERROR FailSafeContext::ArmFailSafe(FabricIndex accessingFabricIndex, System::Clock::Seconds16 expiryLengthSeconds) { + VerifyOrReturnError(!IsFailSafeBusy(), CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; bool cancelTimersIfError = false; if (!mFailSafeArmed) diff --git a/src/app/FailSafeContext.h b/src/app/FailSafeContext.h index e2759d85e71f06..370b21981582e1 100644 --- a/src/app/FailSafeContext.h +++ b/src/app/FailSafeContext.h @@ -75,6 +75,11 @@ class FailSafeContext bool IsFailSafeArmed() const { return mFailSafeArmed; } + // True if it is possible to do an initial arming of the failsafe if needed. + // To be used in places where some action should take place only if the + // fail-safe could be armed after that action. + bool IsFailSafeFullyDisarmed() const { return !IsFailSafeArmed() && !IsFailSafeBusy(); } + bool MatchesFabricIndex(FabricIndex accessingFabricIndex) const { VerifyOrDie(mFailSafeArmed); diff --git a/src/app/OperationalDeviceProxy.cpp b/src/app/OperationalDeviceProxy.cpp index 33373f79996a88..0e85731a6750d6 100644 --- a/src/app/OperationalDeviceProxy.cpp +++ b/src/app/OperationalDeviceProxy.cpp @@ -169,7 +169,11 @@ void OperationalDeviceProxy::UpdateDeviceData(const Transport::PeerAddress & add char peerAddrBuff[Transport::PeerAddress::kMaxToStringSize]; addr.ToString(peerAddrBuff); - ChipLogDetail(Controller, "Updating device address to %s while in state %d", peerAddrBuff, static_cast(mState)); + ChipLogDetail(Discovery, + "OperationalDeviceProxy[" ChipLogFormatX64 ":" ChipLogFormatX64 + "]: Updating device address to %s while in state %d", + ChipLogValueX64(mPeerId.GetCompressedFabricId()), ChipLogValueX64(mPeerId.GetNodeId()), peerAddrBuff, + static_cast(mState)); #endif CHIP_ERROR err = CHIP_NO_ERROR; @@ -366,7 +370,10 @@ OperationalDeviceProxy::~OperationalDeviceProxy() { if (mAddressLookupHandle.IsActive()) { - ChipLogProgress(Discovery, "Cancelling incomplete address resolution as device is being deleted."); + ChipLogDetail(Discovery, + "OperationalDeviceProxy[" ChipLogFormatX64 ":" ChipLogFormatX64 + "]: Cancelling incomplete address resolution as device is being deleted.", + ChipLogValueX64(mPeerId.GetCompressedFabricId()), ChipLogValueX64(mPeerId.GetNodeId())); // Skip cancel callback since the destructor is being called, so we assume that this object is // obviously not used anymore @@ -391,7 +398,10 @@ CHIP_ERROR OperationalDeviceProxy::LookupPeerAddress() // MoveToState calls in this method. if (mAddressLookupHandle.IsActive()) { - ChipLogProgress(Discovery, "Operational node lookup already in progress. Will NOT start a new one."); + ChipLogProgress(Discovery, + "OperationalDeviceProxy[" ChipLogFormatX64 ":" ChipLogFormatX64 + "]: Operational node lookup already in progress. Will NOT start a new one.", + ChipLogValueX64(mPeerId.GetCompressedFabricId()), ChipLogValueX64(mPeerId.GetNodeId())); return CHIP_NO_ERROR; } @@ -407,8 +417,10 @@ void OperationalDeviceProxy::OnNodeAddressResolved(const PeerId & peerId, const void OperationalDeviceProxy::OnNodeAddressResolutionFailed(const PeerId & peerId, CHIP_ERROR reason) { - ChipLogError(Discovery, "Operational discovery failed for 0x" ChipLogFormatX64 ": %" CHIP_ERROR_FORMAT, - ChipLogValueX64(peerId.GetNodeId()), reason.Format()); + ChipLogError(Discovery, + "OperationalDeviceProxy[" ChipLogFormatX64 ":" ChipLogFormatX64 + "]: operational discovery failed: %" CHIP_ERROR_FORMAT, + ChipLogValueX64(mPeerId.GetCompressedFabricId()), ChipLogValueX64(mPeerId.GetNodeId()), reason.Format()); if (IsResolvingAddress()) { diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 47ebd1cd926293..b2b50687503dc5 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -31,10 +31,6 @@ _zap_cluster_list_script = get_path_info("zap_cluster_list.py", "abspath") # zap_file # Path to the ZAP input file. # -# cluster_sources -# Names of the clusters directories to compile. -# Deprecated, specify zap_file instead. -# # Forwards all the remaining variables to the source_set. # template("chip_data_model") { @@ -56,7 +52,6 @@ template("chip_data_model") { "*", [ "zap_pregenerated_dir", - "cluster_sources", "zap_file", "is_server", ]) @@ -93,9 +88,7 @@ template("chip_data_model") { "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp", ] - if (defined(invoker.cluster_sources)) { - _cluster_sources = invoker.cluster_sources - } else if (defined(invoker.zap_file)) { + if (defined(invoker.zap_file)) { _zap_path = rebase_path(invoker.zap_file, root_build_dir) _script_path = rebase_path(_zap_cluster_list_script, root_build_dir) _script_args = [ "--zap_file=" + _zap_path ] diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index 5ca4685427cec6..f33fa4c184bded 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -111,7 +111,7 @@ bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( auto & commissionMgr = Server::GetInstance().GetCommissioningWindowManager(); VerifyOrExit(fabricInfo != nullptr, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); - VerifyOrExit(!failSafeContext.IsFailSafeArmed(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); + VerifyOrExit(failSafeContext.IsFailSafeFullyDisarmed(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); VerifyOrExit(commissionMgr.CommissioningWindowStatus() == CommissioningWindowStatus::kWindowNotOpen, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); @@ -176,7 +176,7 @@ bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallbac VerifyOrExit(commissionMgr.CommissioningWindowStatus() == CommissioningWindowStatus::kWindowNotOpen, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); - VerifyOrExit(!failSafeContext.IsFailSafeArmed(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); + VerifyOrExit(failSafeContext.IsFailSafeFullyDisarmed(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); VerifyOrExit(commissioningTimeout <= commissionMgr.MaxCommissioningTimeout(), globalStatus = InteractionModel::Status::InvalidCommand); VerifyOrExit(commissioningTimeout >= commissionMgr.MinCommissioningTimeout(), diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index ce29aaea9c5fb1..db51829d763a07 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -508,22 +508,11 @@ bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(app::CommandH } } - CHIP_ERROR err = CHIP_ERROR_INTERNAL; - - // Fetch current fabric - const FabricInfo * fabric = RetrieveCurrentFabric(commandObj); - if (fabric == nullptr) - { - SendNOCResponse(commandObj, commandPath, OperationalCertStatus::kInsufficientPrivilege, ourFabricIndex, - CharSpan::fromCharString("Current fabric not found")); - return true; - } - // Set Label on fabric. Any error on this is basically an internal error... // NOTE: if an UpdateNOC had caused a pending fabric, that pending fabric is // the one updated thereafter. Otherwise, the data is committed to storage // as soon as the update is done. - err = fabricTable.SetFabricLabel(ourFabricIndex, label); + CHIP_ERROR err = fabricTable.SetFabricLabel(ourFabricIndex, label); VerifyOrExit(err == CHIP_NO_ERROR, finalStatus = Status::Failure); finalStatus = Status::Success; @@ -606,10 +595,6 @@ OperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err) { return OperationalCertStatus::kInvalidAdminSubject; } - if (err == CHIP_ERROR_INSUFFICIENT_PRIVILEGE) - { - return OperationalCertStatus::kInsufficientPrivilege; - } return OperationalCertStatus::kInvalidNOC; } @@ -668,9 +653,6 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co // Flush acks before really slow work commandObj->FlushAcksRightAwayOnSlowCommand(); - // TODO: Add support for calling AddNOC without a prior AddTrustedRootCertificate if - // the root properly matches an existing one. - // We can't possibly have a matching root based on the fact that we don't have // a shared root store. Therefore we would later fail path validation due to // missing root. Let's early-bail with InvalidNOC. @@ -1197,8 +1179,6 @@ bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( // Flush acks before really slow work commandObj->FlushAcksRightAwayOnSlowCommand(); - // TODO(#17208): Handle checking for byte-to-byte match with existing fabrics before allowing the add - err = ValidateChipRCAC(rootCertificate); VerifyOrExit(err == CHIP_NO_ERROR, finalStatus = Status::InvalidCommand); diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 039bf7da5105d3..5d1e574fe97c34 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -195,7 +195,7 @@ CHIP_ERROR CommissioningWindowManager::OpenCommissioningWindow(Seconds16 commiss VerifyOrReturnError(commissioningTimeout <= MaxCommissioningTimeout() && commissioningTimeout >= MinCommissioningTimeout(), CHIP_ERROR_INVALID_ARGUMENT); auto & failSafeContext = Server::GetInstance().GetFailSafeContext(); - VerifyOrReturnError(!failSafeContext.IsFailSafeArmed(), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(failSafeContext.IsFailSafeFullyDisarmed(), CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(Dnssd::ServiceAdvertiser::Instance().UpdateCommissionableInstanceName()); diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 3259ce2f988cc3..4eb0d890672a53 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -608,38 +608,23 @@ PICS: id: DGSW.S.C00.Rsp # Thermostat cluster - - label: "Does the device implement the Heating feature" + - label: "Thermostat is capable of managing a heating device" id: TSTAT.S.F00 - - label: "Does the device implement the Cooling feature" + - label: "Thermostat is capable of managing a cooling device" id: TSTAT.S.F01 - - label: "Does the device implement the Occupancy feature" + - label: "Supports Occupied and Unoccupied setpoints" id: TSTAT.S.F02 - - label: "Does the device implement the Auto feature" - id: TSTAT.S.F05 - - - label: "Does the device implement the MinHeatSetpointLimit attribute" - id: A_MINHEATSETPOINTLIMIT - - - label: "Does the device implement the MaxHeatSetpointLimit attribute" - id: A_MAXHEATSETPOINTLIMIT - - - label: "Does the device implement the MinCoolSetpointLimit attribute" - id: A_MINCOOLSETPOINTLIMIT - - - label: "Does the device implement the MaxCoolSetpointLimit attribute" - id: A_MAXCOOLSETPOINTLIMIT - - - label: "Does the device implement the Tolerance attribute?" - id: A_TEMPERATURE_TOLERANCE + - label: "Supports a weekly schedule of setpoint transitions(Schedule)" + id: TSTAT.S.F03 - - label: "Does the device implement the OccupiedCoolingSetpoint attribute?" - id: A_OCCUPIEDCOOLINGSETPOINT + - label: "Supports configurable setback (or span)" + id: TSTAT.S.F04 - - label: "Does the device implement the OccupiedHeatingSetpoint attribute?" - id: A_OCCUPIEDHEATINGSETPOINT + - label: "Supports a System Mode of Auto" + id: TSTAT.S.F05 - label: "Does the device implement the LocalTemperature attribute?" id: TSTAT.S.A0000 @@ -819,24 +804,6 @@ PICS: - label: "Does the device implement the GetRelayStatusLog command?" id: TSTAT.S.C04.Rsp - - label: "Thermostat is capable of managing a heating device" - id: TSTAT.S.F00 - - - label: "Thermostat is capable of managing a cooling device" - id: TSTAT.S.F01 - - - label: "Supports Occupied and Unoccupied setpoints" - id: TSTAT.S.F02 - - - label: "Supports a weekly schedule of setpoint transitions" - id: TSTAT.S.F03 - - - label: "Supports configurable setback (or span)" - id: TSTAT.S.F04 - - - label: "Supports a System Mode of Auto" - id: TSTAT.S.F05 - #Client Commands - label: "Does the device implement sending the SetpointRaiseLower command?" id: TSTAT.C.C00.Tx diff --git a/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml index 47280cb67e371c..fe3bd7f1e55b46 100644 --- a/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml @@ -19,150 +19,79 @@ name: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Unit Localization" endpoint: 0 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH reads TemperatureUnit attribute from DUT" PICS: LUNIT.S.A0000 - verification: | - Verify in TH log: - - ./chip-tool unitlocalization read temperature-unit 1 0 - [1651186538224] [11210:117238] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002D Attribute 0x0000_0000 DataVersion: 486381485 - [1651186538224] [11210:117238] CHIP: [TOO] TemperatureUnit: 0 - disabled: true + command: "readAttribute" + attribute: "TemperatureUnit" + response: + constraints: + type: uint8 - - label: "TH writes 0 to TemperatureUnit attribute" + - label: "TH writes 0 (Fahrenheit) to TemperatureUnit attribute" PICS: LUNIT.C.A0000.Fahrenheit - verification: | - Verify in TH log: - - ./chip-tool unitlocalization write temperature-unit 0 1 0 - [1651191017267] [13215:170815] CHIP: [DMG] WriteResponseMessage = - [1651191017267] [13215:170815] CHIP: [DMG] { - [1651191017267] [13215:170815] CHIP: [DMG] AttributeStatusIBs = - [1651191017267] [13215:170815] CHIP: [DMG] [ - [1651191017267] [13215:170815] CHIP: [DMG] AttributeStatusIB = - [1651191017267] [13215:170815] CHIP: [DMG] { - [1651191017267] [13215:170815] CHIP: [DMG] AttributePathIB = - [1651191017267] [13215:170815] CHIP: [DMG] { - [1651191017267] [13215:170815] CHIP: [DMG] Endpoint = 0x0, - [1651191017267] [13215:170815] CHIP: [DMG] Cluster = 0x2d, - [1651191017267] [13215:170815] CHIP: [DMG] Attribute = 0x0000_0000, - [1651191017267] [13215:170815] CHIP: [DMG] } - [1651191017267] [13215:170815] CHIP: [DMG] - [1651191017267] [13215:170815] CHIP: [DMG] StatusIB = - [1651191017267] [13215:170815] CHIP: [DMG] { - [1651191017267] [13215:170815] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651191017267] [13215:170815] CHIP: [DMG] }, - [1651191017267] [13215:170815] CHIP: [DMG] - [1651191017267] [13215:170815] CHIP: [DMG] }, - [1651191017267] [13215:170815] CHIP: [DMG] - [1651191017267] [13215:170815] CHIP: [DMG] ], - [1651191017267] [13215:170815] CHIP: [DMG] - [1651191017267] [13215:170815] CHIP: [DMG] InteractionModelRevision = 1 - disabled: true + cluster: "Unit Localization" + command: "writeAttribute" + attribute: "TemperatureUnit" + arguments: + value: 0 - label: "TH reads TemperatureUnit attribute" PICS: LUNIT.C.A0000 - verification: | - Verify in TH log: + command: "readAttribute" + attribute: "TemperatureUnit" + response: + value: 0 - ./chip-tool unitlocalization read temperature-unit 1 0 - [1651190135534] [12868:159849] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002D Attribute 0x0000_0000 DataVersion: 486381486 - [1651190135534] [12868:159849] CHIP: [TOO] TemperatureUnit: 0 - disabled: true - - - label: "TH writes 1 to TemperatureUnit attribute" + - label: "TH writes 1 (Celsius) to TemperatureUnit attribute" PICS: LUNIT.C.A0000.Celsius - verification: | - Verify in TH log: - - ./chip-tool unitlocalization write temperature-unit 1 1 0 - - [1651190221003] [12900:161139] CHIP: [DMG] WriteResponseMessage = - [1651190221003] [12900:161139] CHIP: [DMG] { - [1651190221003] [12900:161139] CHIP: [DMG] AttributeStatusIBs = - [1651190221003] [12900:161139] CHIP: [DMG] [ - [1651190221003] [12900:161139] CHIP: [DMG] AttributeStatusIB = - [1651190221003] [12900:161139] CHIP: [DMG] { - [1651190221003] [12900:161139] CHIP: [DMG] AttributePathIB = - [1651190221003] [12900:161139] CHIP: [DMG] { - [1651190221003] [12900:161139] CHIP: [DMG] Endpoint = 0x0, - [1651190221003] [12900:161139] CHIP: [DMG] Cluster = 0x2d, - [1651190221003] [12900:161139] CHIP: [DMG] Attribute = 0x0000_0000, - [1651190221003] [12900:161139] CHIP: [DMG] } - [1651190221003] [12900:161139] CHIP: [DMG] - [1651190221003] [12900:161139] CHIP: [DMG] StatusIB = - [1651190221003] [12900:161139] CHIP: [DMG] { - [1651190221003] [12900:161139] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651190221003] [12900:161139] CHIP: [DMG] }, - [1651190221003] [12900:161139] CHIP: [DMG] - [1651190221003] [12900:161139] CHIP: [DMG] }, - [1651190221003] [12900:161139] CHIP: [DMG] - [1651190221003] [12900:161139] CHIP: [DMG] ], - [1651190221003] [12900:161139] CHIP: [DMG] - [1651190221003] [12900:161139] CHIP: [DMG] InteractionModelRevision = 1 - [1651190221003] [12900:161139] CHIP: [DMG] } - disabled: true + cluster: "Unit Localization" + command: "writeAttribute" + attribute: "TemperatureUnit" + arguments: + value: 1 - label: "TH reads TemperatureUnit attribute" PICS: LUNIT.C.A0000 - verification: | - Verify in TH log: - - ./chip-tool unitlocalization read temperature-unit 1 0 - [1651190800434] [13122:167909] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002D Attribute 0x0000_0000 DataVersion: 486381489 - [1651190800434] [13122:167909] CHIP: [TOO] TemperatureUnit: 1 - disabled: true + command: "readAttribute" + attribute: "TemperatureUnit" + response: + value: 1 - - label: "TH writes 2 to TemperatureUnit attribute" + - label: "TH writes 2 (Kelvin) to TemperatureUnit attribute" PICS: LUNIT.C.A0000.Kelvin - verification: | - Verify in TH log: - - ./chip-tool unitlocalization write temperature-unit 2 1 0 - [1651190829573] [13133:168303] CHIP: [DMG] WriteResponseMessage = - [1651190829573] [13133:168303] CHIP: [DMG] { - [1651190829573] [13133:168303] CHIP: [DMG] AttributeStatusIBs = - [1651190829573] [13133:168303] CHIP: [DMG] [ - [1651190829573] [13133:168303] CHIP: [DMG] AttributeStatusIB = - [1651190829573] [13133:168303] CHIP: [DMG] { - [1651190829573] [13133:168303] CHIP: [DMG] AttributePathIB = - [1651190829573] [13133:168303] CHIP: [DMG] { - [1651190829573] [13133:168303] CHIP: [DMG] Endpoint = 0x0, - [1651190829573] [13133:168303] CHIP: [DMG] Cluster = 0x2d, - [1651190829573] [13133:168303] CHIP: [DMG] Attribute = 0x0000_0000, - [1651190829573] [13133:168303] CHIP: [DMG] } - [1651190829573] [13133:168303] CHIP: [DMG] - [1651190829573] [13133:168303] CHIP: [DMG] StatusIB = - [1651190829573] [13133:168303] CHIP: [DMG] { - [1651190829573] [13133:168303] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651190829573] [13133:168303] CHIP: [DMG] }, - [1651190829573] [13133:168303] CHIP: [DMG] - [1651190829573] [13133:168303] CHIP: [DMG] }, - [1651190829573] [13133:168303] CHIP: [DMG] - [1651190829573] [13133:168303] CHIP: [DMG] ], - [1651190829573] [13133:168303] CHIP: [DMG] - [1651190829573] [13133:168303] CHIP: [DMG] InteractionModelRevision = 1 - [1651190829573] [13133:168303] CHIP: [DMG] } - disabled: true + cluster: "Unit Localization" + command: "writeAttribute" + attribute: "TemperatureUnit" + arguments: + value: 2 - label: "TH reads TemperatureUnit attribute" PICS: LUNIT.C.A0000 - verification: | - Verify in TH log: - - ./chip-tool unitlocalization read temperature-unit 1 0 - [1651190908005] [13164:169492] CHIP: [TOO] Endpoint: 0 Cluster: 0x0000_002D Attribute 0x0000_0000 DataVersion: 486381490 - [1651190908005] [13164:169492] CHIP: [TOO] TemperatureUnit: 2 - disabled: true + command: "readAttribute" + attribute: "TemperatureUnit" + response: + value: 2 - label: "TH writes 5 to TemperatureUnit attribute" PICS: LUNIT.C.A0000 - verification: | - Verify in TH log: - - Verify that the write request fails with 0x87 (Constraint Error) - disabled: true + cluster: "Unit Localization" + command: "writeAttribute" + attribute: "TemperatureUnit" + arguments: + # Per spec, if [TEMP] feature is enabled, then this attribute can be + # one of 0 (Farenheit), 1 (Celsius) or 2 (Kelvin) + value: 5 # INVALID + response: + error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml index 88ca49f5849156..df0aabef7cabff 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml @@ -45,7 +45,7 @@ tests: response: constraints: type: map32 - minValue: 0 + minValue: 1 maxValue: 63 - label: "Read the global attribute: AttributeList" @@ -56,6 +56,16 @@ tests: type: list contains: [0, 27, 28, 65528, 65529, 65531, 65532, 65533] + - label: + "Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in + AttributeList" + PICS: TSTAT.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [18] - label: "Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList" @@ -79,15 +89,15 @@ tests: contains: [2] - label: - "Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in - AttributeList" - PICS: TSTAT.S.F00 + "Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) + attribute in AttributeList" + PICS: TSTAT.S.F00 && TSTAT.S.F02 command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: [18] + contains: [20] - label: "Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) @@ -100,17 +110,6 @@ tests: type: list contains: [19] - - label: - "Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) - attribute in AttributeList" - PICS: TSTAT.S.F00 && TSTAT.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [20] - - label: "Read the Feature dependent(TSTAT.S.F05(AUTO)) attribute in AttributeList" @@ -120,7 +119,7 @@ tests: response: constraints: type: list - contains: [25] + contains: [17, 18, 25] - label: "Read the Feature dependent(TSTAT.S.F03(SCH)) attribute in @@ -182,6 +181,7 @@ tests: #issue #15011 disabled steps below Global attributes missing from YAML framework - label: "Read the global attribute: EventList" + disabled: true verification: | Not implemented in chip-tool cluster: "LogCommands" 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 31f03c229dd4b6..1ddc6392d490df 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 @@ -31,7 +31,6 @@ tests: - label: "Reads mandatory attributes from DUT: LocalTemperature" command: "readAttribute" attribute: "LocalTemperature" - PICS: TSTAT.S.A0000 response: constraints: type: int16 @@ -49,7 +48,7 @@ tests: maxValue: 32767 - label: "Read Occupancy attribute from the DUT" - PICS: TSTAT.S.A0002 + PICS: TSTAT.S.F02 command: "readAttribute" attribute: "Occupancy" response: @@ -139,56 +138,56 @@ tests: maxValue: -25 - label: "Reads optional attributes from DUT: OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 command: "readAttribute" attribute: "OccupiedCoolingSetpoint" response: constraints: type: int16 - minValue: -27315 - maxValue: 32767 + minValue: 1600 + maxValue: 3200 - label: "Reads mandatory attributes from DUT: OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 command: "readAttribute" attribute: "OccupiedHeatingSetpoint" response: constraints: type: int16 - minValue: -27315 - maxValue: 32767 + minValue: 700 + maxValue: 3000 - label: "Read UnoccupiedCoolingSetpoint attribute from the DUT" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F01 && TSTAT.S.F02 command: "readAttribute" attribute: "UnoccupiedCoolingSetpoint" response: constraints: type: int16 - minValue: -27315 - maxValue: 32767 + minValue: 1600 + maxValue: 3200 - label: "Read UnoccupiedHeatingSetpoint attribute from the DUT" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F00 && TSTAT.S.F02 command: "readAttribute" attribute: "UnoccupiedHeatingSetpoint" response: constraints: type: int16 - minValue: -27315 - maxValue: 32767 + minValue: 700 + maxValue: 3000 - - label: "Reads mandatory attributes from DUT: MinHeatSetpointLimit" + - label: "Reads attribute from DUT: MinHeatSetpointLimit" PICS: TSTAT.S.A0015 command: "readAttribute" attribute: "MinHeatSetpointLimit" response: constraints: type: int16 - minValue: -27315 - maxValue: 32767 + minValue: 700 + maxValue: 3000 - - label: "Reads mandatory attributes from DUT: MaxHeatSetpointLimit" + - label: "Reads attribute from DUT: MaxHeatSetpointLimit" PICS: TSTAT.S.A0016 command: "readAttribute" attribute: "MaxHeatSetpointLimit" @@ -219,7 +218,7 @@ tests: maxValue: 32767 - label: "Reads optional attributes from DUT: MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 command: "readAttribute" attribute: "MinSetpointDeadBand" response: @@ -239,7 +238,6 @@ tests: maxValue: 7 - label: "Reads mandatory attributes from DUT: ControlSequenceOfOperation" - PICS: TSTAT.S.A001b command: "readAttribute" attribute: "ControlSequenceOfOperation" response: @@ -249,7 +247,6 @@ tests: maxValue: 5 - label: "Reads mandatory attributes from DUT: SystemMode" - PICS: TSTAT.S.A001c command: "readAttribute" attribute: "SystemMode" response: @@ -258,52 +255,6 @@ tests: minValue: 0 maxValue: 9 - - label: - "Read AlarmMask attribute from the DUT and Verify that the DUT - responds with a map8 value.The value has to be in the range of 0x00 to - 0x07." - verification: | - ./apps/chip-tool thermostat read alarm-mask 54321 1 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001D, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A001d - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - label: "Read ThermostatRunningMode attribute from the DUT" PICS: TSTAT.S.A001e command: "readAttribute" @@ -312,10 +263,10 @@ tests: constraints: type: enum8 minValue: 0 - maxValue: 4 + maxValue: 9 - label: "Reads constraints of optional attributes from DUT: StartOfWeek" - PICS: TSTAT.S.A0020 + PICS: TSTAT.S.F03 command: "readAttribute" attribute: "StartOfWeek" response: @@ -325,7 +276,7 @@ tests: maxValue: 6 - label: "Reads optional attributes from DUT: NumberOfWeeklyTransitions" - PICS: TSTAT.S.A0021 + PICS: TSTAT.S.F03 command: "readAttribute" attribute: "NumberOfWeeklyTransitions" response: @@ -335,7 +286,7 @@ tests: maxValue: 255 - label: "Reads optional attributes from DUT: NumberOfDailyTransitions" - PICS: TSTAT.S.A0022 + PICS: TSTAT.S.F03 command: "readAttribute" attribute: "NumberOfDailyTransitions" response: @@ -413,7 +364,7 @@ tests: type: utc - label: "Read OccupiedSetback attribute from the DUT" - PICS: TSTAT.S.A0034 + PICS: TSTAT.S.F02 command: "readAttribute" attribute: "OccupiedSetback" response: @@ -423,7 +374,7 @@ tests: maxValue: 255 - label: "Read OccupiedSetbackMin attribute from the DUT" - PICS: TSTAT.S.A0035 + PICS: TSTAT.S.F02 command: "readAttribute" attribute: "OccupiedSetbackMin" response: @@ -433,7 +384,7 @@ tests: maxValue: 255 - label: "Read OccupiedSetbackMax attribute from the DUT" - PICS: TSTAT.S.A0036 + PICS: TSTAT.S.F02 command: "readAttribute" attribute: "OccupiedSetbackMax" response: @@ -443,7 +394,7 @@ tests: maxValue: 255 - label: "Read UnoccupiedSetback attribute from the DUT" - PICS: TSTAT.S.A0037 + PICS: TSTAT.S.F02 && TSTAT.S.F04 command: "readAttribute" attribute: "UnoccupiedSetback" response: @@ -453,7 +404,7 @@ tests: maxValue: 255 - label: "Read UnoccupiedSetbackMin attribute from the DUT" - PICS: TSTAT.S.A0038 + PICS: TSTAT.S.F02 && TSTAT.S.F04 command: "readAttribute" attribute: "UnoccupiedSetbackMin" response: @@ -463,7 +414,7 @@ tests: maxValue: 255 - label: "Read UnoccupiedSetbackMax attribute from the DUT" - PICS: TSTAT.S.A0039 + PICS: TSTAT.S.F02 && TSTAT.S.F04 command: "readAttribute" attribute: "UnoccupiedSetbackMax" response: 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 6fa064ba30dec1..b6ef39e12cb377 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 @@ -33,7 +33,7 @@ tests: that the value is within range" command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 response: constraints: type: int16 @@ -45,7 +45,7 @@ tests: OccupiedCoolingSetpoint attribute" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 2500 @@ -54,16 +54,16 @@ tests: OccupiedCoolingSetpoint attribute" command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 response: value: 2500 - label: "Writes OccupiedCoolingSetpoint to value below the - MinCoolSetpointLimit" + ABSMinCoolSetpointLimit" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 30 response: @@ -74,7 +74,7 @@ tests: MaxCoolSetpointLimit" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 4000 response: @@ -83,21 +83,11 @@ tests: - label: "Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute" - verification: | - ./chip-tool thermostat write occupied-cooling-setpoint 1600 1 1 - [1653574006.162208][16728:16733] CHIP:DMG: StatusIB = - [1653574006.162227][16728:16733] CHIP:DMG: { - [1653574006.162245][16728:16733] CHIP:DMG: status = 0x00 (SUCCESS), - [1653574006.162261][16728:16733] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0011 + command: "writeAttribute" + attribute: "OccupiedCoolingSetpoint" + PICS: TSTAT.S.F01 && !TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 1600 - label: "Writes the CoolingSetpoint below the HeatingSetpoint when auto is @@ -115,7 +105,7 @@ tests: attribute" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 3200 @@ -124,7 +114,7 @@ tests: that the value is within range" command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 response: constraints: type: int16 @@ -136,7 +126,7 @@ tests: OccupiedHeatingSetpoint attribute" command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 arguments: value: 2100 @@ -145,7 +135,7 @@ tests: OccupiedHeatingSetpoint attribute" command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 response: value: 2100 @@ -154,7 +144,7 @@ tests: MinHeatSetpointLimit" command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 arguments: value: 600 response: @@ -165,7 +155,7 @@ tests: MaxHeatSetpointLimit" command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 arguments: value: 4010 response: @@ -176,7 +166,7 @@ tests: attribute" command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: TSTAT.S.A0012 + PICS: TSTAT.S.F00 arguments: value: 700 @@ -201,26 +191,20 @@ tests: - label: "Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute" - verification: | - ./chip-tool thermostat read occupied-heating-setpoint 1 1 - [1650451168.922888][5386:5391] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0012 DataVersion: 1433129384 - [1650451168.922971][5386:5391] CHIP:TOO: occupied heating setpoint: 2000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0012 + command: "writeAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 3000 + response: + error: CONSTRAINT_ERROR - label: "Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range" command: "readAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 response: value: 2600 constraints: @@ -233,7 +217,7 @@ tests: UnoccupiedCoolingSetpoint attribute" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 2500 @@ -242,16 +226,16 @@ tests: UnoccupiedCoolingSetpoint attribute" command: "readAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 response: value: 2500 - label: "Writes UnoccupiedCoolingSetpoint to value below the - MinHeatSetpointLimit" + MinCoolSetpointLimit" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 1002 response: @@ -259,10 +243,10 @@ tests: - label: "Writes UnoccupiedCoolingSetpoint to value above the - MaxHeatSetpointLimit" + MaxCoolSetpointLimit" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 4010 response: @@ -273,7 +257,7 @@ tests: attribute" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 1800 @@ -282,7 +266,7 @@ tests: attribute" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: TSTAT.S.A0013 + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 3000 @@ -291,7 +275,7 @@ tests: verifies that the value is within range" command: "readAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 response: value: 2000 constraints: @@ -302,9 +286,10 @@ tests: - label: "Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute" + command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 2500 @@ -313,7 +298,7 @@ tests: UnoccupiedHeatingSetpoint attribute" command: "readAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 response: value: 2500 @@ -322,7 +307,7 @@ tests: MinHeatSetpointLimit" command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 500 response: @@ -333,7 +318,7 @@ tests: MaxHeatSetpointLimit" command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 4010 response: @@ -344,7 +329,7 @@ tests: attribute" command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 1800 @@ -353,7 +338,7 @@ tests: attribute" command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: TSTAT.S.A0014 + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 3000 @@ -362,7 +347,7 @@ tests: that the value is within range" command: "readAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.A0015 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 response: value: 700 constraints: @@ -373,65 +358,36 @@ tests: - label: "Writes a value back that is different but valid for MinHeatSetpointLimit attribute" - verification: | - ./chip-tool thermostat write min-heat-setpoint-limit 1500 1 1 - [1651575873.602025][9521:9526] CHIP:DMG: WriteResponseMessage = - [1651575873.602056][9521:9526] CHIP:DMG: { - [1651575873.602078][9521:9526] CHIP:DMG: AttributeStatusIBs = - [1651575873.602124][9521:9526] CHIP:DMG: [ - [1651575873.602160][9521:9526] CHIP:DMG: AttributeStatusIB = - [1651575873.602195][9521:9526] CHIP:DMG: { - [1651575873.602233][9521:9526] CHIP:DMG: AttributePathIB = - [1651575873.602278][9521:9526] CHIP:DMG: { - [1651575873.602316][9521:9526] CHIP:DMG: Endpoint = 0x1, - [1651575873.602363][9521:9526] CHIP:DMG: Cluster = 0x201, - [1651575873.602412][9521:9526] CHIP:DMG: Attribute = 0x0000_0015, - [1651575873.602447][9521:9526] CHIP:DMG: } - [1651575873.602496][9521:9526] CHIP:DMG: - [1651575873.602537][9521:9526] CHIP:DMG: StatusIB = - [1651575873.602574][9521:9526] CHIP:DMG: { - [1651575873.602619][9521:9526] CHIP:DMG: status = 0x00 (SUCCESS), - [1651575873.602660][9521:9526] CHIP:DMG: }, - [1651575873.602697][9521:9526] CHIP:DMG: - [1651575873.602734][9521:9526] CHIP:DMG: }, - [1651575873.602775][9521:9526] CHIP:DMG: - [1651575873.602801][9521:9526] CHIP:DMG: ], - [1651575873.602840][9521:9526] CHIP:DMG: - [1651575873.602864][9521:9526] CHIP:DMG: InteractionModelRevision = 1 - [1651575873.602890][9521:9526] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0015 + command: "writeAttribute" + attribute: "MinHeatSetpointLimit" + PICS: TSTAT.S.F00 && TSTAT.S.A0015 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 800 - label: "Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute" - verification: | - ./chip-tool thermostat read min-heat-setpoint-limit 1 1 - [1650451588.651448][5452:5457] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0015 DataVersion: 1433129384 - [1650451588.651531][5452:5457] CHIP:TOO: min heat setpoint limit: 1500 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0015 + command: "readAttribute" + attribute: "MinHeatSetpointLimit" + PICS: TSTAT.S.F00 && TSTAT.S.A0015 + response: + value: 800 + + - label: "Writes a value back that is different but violates the deadband" + command: "writeAttribute" + attribute: "MinHeatSetpointLimit" + PICS: TSTAT.S.A0015 && TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 2000 + response: + error: CONSTRAINT_ERROR - label: "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit " command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.A0015 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 arguments: value: 650 response: @@ -442,7 +398,7 @@ tests: AbsMaxHeatSetpointLimit " command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.A0015 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 arguments: value: 4050 response: @@ -453,98 +409,38 @@ tests: attribute" command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.A0015 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 arguments: value: 700 - label: "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute" - verification: | - ./chip-tool thermostat write min-heat-setpoint-limit 1000 1 1 - [1651575767.881039][9507:9512] CHIP:DMG: WriteResponseMessage = - [1651575767.881065][9507:9512] CHIP:DMG: { - [1651575767.881088][9507:9512] CHIP:DMG: AttributeStatusIBs = - [1651575767.881128][9507:9512] CHIP:DMG: [ - [1651575767.881154][9507:9512] CHIP:DMG: AttributeStatusIB = - [1651575767.881183][9507:9512] CHIP:DMG: { - [1651575767.881210][9507:9512] CHIP:DMG: AttributePathIB = - [1651575767.881243][9507:9512] CHIP:DMG: { - [1651575767.881277][9507:9512] CHIP:DMG: Endpoint = 0x1, - [1651575767.881312][9507:9512] CHIP:DMG: Cluster = 0x201, - [1651575767.881350][9507:9512] CHIP:DMG: Attribute = 0x0000_0015, - [1651575767.881383][9507:9512] CHIP:DMG: } - [1651575767.881420][9507:9512] CHIP:DMG: - [1651575767.881452][9507:9512] CHIP:DMG: StatusIB = - [1651575767.881485][9507:9512] CHIP:DMG: { - [1651575767.881520][9507:9512] CHIP:DMG: status = 0x00 (SUCCESS), - [1651575767.881553][9507:9512] CHIP:DMG: }, - [1651575767.881589][9507:9512] CHIP:DMG: - [1651575767.881618][9507:9512] CHIP:DMG: }, - [1651575767.881651][9507:9512] CHIP:DMG: - [1651575767.881677][9507:9512] CHIP:DMG: ], - [1651575767.881708][9507:9512] CHIP:DMG: - [1651575767.881732][9507:9512] CHIP:DMG: InteractionModelRevision = 1 - [1651575767.881757][9507:9512] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0015 + command: "writeAttribute" + attribute: "MinHeatSetpointLimit" + PICS: TSTAT.S.F00 && TSTAT.S.A0015 && !TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 3000 - label: "Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range" - verification: | - ./chip-tool thermostat read max-heat-setpoint-limit 1 1 - [1651575563.660840][9476:9481] CHIP:DMG: ReportDataMessage = - [1651575563.660870][9476:9481] CHIP:DMG: { - [1651575563.660892][9476:9481] CHIP:DMG: AttributeReportIBs = - [1651575563.660929][9476:9481] CHIP:DMG: [ - [1651575563.660954][9476:9481] CHIP:DMG: AttributeReportIB = - [1651575563.660994][9476:9481] CHIP:DMG: { - [1651575563.661023][9476:9481] CHIP:DMG: AttributeDataIB = - [1651575563.661059][9476:9481] CHIP:DMG: { - [1651575563.661096][9476:9481] CHIP:DMG: DataVersion = 0x366e43c8, - [1651575563.661132][9476:9481] CHIP:DMG: AttributePathIB = - [1651575563.661169][9476:9481] CHIP:DMG: { - [1651575563.661208][9476:9481] CHIP:DMG: Endpoint = 0x1, - [1651575563.661248][9476:9481] CHIP:DMG: Cluster = 0x201, - [1651575563.661287][9476:9481] CHIP:DMG: Attribute = 0x0000_0016, - [1651575563.661322][9476:9481] CHIP:DMG: } - [1651575563.661358][9476:9481] CHIP:DMG: - [1651575563.661399][9476:9481] CHIP:DMG: Data = 3000, - [1651575563.661436][9476:9481] CHIP:DMG: }, - [1651575563.661473][9476:9481] CHIP:DMG: - [1651575563.661502][9476:9481] CHIP:DMG: }, - [1651575563.661536][9476:9481] CHIP:DMG: - [1651575563.661559][9476:9481] CHIP:DMG: ], - [1651575563.661590][9476:9481] CHIP:DMG: - [1651575563.661615][9476:9481] CHIP:DMG: SuppressResponse = true, - [1651575563.661642][9476:9481] CHIP:DMG: InteractionModelRevision = 1 - [1651575563.661667][9476:9481] CHIP:DMG: } - [1651575563.661803][9476:9481] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0016 DataVersion: 913195976 - [1651575563.661866][9476:9481] CHIP:TOO: max heat setpoint limit: 3000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0016 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + command: "readAttribute" + attribute: "MaxHeatSetpointLimit" + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05 + response: + value: 3000 + constraints: + type: int16 + minValue: 700 + maxValue: 3000 - label: "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute" command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && TSTAT.S.A0015 arguments: value: 700 @@ -553,7 +449,7 @@ tests: attribute" command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT && TSTAT.S.F05 + PICS: TSTAT.S.A0015 && TSTAT.S.F05 arguments: value: 3000 response: @@ -564,7 +460,7 @@ tests: MaxHeatSetpointLimit attribute" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.A0016 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05 arguments: value: 2900 @@ -573,7 +469,7 @@ tests: MaxHeatSetpointLimit attribute" command: "readAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.A0016 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05 response: value: 2900 @@ -582,7 +478,7 @@ tests: AbsMinHeatSetpointLimit " command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.A0016 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 arguments: value: 500 response: @@ -593,7 +489,7 @@ tests: AbsMaxHeatSetpointLimit " command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.A0016 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 arguments: value: 4000 response: @@ -604,55 +500,25 @@ tests: attribute" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.A0016 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 arguments: value: 700 - label: "Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute" - verification: | - ./chip-tool thermostat write max-heat-setpoint-limit 1000 1 1 - [1651575678.144963][9488:9493] CHIP:DMG: WriteResponseMessage = - [1651575678.144990][9488:9493] CHIP:DMG: { - [1651575678.145012][9488:9493] CHIP:DMG: AttributeStatusIBs = - [1651575678.145045][9488:9493] CHIP:DMG: [ - [1651575678.145071][9488:9493] CHIP:DMG: AttributeStatusIB = - [1651575678.145107][9488:9493] CHIP:DMG: { - [1651575678.145136][9488:9493] CHIP:DMG: AttributePathIB = - [1651575678.145169][9488:9493] CHIP:DMG: { - [1651575678.145204][9488:9493] CHIP:DMG: Endpoint = 0x1, - [1651575678.145242][9488:9493] CHIP:DMG: Cluster = 0x201, - [1651575678.145278][9488:9493] CHIP:DMG: Attribute = 0x0000_0016, - [1651575678.145314][9488:9493] CHIP:DMG: } - [1651575678.145353][9488:9493] CHIP:DMG: - [1651575678.145384][9488:9493] CHIP:DMG: StatusIB = - [1651575678.145418][9488:9493] CHIP:DMG: { - [1651575678.145450][9488:9493] CHIP:DMG: status = 0x00 (SUCCESS), - [1651575678.145483][9488:9493] CHIP:DMG: }, - [1651575678.145516][9488:9493] CHIP:DMG: - [1651575678.145543][9488:9493] CHIP:DMG: }, - [1651575678.145576][9488:9493] CHIP:DMG: - [1651575678.145603][9488:9493] CHIP:DMG: ], - [1651575678.145633][9488:9493] CHIP:DMG: - [1651575678.145658][9488:9493] CHIP:DMG: InteractionModelRevision = 1 - [1651575678.145683][9488:9493] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0016 + command: "writeAttribute" + attribute: "MaxHeatSetpointLimit" + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 3000 - label: "Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range" command: "readAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 response: value: 1600 constraints: @@ -665,7 +531,7 @@ tests: MinCoolSetpointLimit attribute" command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 2000 @@ -674,7 +540,7 @@ tests: MinCoolSetpointLimit attribute" command: "readAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 response: value: 2000 @@ -683,7 +549,7 @@ tests: AbsMinCoolSetpointLimit " command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 1000 response: @@ -693,7 +559,7 @@ tests: "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit " command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 4000 response: @@ -704,7 +570,7 @@ tests: attribute" command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 1600 @@ -713,7 +579,7 @@ tests: attribute" command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 3200 @@ -722,7 +588,7 @@ tests: attribute" command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 1600 @@ -731,7 +597,7 @@ tests: that the value is within range" command: "readAttribute" attribute: "MaxCoolSetpointLimit" - PICS: TSTAT.S.A0018 + PICS: TSTAT.S.F01 && TSTAT.S.A0018 response: value: 3200 constraints: @@ -742,91 +608,27 @@ tests: - label: "Writes a value back that is different but valid for MaxCoolSetpointLimit attribute" - verification: | - ./chip-tool thermostat write max-cool-setpoint-limit 3000 1 1 - [1651577904.824284][9656:9661] CHIP:DMG: WriteResponseMessage = - [1651577904.824317][9656:9661] CHIP:DMG: { - [1651577904.824347][9656:9661] CHIP:DMG: AttributeStatusIBs = - [1651577904.824387][9656:9661] CHIP:DMG: [ - [1651577904.824420][9656:9661] CHIP:DMG: AttributeStatusIB = - [1651577904.824457][9656:9661] CHIP:DMG: { - [1651577904.824492][9656:9661] CHIP:DMG: AttributePathIB = - [1651577904.824541][9656:9661] CHIP:DMG: { - [1651577904.824587][9656:9661] CHIP:DMG: Endpoint = 0x1, - [1651577904.824628][9656:9661] CHIP:DMG: Cluster = 0x201, - [1651577904.824674][9656:9661] CHIP:DMG: Attribute = 0x0000_0018, - [1651577904.824711][9656:9661] CHIP:DMG: } - [1651577904.824757][9656:9661] CHIP:DMG: - [1651577904.824797][9656:9661] CHIP:DMG: StatusIB = - [1651577904.824840][9656:9661] CHIP:DMG: { - [1651577904.824878][9656:9661] CHIP:DMG: status = 0x00 (SUCCESS), - [1651577904.824919][9656:9661] CHIP:DMG: }, - [1651577904.824957][9656:9661] CHIP:DMG: - [1651577904.824993][9656:9661] CHIP:DMG: }, - [1651577904.825035][9656:9661] CHIP:DMG: - [1651577904.825067][9656:9661] CHIP:DMG: ], - [1651577904.825106][9656:9661] CHIP:DMG: - [1651577904.825138][9656:9661] CHIP:DMG: InteractionModelRevision = 1 - [1651577904.825169][9656:9661] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0018 + command: "writeAttribute" + attribute: "MaxCoolSetpointLimit" + PICS: TSTAT.S.F01 && TSTAT.S.A0018 && !TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 2000 - label: "Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute" - verification: | - ./chip-tool thermostat read max-cool-setpoint-limit 1 1 - [1651576122.935621][9559:9564] CHIP:DMG: ReportDataMessage = - [1651576122.935665][9559:9564] CHIP:DMG: { - [1651576122.935701][9559:9564] CHIP:DMG: AttributeReportIBs = - [1651576122.935751][9559:9564] CHIP:DMG: [ - [1651576122.935791][9559:9564] CHIP:DMG: AttributeReportIB = - [1651576122.935857][9559:9564] CHIP:DMG: { - [1651576122.935900][9559:9564] CHIP:DMG: AttributeDataIB = - [1651576122.935953][9559:9564] CHIP:DMG: { - [1651576122.936006][9559:9564] CHIP:DMG: DataVersion = 0x366e43cd, - [1651576122.936059][9559:9564] CHIP:DMG: AttributePathIB = - [1651576122.936114][9559:9564] CHIP:DMG: { - [1651576122.936170][9559:9564] CHIP:DMG: Endpoint = 0x1, - [1651576122.936233][9559:9564] CHIP:DMG: Cluster = 0x201, - [1651576122.936296][9559:9564] CHIP:DMG: Attribute = 0x0000_0018, - [1651576122.936354][9559:9564] CHIP:DMG: } - [1651576122.936415][9559:9564] CHIP:DMG: - [1651576122.936477][9559:9564] CHIP:DMG: Data = 3000, - [1651576122.936525][9559:9564] CHIP:DMG: }, - [1651576122.936578][9559:9564] CHIP:DMG: - [1651576122.936622][9559:9564] CHIP:DMG: }, - [1651576122.936675][9559:9564] CHIP:DMG: - [1651576122.936714][9559:9564] CHIP:DMG: ], - [1651576122.936763][9559:9564] CHIP:DMG: - [1651576122.936804][9559:9564] CHIP:DMG: SuppressResponse = true, - [1651576122.936849][9559:9564] CHIP:DMG: InteractionModelRevision = 1 - [1651576122.936888][9559:9564] CHIP:DMG: } - [1651576122.937081][9559:9564] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0018 DataVersion: 913195981 - [1651576122.937166][9559:9564] CHIP:TOO: max cool setpoint limit: 3000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0018 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + command: "readAttribute" + attribute: "MaxCoolSetpointLimit" + PICS: TSTAT.S.F01 && TSTAT.S.A0018 && !TSTAT.S.F05 + response: + value: 2000 - label: "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit " command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: TSTAT.S.A0018 + PICS: TSTAT.S.F01 && TSTAT.S.A0018 arguments: value: 1000 response: @@ -836,7 +638,7 @@ tests: "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit " command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: TSTAT.S.A0018 + PICS: TSTAT.S.F01 && TSTAT.S.A0018 arguments: value: 4000 response: @@ -845,93 +647,53 @@ tests: - label: "Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute" - verification: | - ./chip-tool thermostat write max-cool-setpoint-limit 700 1 1 - [1651577904.824284][9656:9661] CHIP:DMG: WriteResponseMessage = - [1651577904.824317][9656:9661] CHIP:DMG: { - [1651577904.824347][9656:9661] CHIP:DMG: AttributeStatusIBs = - [1651577904.824387][9656:9661] CHIP:DMG: [ - [1651577904.824420][9656:9661] CHIP:DMG: AttributeStatusIB = - [1651577904.824457][9656:9661] CHIP:DMG: { - [1651577904.824492][9656:9661] CHIP:DMG: AttributePathIB = - [1651577904.824541][9656:9661] CHIP:DMG: { - [1651577904.824587][9656:9661] CHIP:DMG: Endpoint = 0x1, - [1651577904.824628][9656:9661] CHIP:DMG: Cluster = 0x201, - [1651577904.824674][9656:9661] CHIP:DMG: Attribute = 0x0000_0018, - [1651577904.824711][9656:9661] CHIP:DMG: } - [1651577904.824757][9656:9661] CHIP:DMG: - [1651577904.824797][9656:9661] CHIP:DMG: StatusIB = - [1651577904.824840][9656:9661] CHIP:DMG: { - [1651577904.824878][9656:9661] CHIP:DMG: status = 0x00 (SUCCESS), - [1651577904.824919][9656:9661] CHIP:DMG: }, - [1651577904.824957][9656:9661] CHIP:DMG: - [1651577904.824993][9656:9661] CHIP:DMG: }, - [1651577904.825035][9656:9661] CHIP:DMG: - [1651577904.825067][9656:9661] CHIP:DMG: ], - [1651577904.825106][9656:9661] CHIP:DMG: - [1651577904.825138][9656:9661] CHIP:DMG: InteractionModelRevision = 1 - [1651577904.825169][9656:9661] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0018 + command: "writeAttribute" + attribute: "MaxCoolSetpointLimit" + PICS: TSTAT.S.F01 && TSTAT.S.A0018 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 1600 - label: "Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute" command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: TSTAT.S.A0018 + PICS: TSTAT.S.F01 && TSTAT.S.A0018 arguments: value: 3200 - label: "Writes (sets back) default value of MinHeatSetpointLimit" command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.A0015 + PICS: TSTAT.S.F01 && TSTAT.S.A0015 arguments: value: 700 - label: "Writes (sets back)default value of MaxHeatSetpointLimit" - verification: | - ./chip-tool thermostat write max-heat-setpoint-limit 3000 1 1 - CHIP:ZCL: status: Success (0x0000) - CHIP:TOO: Default Success Response - CHIP:DMG: WriteClient moving to [Uninitiali] - CHIP:EM: Sending Standalone Ack for MessageCounter:1 on exchange 12610i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0016 + command: "writeAttribute" + attribute: "MaxHeatSetpointLimit" + PICS: TSTAT.S.F01 && TSTAT.S.A0016 &&!TSTAT.S.F05 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + value: 3000 - label: "Writes MaxHeatSetpointLimit That meets the deadband of 2.5C" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05 + PICS: TSTAT.S.F01 && TSTAT.S.A0016 &&!TSTAT.S.F05 arguments: value: 2950 - label: "Writes (sets back) default value of MinCoolSetpointLimit" command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: TSTAT.S.A0017 + PICS: TSTAT.S.F01 && TSTAT.S.A0017 arguments: value: 1600 - label: "Writes (sets back) default value of MaxCoolSetpointLimit" command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: TSTAT.S.A0018 + PICS: TSTAT.S.F01 && TSTAT.S.A0018 arguments: value: 3200 @@ -940,7 +702,7 @@ tests: the value is within range" command: "readAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 response: value: 25 constraints: @@ -953,7 +715,7 @@ tests: MinSetpointDeadBand attribute" command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 arguments: value: 5 @@ -962,14 +724,14 @@ tests: MinSetpointDeadBand attribute" command: "readAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 response: value: 5 - label: "Writes the value below MinSetpointDeadBand" command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 arguments: value: -1 response: @@ -978,7 +740,7 @@ tests: - label: "Writes the value above MinSetpointDeadBand " command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 arguments: value: 30 response: @@ -987,14 +749,14 @@ tests: - label: "Writes the min limit of MinSetpointDeadBand" command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 arguments: value: 0 - label: "Writes the max limit of MinSetpointDeadBand" command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: TSTAT.S.A0019 + PICS: TSTAT.S.F05 arguments: value: 25 @@ -1003,7 +765,7 @@ tests: the value is valid" command: "readAttribute" attribute: "ControlSequenceOfOperation" - PICS: TSTAT.S.A001b + PICS: TSTAT.S.F00 || TSTAT.S.F01 response: value: 4 constraints: @@ -1016,14 +778,14 @@ tests: valid value" command: "writeAttribute" attribute: "ControlSequenceOfOperation" - PICS: TSTAT.S.A001b + PICS: TSTAT.S.F00 || TSTAT.S.F01 arguments: value: 2 - label: "Read it back again to confirm the successful write" command: "readAttribute" attribute: "ControlSequenceOfOperation" - PICS: TSTAT.S.A001b + PICS: TSTAT.S.F00 || TSTAT.S.F01 response: value: 2 @@ -1032,7 +794,7 @@ tests: meet deadband constraint" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && TSTAT.S.F05 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 && TSTAT.S.F05 arguments: value: 2950 @@ -1044,25 +806,14 @@ tests: value: 2600 - label: "Sets OccupiedHeatingSetpoint to default value" - verification: | - ./chip-tool thermostat write occupied-heating-setpoint -30 1 1 - [1653575015.985079][16976:16981] CHIP:DMG: StatusIB = - [1653575015.985098][16976:16981] CHIP:DMG: { - [1653575015.985115][16976:16981] CHIP:DMG: status = 0x00 (SUCCESS), - [1653575015.985131][16976:16981] CHIP:DMG: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0012 + command: "writeAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F00 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00 + value: 2000 + + - label: "Sends SetpointRaise Command Heat Only" + PICS: TSTAT.S.F00 command: "SetpointRaiseLower" arguments: values: @@ -1076,31 +827,19 @@ tests: write" command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012 + PICS: TSTAT.S.F00 response: value: 1700 - label: "Sets OccupiedHeatingSetpoint to default value" - verification: | - ./chip-tool thermostat write occupied-heating-setpoint 2000 1 1 - CHIP:ZCL: WriteResponse: - CHIP:ZCL: status: Success (0x0000) - CHIP:TOO: Default Success Response - CHIP:DMG: WriteClient moving to [Uninitiali] - CHIP:EM: Sending Standalone Ack for MessageCounter:1 on exchange 11247i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0012 + command: "writeAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F00 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00 + value: 2000 + + - label: "Sends SetpointRaise Command Heat Only" + PICS: TSTAT.S.F00 command: "SetpointRaiseLower" arguments: values: @@ -1114,20 +853,12 @@ tests: write" command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012 + PICS: TSTAT.S.F00 response: - value: 30 - - - label: "Sets OccupiedCoolingSetpoint to default value" - command: "writeAttribute" - attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 - arguments: - value: 2600 + value: 2300 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00 + - label: "Sends SetpointRaise Command Cool Only" + PICS: TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -1141,20 +872,19 @@ tests: write" command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011 + PICS: TSTAT.S.F01 response: value: 2300 - label: "Sets OccupiedCoolingSetpoint to default value" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 2600 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00 + - label: "Sends SetpointRaise Command Cool Only" + PICS: TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -1168,39 +898,26 @@ tests: write" command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011 + PICS: TSTAT.S.F01 response: value: 2900 - label: "Sets OccupiedCoolingSetpoint to default value" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 2600 - label: "Sets OccupiedHeatingSetpoint to default value" - verification: | - ./chip-tool thermostat read occupied-heating-setpoint 2000 1 1 - CHIP:ZCL: ReadAttributesResponse: - CHIP:ZCL: ClusterId: 0x0000_0201 - CHIP:ZCL: attributeId: 0x0000_0012 - CHIP:ZCL: status: Success (0x0000) - CHIP:ZCL: attribute TLV Type: 0x00 - CHIP:TOO: Int16s attribute Response: 2000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0012 + command: "writeAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F00 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00 + value: 2000 + + - label: "Sends SetpointRaise Command Heat & Cool" + PICS: TSTAT.S.F00 || TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -1214,7 +931,7 @@ tests: write" command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011 + PICS: TSTAT.S.F01 response: value: 2300 @@ -1223,39 +940,26 @@ tests: write" command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012 + PICS: TSTAT.S.F00 response: value: 1700 - label: "Sets OccupiedCoolingSetpoint to default value" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: TSTAT.S.A0011 + PICS: TSTAT.S.F01 arguments: value: 2600 - label: "Sets OccupiedHeatingSetpoint to default value" - verification: | - ./chip-tool thermostat read occupied-heating-setpoint 2000 1 1 - CHIP:ZCL: ReadAttributesResponse: - CHIP:ZCL: ClusterId: 0x0000_0201 - CHIP:ZCL: attributeId: 0x0000_0012 - CHIP:ZCL: status: Success (0x0000) - CHIP:ZCL: attribute TLV Type: 0x00 - CHIP:TOO: Int16s attribute Response: 2000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && TSTAT.S.A0012 + command: "writeAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F00 arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00 + value: 2000 + + - label: "Sends SetpointRaise Command Heat & Cool" + PICS: TSTAT.S.F00 || TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -1269,7 +973,7 @@ tests: write" command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011 + PICS: TSTAT.S.F01 response: value: 2900 @@ -1278,6 +982,6 @@ tests: write" command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012 + PICS: TSTAT.S.F00 response: value: 2300 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 4460c54a835fa0..8887e6bdebe372 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -33,12 +33,6 @@ DGSW.S.A0001=1 DGSW.S.A0002=1 DGSW.S.A0003=1 DGSW.S.C00.Rsp=1 -A_OCCUPIEDCOOLINGSETPOINT=1 -A_OCCUPIEDHEATINGSETPOINT=1 -A_MINHEATSETPOINTLIMIT=1 -A_MAXHEATSETPOINTLIMIT=1 -A_MINCOOLSETPOINTLIMIT=1 -A_MAXCOOLSETPOINTLIMIT=1 VENDOR_SUBTYPE=1 DEVTYPE_SUBTYPE=1 @@ -56,18 +50,6 @@ PICS_SDK_CI_ONLY=1 OO_LT=1 MANUAL_FLOW_CHANGE=1 -#Thermostat Server -TSTAT.S.F00=0 -TSTAT.S.F01=0 -TSTAT.S.F02=0 -TSTAT.S.F03=0 -TSTAT.S.F04=0 -TSTAT.S.F05=0 -A_MINHEATSETPOINTLIMIT=1 -A_MAXHEATSETPOINTLIMIT=1 -A_MINCOOLSETPOINTLIMIT=1 -A_MAXCOOLSETPOINTLIMIT=1 - # WindowCovering aka WNCV WNCV.S.F00=1 WNCV.S.F02=1 @@ -1024,11 +1006,6 @@ ILL.S.A0002=1 ILL.S.A0003=1 ILL.S.A0004=1 -#Thermostat -#Client Commands -TSTAT.C.C00.Tx=1 -TSTAT.C.C04.Tx=1 - #Door Lock #server attributes DRLK.S.A0000=1 @@ -1340,6 +1317,14 @@ OPCREDS.C.C0a.Tx=1 OPCREDS.C.C0b.Tx=1 #Thermostat +#Thermostat Server +TSTAT.S.F00=1 +TSTAT.S.F01=1 +TSTAT.S.F02=0 +TSTAT.S.F03=0 +TSTAT.S.F04=0 +TSTAT.S.F05=1 + TSTAT.S.A0000=1 TSTAT.S.A0001=0 TSTAT.S.A0002=0 @@ -1390,12 +1375,17 @@ TSTAT.S.A0044=0 TSTAT.S.A0045=0 TSTAT.S.A0046=0 TSTAT.S.A0047=0 -#commands + +#Server commands TSTAT.S.C00.Rsp=1 -TSTAT.S.C01.Rsp=1 -TSTAT.S.C02.Rsp=1 -TSTAT.S.C03.Rsp=1 -TSTAT.S.C04.Rsp=1 +TSTAT.S.C01.Rsp=0 +TSTAT.S.C02.Rsp=0 +TSTAT.S.C03.Rsp=0 +TSTAT.S.C04.Rsp=0 + +#Client Commands +TSTAT.C.C00.Tx=1 +TSTAT.C.C04.Tx=0 #Access Control cluster ACL.S.A0000=1 diff --git a/src/app/zap-templates/partials/idl/command_request_response.zapt b/src/app/zap-templates/partials/idl/command_request_response.zapt index d2b3b425f08032..3f6babd4a40863 100644 --- a/src/app/zap-templates/partials/idl/command_request_response.zapt +++ b/src/app/zap-templates/partials/idl/command_request_response.zapt @@ -2,6 +2,7 @@ {{/first}} {{~indent 1~}} + {{#if isFabricScoped~}} fabric {{/if~}} {{#if mustUseTimedInvoke~}} timed {{/if~}} command {{!ensure space}} {{~#chip_access_elements entity="command"~}} diff --git a/src/app/zap-templates/templates/app/cluster-objects-src.zapt b/src/app/zap-templates/templates/app/cluster-objects-src.zapt index 8ae7efca79c57d..78b5c2e0dc4f44 100644 --- a/src/app/zap-templates/templates/app/cluster-objects-src.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects-src.zapt @@ -173,66 +173,32 @@ bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand) return false; } -// TODO(#20811): Actually generate the following based on ZAP metadata -// See https://github.com/project-chip/zap/issues/609 bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) { // Maybe it would be smaller code to codegen a table and walk over it? // Not sure. switch (aCluster) { - case Clusters::Groups::Id: { - switch (aCommand) - { - case Clusters::Groups::Commands::AddGroup::Id: - case Clusters::Groups::Commands::ViewGroup::Id: - case Clusters::Groups::Commands::GetGroupMembership::Id: - case Clusters::Groups::Commands::RemoveGroup::Id: - case Clusters::Groups::Commands::RemoveAllGroups::Id: - return true; - default: - return false; - } - } - case Clusters::GroupKeyManagement::Id: { - switch (aCommand) - { - case Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRead::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: - case Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: - return true; - default: - return false; - } - } - case Clusters::GeneralCommissioning::Id: { - switch (aCommand) - { - case Clusters::GeneralCommissioning::Commands::CommissioningComplete::Id: - return true; - default: - return false; - } - } - case Clusters::Scenes::Id: { - // Entire cluster is fabric-scoped. - return true; - } - case Clusters::OperationalCredentials::Id: { - switch (aCommand) - { - case Clusters::OperationalCredentials::Commands::UpdateNOC::Id: - case Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Id: - return true; - default: - return false; - } - } - default: - break; + {{#zcl_clusters}} + {{#zcl_commands}} + {{#first}} + case Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch (aCommand) { + {{/first}} + {{#if isFabricScoped}} + case Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id: + return true; + {{/if}} + {{#last}} + default: + return false; + } + } + {{/last}} + {{/zcl_commands}} + {{/zcl_clusters}} } - return false; } diff --git a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml index 0d913e68dc9653..e67874d6bcd5dd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml @@ -74,7 +74,7 @@ limitations under the License. - + Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. diff --git a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml index f278ce48644d30..3bfaeb980a6d32 100644 --- a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml @@ -65,13 +65,13 @@ limitations under the License. MaxGroupsPerFabric MaxGroupKeysPerFabric - + Revoke a Root Key from a Group - + Revoke a Root Key from a Group @@ -84,13 +84,13 @@ limitations under the License. - + Revoke a Root Key from a Group - + Return the list of Group Key Sets associated with the accessing fabric diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml index 7fe5aa904143fd..cb35cbdf3666a1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml @@ -36,7 +36,6 @@ limitations under the License. - @@ -113,7 +112,7 @@ limitations under the License. - + Sender is requesting to update the node operational certificates. @@ -127,7 +126,7 @@ limitations under the License. - + This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index a7f8957b52f902..3653e5c1db6530 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -52,7 +52,7 @@ limitations under the License. NameSupport LastConfiguredBy - + Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' @@ -64,7 +64,7 @@ limitations under the License. - + Retrieves the requested scene entry from its Scene table. @@ -72,7 +72,7 @@ limitations under the License. - + Removes the requested scene entry, corresponding to the value of the GroupID field, from its Scene Table @@ -81,7 +81,7 @@ limitations under the License. - + Remove all scenes, corresponding to the value of the GroupID field, from its Scene Table @@ -89,7 +89,7 @@ limitations under the License. - + Adds the scene entry into its Scene Table along with all extension field sets corresponding to the current state of other clusters on the same endpoint @@ -98,7 +98,7 @@ limitations under the License. - + Set the attributes and corresponding state for each other cluster implemented on the endpoint accordingly to the resquested scene entry in the Scene Table @@ -107,14 +107,14 @@ limitations under the License. - + Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group - + Allows a scene to be added using a finer scene transition time than the AddScene command. @@ -124,14 +124,14 @@ limitations under the License. - + Allows a scene to be retrieved using a finer scene transition time than the ViewScene command - + Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. @@ -234,4 +234,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml index 6049f4e0d0e204..d6c7adf1e5dccc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml @@ -35,7 +35,7 @@ limitations under the License. mechanism by which they can be configured to use a user’s preferred unit. - TemperatureUnit + TemperatureUnit diff --git a/src/app/zap-templates/zcl/data-model/silabs/general.xml b/src/app/zap-templates/zcl/data-model/silabs/general.xml index d384934248d8eb..ea606941064b6c 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/general.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/general.xml @@ -100,7 +100,7 @@ limitations under the License. name support - + Command description for AddGroup @@ -108,32 +108,32 @@ limitations under the License. - + Command description for ViewGroup - + Command description for GetGroupMembership - + Command description for RemoveGroup - + Command description for RemoveAllGroups - + Command description for AddGroupIfIdentifying diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 9543c1c3414e94..feb959c3e6aba5 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1277,8 +1277,6 @@ CHIP_ERROR DeviceCommissioner::ConvertFromOperationalCertStatus(OperationalCrede return CHIP_ERROR_INVALID_ADMIN_SUBJECT; case OperationalCertStatus::kFabricConflict: return CHIP_ERROR_FABRIC_EXISTS; - case OperationalCertStatus::kInsufficientPrivilege: - return CHIP_ERROR_INSUFFICIENT_PRIVILEGE; case OperationalCertStatus::kLabelConflict: return CHIP_ERROR_INVALID_ARGUMENT; case OperationalCertStatus::kInvalidFabricIndex: diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index be7d85fa71e7c7..b6933d5f7d681e 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -105,12 +105,12 @@ client cluster Groups = 4 { group_id groupId = 1; } - command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; + 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; } client cluster Scenes = 5 { @@ -215,13 +215,13 @@ client cluster Scenes = 5 { optional INT8U sceneList[] = 3; } - command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; } client cluster OnOff = 6 { @@ -1075,7 +1075,7 @@ client cluster GeneralCommissioning = 48 { command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; - command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; } client cluster NetworkCommissioning = 49 { @@ -1771,7 +1771,6 @@ client cluster OperationalCredentials = 62 { kMissingCsr = 4; kTableFull = 5; kInvalidAdminSubject = 6; - kInsufficientPrivilege = 8; kFabricConflict = 9; kLabelConflict = 10; kInvalidFabricIndex = 11; @@ -1866,8 +1865,8 @@ client cluster OperationalCredentials = 62 { command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; - command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; - command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + 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; } @@ -1936,10 +1935,10 @@ client cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; - command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; - command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; - command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; + 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(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } client cluster FixedLabel = 64 { diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn index 6e8c612c6e2e2a..3baf852afba26c 100644 --- a/src/controller/python/BUILD.gn +++ b/src/controller/python/BUILD.gn @@ -359,7 +359,7 @@ chip_python_wheel_action("chip-clusters") { py_package_name = "chip-clusters" py_platform_tag = "any" - output_name = "chip_clusters-${chip_python_version}-py3-any.whl" + output_name = "chip_clusters-${chip_python_version}-py3-none-any.whl" } chip_python_wheel_action("chip-repl") { @@ -407,5 +407,5 @@ chip_python_wheel_action("chip-repl") { ":chip-core", ] - output_name = "chip_repl-${chip_python_version}-py3-any.whl" + output_name = "chip_repl-${chip_python_version}-py3-none-any.whl" } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 723dc91cb1797a..93586fc2196954 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -11042,7 +11042,6 @@ class OperationalCertStatus(IntEnum): kMissingCsr = 0x04 kTableFull = 0x05 kInvalidAdminSubject = 0x06 - kInsufficientPrivilege = 0x08 kFabricConflict = 0x09 kLabelConflict = 0x0A kInvalidFabricIndex = 0x0B diff --git a/src/crypto/BUILD.gn b/src/crypto/BUILD.gn index 359bb9d289cf0a..a5e176c3fe5212 100644 --- a/src/crypto/BUILD.gn +++ b/src/crypto/BUILD.gn @@ -57,6 +57,8 @@ if (chip_crypto == "openssl") { import("//build_overrides/boringssl.gni") } else if (chip_crypto == "mbedtls") { import("//build_overrides/mbedtls.gni") +} else if (chip_crypto == "tinycrypt") { + import("//build_overrides/mbedtls.gni") } static_library("crypto") { @@ -99,6 +101,9 @@ static_library("crypto") { # BoringSSL is close enough to OpenSSL that isd uses same PAL, with minor #ifdef differences sources += [ "CHIPCryptoPALOpenSSL.cpp" ] public_deps += [ "${boringssl_root}:boringssl" ] + } else if (chip_crypto == "tinycrypt") { + sources += [ "CHIPCryptoPALTinyCrypt.cpp" ] + public_deps += [ "${mbedtls_root}:mbedtls" ] } else { assert(false, "Invalid CHIP crypto") } diff --git a/src/crypto/CHIPCryptoPALTinyCrypt.cpp b/src/crypto/CHIPCryptoPALTinyCrypt.cpp new file mode 100644 index 00000000000000..2b86f418cb27d3 --- /dev/null +++ b/src/crypto/CHIPCryptoPALTinyCrypt.cpp @@ -0,0 +1,1500 @@ +/* + * + * Copyright (c) 2020-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. + */ + +/** + * @file + * mbedTLS based implementation of CHIP crypto primitives + */ + +#include "CHIPCryptoPAL.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(MBEDTLS_X509_CRT_PARSE_C) +#include +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace chip { +namespace Crypto { + +#define MAX_ERROR_STR_LEN 128 +#define NUM_BYTES_IN_SHA256_HASH 32 + +// In mbedTLS 3.0.0 direct access to structure fields was replaced with using MBEDTLS_PRIVATE macro. +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) +#define CHIP_CRYPTO_PAL_PRIVATE(x) MBEDTLS_PRIVATE(x) +#else +#define CHIP_CRYPTO_PAL_PRIVATE(x) x +#endif + +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000 && MBEDTLS_VERSION_NUMBER < 0x03010000) +#define CHIP_CRYPTO_PAL_PRIVATE_X509(x) MBEDTLS_PRIVATE(x) +#else +#define CHIP_CRYPTO_PAL_PRIVATE_X509(x) x +#endif + +typedef struct +{ + bool mInitialized; + bool mDRBGSeeded; + mbedtls_ctr_drbg_context mDRBGCtxt; + mbedtls_entropy_context mEntropy; +} EntropyContext; + +static EntropyContext gsEntropyContext; + +static void _log_mbedTLS_error(int error_code) +{ + if (error_code != 0 && error_code != UECC_SUCCESS) + { +#if defined(MBEDTLS_ERROR_C) + char error_str[MAX_ERROR_STR_LEN]; + mbedtls_strerror(error_code, error_str, sizeof(error_str)); + ChipLogError(Crypto, "mbedTLS error: %s", error_str); +#else + // Error codes defined in 16-bit negative hex numbers. Ease lookup by printing likewise + ChipLogError(Crypto, "mbedTLS error: -0x%04X", -static_cast(error_code)); +#endif + } +} + +static bool _isValidTagLength(size_t tag_length) +{ + if (tag_length == 8 || tag_length == 12 || tag_length == 16) + { + return true; + } + return false; +} + +static bool _isValidKeyLength(size_t length) +{ + // 16 bytes key for AES-CCM-128, 32 for AES-CCM-256 + if (length == 16 || length == 32) + { + return true; + } + return false; +} + +CHIP_ERROR AES_CCM_encrypt(const uint8_t * plaintext, size_t plaintext_length, const uint8_t * aad, size_t aad_length, + const uint8_t * key, size_t key_length, const uint8_t * nonce, size_t nonce_length, uint8_t * ciphertext, + uint8_t * tag, size_t tag_length) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 1; + + mbedtls_ccm_context context; + mbedtls_ccm_init(&context); + + VerifyOrExit(plaintext != nullptr || plaintext_length == 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(ciphertext != nullptr || plaintext_length == 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(key != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(_isValidKeyLength(key_length), error = CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE); + VerifyOrExit(nonce != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(nonce_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(tag != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(_isValidTagLength(tag_length), error = CHIP_ERROR_INVALID_ARGUMENT); + if (aad_length > 0) + { + VerifyOrExit(aad != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + } + + // Size of key = key_length * number of bits in a byte (8) + // Cast is safe because we called _isValidKeyLength above. + result = + mbedtls_ccm_setkey(&context, MBEDTLS_CIPHER_ID_AES, Uint8::to_const_uchar(key), static_cast(key_length * 8)); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + // Encrypt + result = mbedtls_ccm_encrypt_and_tag(&context, plaintext_length, Uint8::to_const_uchar(nonce), nonce_length, + Uint8::to_const_uchar(aad), aad_length, Uint8::to_const_uchar(plaintext), + Uint8::to_uchar(ciphertext), Uint8::to_uchar(tag), tag_length); + _log_mbedTLS_error(result); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + +exit: + mbedtls_ccm_free(&context); + return error; +} + +CHIP_ERROR AES_CCM_decrypt(const uint8_t * ciphertext, size_t ciphertext_len, const uint8_t * aad, size_t aad_len, + const uint8_t * tag, size_t tag_length, const uint8_t * key, size_t key_length, const uint8_t * nonce, + size_t nonce_length, uint8_t * plaintext) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 1; + + mbedtls_ccm_context context; + mbedtls_ccm_init(&context); + + VerifyOrExit(plaintext != nullptr || ciphertext_len == 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(ciphertext != nullptr || ciphertext_len == 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(tag != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(_isValidTagLength(tag_length), error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(key != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(_isValidKeyLength(key_length), error = CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE); + VerifyOrExit(nonce != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(nonce_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); + if (aad_len > 0) + { + VerifyOrExit(aad != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + } + + // Size of key = key_length * number of bits in a byte (8) + // Cast is safe because we called _isValidKeyLength above. + result = + mbedtls_ccm_setkey(&context, MBEDTLS_CIPHER_ID_AES, Uint8::to_const_uchar(key), static_cast(key_length * 8)); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + // Decrypt + result = mbedtls_ccm_auth_decrypt(&context, ciphertext_len, Uint8::to_const_uchar(nonce), nonce_length, + Uint8::to_const_uchar(aad), aad_len, Uint8::to_const_uchar(ciphertext), + Uint8::to_uchar(plaintext), Uint8::to_const_uchar(tag), tag_length); + _log_mbedTLS_error(result); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + +exit: + mbedtls_ccm_free(&context); + return error; +} + +CHIP_ERROR Hash_SHA256(const uint8_t * data, const size_t data_length, uint8_t * out_buffer) +{ + // zero data length hash is supported. + VerifyOrReturnError(data != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) + const int result = mbedtls_sha256(Uint8::to_const_uchar(data), data_length, Uint8::to_uchar(out_buffer), 0); +#else + const int result = mbedtls_sha256_ret(Uint8::to_const_uchar(data), data_length, Uint8::to_uchar(out_buffer), 0); +#endif + + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Hash_SHA1(const uint8_t * data, const size_t data_length, uint8_t * out_buffer) +{ + // zero data length hash is supported. + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) + const int result = mbedtls_sha1(Uint8::to_const_uchar(data), data_length, Uint8::to_uchar(out_buffer)); +#else + const int result = mbedtls_sha1_ret(Uint8::to_const_uchar(data), data_length, Uint8::to_uchar(out_buffer)); +#endif + + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +static_assert(kMAX_Hash_SHA256_Context_Size >= sizeof(mbedtls_sha256_context), + "kMAX_Hash_SHA256_Context_Size is too small for the size of underlying mbedtls_sha256_context"); + +static inline mbedtls_sha256_context * to_inner_hash_sha256_context(HashSHA256OpaqueContext * context) +{ + return SafePointerCast(context); +} + +Hash_SHA256_stream::Hash_SHA256_stream(void) +{ + mbedtls_sha256_context * context = to_inner_hash_sha256_context(&mContext); + mbedtls_sha256_init(context); +} + +Hash_SHA256_stream::~Hash_SHA256_stream(void) +{ + mbedtls_sha256_context * context = to_inner_hash_sha256_context(&mContext); + mbedtls_sha256_free(context); + Clear(); +} + +CHIP_ERROR Hash_SHA256_stream::Begin(void) +{ + mbedtls_sha256_context * const context = to_inner_hash_sha256_context(&mContext); + +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) + const int result = mbedtls_sha256_starts(context, 0); +#else + const int result = mbedtls_sha256_starts_ret(context, 0); +#endif + + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Hash_SHA256_stream::AddData(const ByteSpan data) +{ + mbedtls_sha256_context * const context = to_inner_hash_sha256_context(&mContext); + +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) + const int result = mbedtls_sha256_update(context, Uint8::to_const_uchar(data.data()), data.size()); +#else + const int result = mbedtls_sha256_update_ret(context, Uint8::to_const_uchar(data.data()), data.size()); +#endif + + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Hash_SHA256_stream::GetDigest(MutableByteSpan & out_buffer) +{ + mbedtls_sha256_context * context = to_inner_hash_sha256_context(&mContext); + + // Back-up context as we are about to finalize the hash to extract digest. + mbedtls_sha256_context previous_ctx; + mbedtls_sha256_init(&previous_ctx); + mbedtls_sha256_clone(&previous_ctx, context); + + // Pad + compute digest, then finalize context. It is restored next line to continue. + CHIP_ERROR result = Finish(out_buffer); + + // Restore context prior to finalization. + mbedtls_sha256_clone(context, &previous_ctx); + mbedtls_sha256_free(&previous_ctx); + + return result; +} + +CHIP_ERROR Hash_SHA256_stream::Finish(MutableByteSpan & out_buffer) +{ + VerifyOrReturnError(out_buffer.size() >= kSHA256_Hash_Length, CHIP_ERROR_BUFFER_TOO_SMALL); + mbedtls_sha256_context * const context = to_inner_hash_sha256_context(&mContext); + +#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) + const int result = mbedtls_sha256_finish(context, Uint8::to_uchar(out_buffer.data())); +#else + const int result = mbedtls_sha256_finish_ret(context, Uint8::to_uchar(out_buffer.data())); +#endif + + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + out_buffer = out_buffer.SubSpan(0, kSHA256_Hash_Length); + + return CHIP_NO_ERROR; +} + +void Hash_SHA256_stream::Clear(void) +{ + mbedtls_platform_zeroize(this, sizeof(*this)); +} + +CHIP_ERROR HKDF_sha::HKDF_SHA256(const uint8_t * secret, const size_t secret_length, const uint8_t * salt, const size_t salt_length, + const uint8_t * info, const size_t info_length, uint8_t * out_buffer, size_t out_length) +{ + VerifyOrReturnError(secret != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(secret_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + + // Salt is optional + if (salt_length > 0) + { + VerifyOrReturnError(salt != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + } + + VerifyOrReturnError(info_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(info != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + const mbedtls_md_info_t * const md = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + VerifyOrReturnError(md != nullptr, CHIP_ERROR_INTERNAL); + + const int result = mbedtls_hkdf(md, Uint8::to_const_uchar(salt), salt_length, Uint8::to_const_uchar(secret), secret_length, + Uint8::to_const_uchar(info), info_length, Uint8::to_uchar(out_buffer), out_length); + _log_mbedTLS_error(result); + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR HMAC_sha::HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, + uint8_t * out_buffer, size_t out_length) +{ + VerifyOrReturnError(key != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(key_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length >= kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + const mbedtls_md_info_t * const md = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + VerifyOrReturnError(md != nullptr, CHIP_ERROR_INTERNAL); + + const int result = + mbedtls_md_hmac(md, Uint8::to_const_uchar(key), key_length, Uint8::to_const_uchar(message), message_length, out_buffer); + + _log_mbedTLS_error(result); + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR PBKDF2_sha256::pbkdf2_sha256(const uint8_t * password, size_t plen, const uint8_t * salt, size_t slen, + unsigned int iteration_count, uint32_t key_length, uint8_t * output) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + const mbedtls_md_info_t * md_info; + mbedtls_md_context_t md_ctxt; + constexpr int use_hmac = 1; + + bool free_md_ctxt = false; + + VerifyOrExit(password != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(plen > 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(salt != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(slen >= kSpake2p_Min_PBKDF_Salt_Length, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(slen <= kSpake2p_Max_PBKDF_Salt_Length, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(key_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(output != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + + md_info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + VerifyOrExit(md_info != nullptr, error = CHIP_ERROR_INTERNAL); + + mbedtls_md_init(&md_ctxt); + free_md_ctxt = true; + + result = mbedtls_md_setup(&md_ctxt, md_info, use_hmac); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + result = mbedtls_pkcs5_pbkdf2_hmac(&md_ctxt, Uint8::to_const_uchar(password), plen, Uint8::to_const_uchar(salt), slen, + iteration_count, key_length, Uint8::to_uchar(output)); + + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + +exit: + _log_mbedTLS_error(result); + + if (free_md_ctxt) + { + mbedtls_md_free(&md_ctxt); + } + + return error; +} + +static EntropyContext * get_entropy_context() +{ + if (!gsEntropyContext.mInitialized) + { + mbedtls_entropy_init(&gsEntropyContext.mEntropy); + mbedtls_ctr_drbg_init(&gsEntropyContext.mDRBGCtxt); + + gsEntropyContext.mInitialized = true; + } + + return &gsEntropyContext; +} + +static mbedtls_ctr_drbg_context * get_drbg_context() +{ + EntropyContext * const context = get_entropy_context(); + + mbedtls_ctr_drbg_context * const drbgCtxt = &context->mDRBGCtxt; + + if (!context->mDRBGSeeded) + { + const int status = mbedtls_ctr_drbg_seed(drbgCtxt, mbedtls_entropy_func, &context->mEntropy, nullptr, 0); + if (status != 0) + { + _log_mbedTLS_error(status); + return nullptr; + } + + context->mDRBGSeeded = true; + } + + return drbgCtxt; +} + +CHIP_ERROR add_entropy_source(entropy_source fn_source, void * p_source, size_t threshold) +{ + VerifyOrReturnError(fn_source != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + EntropyContext * const entropy_ctxt = get_entropy_context(); + VerifyOrReturnError(entropy_ctxt != nullptr, CHIP_ERROR_INTERNAL); + + const int result = + mbedtls_entropy_add_source(&entropy_ctxt->mEntropy, fn_source, p_source, threshold, MBEDTLS_ENTROPY_SOURCE_STRONG); + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DRBG_get_bytes(uint8_t * out_buffer, const size_t out_length) +{ + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(out_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + + mbedtls_ctr_drbg_context * const drbg_ctxt = get_drbg_context(); + VerifyOrReturnError(drbg_ctxt != nullptr, CHIP_ERROR_INTERNAL); + + const int result = mbedtls_ctr_drbg_random(drbg_ctxt, Uint8::to_uchar(out_buffer), out_length); + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +static int CryptoRNG(void * ctxt, uint8_t * out_buffer, size_t out_length) +{ + return (chip::Crypto::DRBG_get_bytes(out_buffer, out_length) == CHIP_NO_ERROR) ? 0 : 1; +} + +mbedtls_ecp_group_id MapECPGroupId(SupportedECPKeyTypes keyType) +{ + switch (keyType) + { + case SupportedECPKeyTypes::ECP256R1: + return MBEDTLS_ECP_DP_SECP256R1; + default: + return MBEDTLS_ECP_DP_NONE; + } +} + +static inline mbedtls_uecc_keypair * to_keypair(P256KeypairContext * context) +{ + return SafePointerCast(context); +} + +static inline const mbedtls_uecc_keypair * to_const_keypair(const P256KeypairContext * context) +{ + return SafePointerCast(context); +} + +CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const +{ + VerifyOrReturnError(mInitialized, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); + + uint8_t digest[kSHA256_Hash_Length]; + memset(&digest[0], 0, sizeof(digest)); + ReturnErrorOnFailure(Hash_SHA256(msg, msg_length, &digest[0])); + + CHIP_ERROR error = CHIP_NO_ERROR; + int result = UECC_FAILURE; + + const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); + + result = uECC_sign(keypair->private_key, digest, sizeof(digest), out_signature.Bytes()); + + VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(out_signature.SetLength(kP256_ECDSA_Signature_Length_Raw) == CHIP_NO_ERROR, error = CHIP_ERROR_INTERNAL); + + keypair = nullptr; + +exit: + return error; +} + +CHIP_ERROR P256PublicKey::ECDSA_validate_msg_signature(const uint8_t * msg, const size_t msg_length, + const P256ECDSASignature & signature) const +{ +#if defined(MBEDTLS_ECDSA_C) + VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); + + uint8_t digest[kSHA256_Hash_Length]; + memset(&digest[0], 0, sizeof(digest)); + ReturnErrorOnFailure(Hash_SHA256(msg, msg_length, &digest[0])); + + return ECDSA_validate_hash_signature(&digest[0], sizeof(digest), signature); +#else + return CHIP_ERROR_NOT_IMPLEMENTED; +#endif +} + +CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, const size_t hash_length, + const P256ECDSASignature & signature) const +{ + VerifyOrReturnError(hash != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(hash_length == kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(signature.Length() == kP256_ECDSA_Signature_Length_Raw, CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ERROR error = CHIP_NO_ERROR; + int result = UECC_FAILURE; + + const uint8_t * public_key = *this; + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + result = uECC_verify(public_key + 1, hash, hash_length, Uint8::to_const_uchar(signature.ConstBytes())); + VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INVALID_SIGNATURE); + +exit: + return error; +} + +CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_key, P256ECDHDerivedSecret & out_secret) const +{ +#if defined(MBEDTLS_ECDH_C) + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + size_t secret_length = (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(); + + const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); + + VerifyOrExit(mInitialized, error = CHIP_ERROR_INCORRECT_STATE); + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + result = uECC_shared_secret(remote_public_key.ConstBytes() + 1, keypair->private_key, Uint8::to_uchar(out_secret)); + VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); + + SuccessOrExit(out_secret.SetLength(secret_length)); + +exit: + keypair = nullptr; + _log_mbedTLS_error(result); + return error; +#else + return CHIP_ERROR_NOT_IMPLEMENTED; +#endif +} + +void ClearSecretData(uint8_t * buf, size_t len) +{ + mbedtls_platform_zeroize(buf, len); +} + +// THE BELOW IS FROM `third_party/openthread/repo/third_party/mbedtls/repo/library/constant_time.c` since +// mbedtls_ct_memcmp is not available on Linux somehow :( +int mbedtls_ct_memcmp_copy(const void * a, const void * b, size_t n) +{ + size_t i; + volatile const unsigned char * A = (volatile const unsigned char *) a; + volatile const unsigned char * B = (volatile const unsigned char *) b; + volatile unsigned char diff = 0; + + for (i = 0; i < n; i++) + { + /* Read volatile data in order before computing diff. + * This avoids IAR compiler warning: + * 'the order of volatile accesses is undefined ..' */ + unsigned char x = A[i], y = B[i]; + diff |= x ^ y; + } + + return ((int) diff); +} + +bool IsBufferContentEqualConstantTime(const void * a, const void * b, size_t n) +{ + return mbedtls_ct_memcmp_copy(a, b, n) == 0; +} + +CHIP_ERROR P256Keypair::Initialize() +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = UECC_FAILURE; + + Clear(); + + mbedtls_uecc_keypair * keypair = to_keypair(&mKeypair); + + result = uECC_make_key(keypair->public_key, keypair->private_key); + VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + Uint8::to_uchar(mPublicKey)[0] = 0x04; + memcpy(Uint8::to_uchar(mPublicKey) + 1, keypair->public_key, 2 * NUM_ECC_BYTES); + + keypair = nullptr; + mInitialized = true; + +exit: + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR P256Keypair::Serialize(P256SerializedKeypair & output) const +{ + const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); + size_t len = output.Length() == 0 ? output.Capacity() : output.Length(); + Encoding::BufferWriter bbuf(output, len); + uint8_t privkey[kP256_PrivateKey_Length]; + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + bbuf.Put(mPublicKey, mPublicKey.Length()); + + VerifyOrExit(bbuf.Available() == sizeof(privkey), error = CHIP_ERROR_INTERNAL); + VerifyOrExit(sizeof(keypair->private_key) <= bbuf.Available(), error = CHIP_ERROR_INTERNAL); + + memcpy(privkey, keypair->private_key, sizeof(privkey)); + + bbuf.Put(privkey, sizeof(privkey)); + VerifyOrExit(bbuf.Fit(), error = CHIP_ERROR_BUFFER_TOO_SMALL); + + output.SetLength(bbuf.Needed()); + +exit: + memset(privkey, 0, sizeof(privkey)); + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR P256Keypair::Deserialize(P256SerializedKeypair & input) +{ + int result = 0; + CHIP_ERROR error = CHIP_NO_ERROR; + Encoding::BufferWriter bbuf(mPublicKey, mPublicKey.Length()); + + Clear(); + + mbedtls_uecc_keypair * keypair = to_keypair(&mKeypair); + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + memcpy(keypair->public_key, Uint8::to_uchar(input) + 1, 2 * NUM_ECC_BYTES); + memcpy(keypair->private_key, Uint8::to_uchar(input) + mPublicKey.Length(), NUM_ECC_BYTES); + + keypair = nullptr; + + VerifyOrExit(input.Length() == mPublicKey.Length() + kP256_PrivateKey_Length, error = CHIP_ERROR_INVALID_ARGUMENT); + bbuf.Put((const uint8_t *) input, mPublicKey.Length()); + VerifyOrExit(bbuf.Fit(), error = CHIP_ERROR_NO_MEMORY); + + mInitialized = true; + + _log_mbedTLS_error(result); + +exit: + return error; +} + +void P256Keypair::Clear() +{ + if (mInitialized) + { + mbedtls_uecc_keypair * keypair = to_keypair(&mKeypair); + memset(keypair, 0, sizeof(mbedtls_uecc_keypair)); + mInitialized = false; + } +} + +P256Keypair::~P256Keypair() +{ + Clear(); +} + +CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + size_t out_length; + + mbedtls_x509write_csr csr; + mbedtls_x509write_csr_init(&csr); + + mbedtls_pk_context pk; + pk.CHIP_CRYPTO_PAL_PRIVATE(pk_info) = mbedtls_pk_info_from_type(MBEDTLS_PK_ECKEY); + pk.CHIP_CRYPTO_PAL_PRIVATE(pk_ctx) = to_keypair(&mKeypair); + VerifyOrExit(pk.CHIP_CRYPTO_PAL_PRIVATE(pk_info) != nullptr, error = CHIP_ERROR_INTERNAL); + + VerifyOrExit(mInitialized, error = CHIP_ERROR_INCORRECT_STATE); + + mbedtls_x509write_csr_set_key(&csr, &pk); + + mbedtls_x509write_csr_set_md_alg(&csr, MBEDTLS_MD_SHA256); + + // TODO: mbedTLS CSR parser fails if the subject name is not set (or if empty). + // CHIP Spec doesn't specify the subject name that can be used. + // Figure out the correct value and update this code. + result = mbedtls_x509write_csr_set_subject_name(&csr, "O=CSR"); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + result = mbedtls_x509write_csr_der(&csr, out_csr, csr_length, CryptoRNG, nullptr); + VerifyOrExit(result > 0, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(CanCastTo(result), error = CHIP_ERROR_INTERNAL); + + out_length = static_cast(result); + result = 0; + VerifyOrExit(out_length <= csr_length, error = CHIP_ERROR_INTERNAL); + + if (csr_length != out_length) + { + // mbedTLS API writes the CSR at the end of the provided buffer. + // Let's move it to the start of the buffer. + size_t offset = csr_length - out_length; + memmove(out_csr, &out_csr[offset], out_length); + } + + csr_length = out_length; + +exit: + mbedtls_x509write_csr_free(&csr); + + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR VerifyCertificateSigningRequest(const uint8_t * csr_buf, size_t csr_length, P256PublicKey & pubkey) +{ +#if defined(MBEDTLS_X509_CSR_PARSE_C) + // TODO: For some embedded targets, mbedTLS library doesn't have mbedtls_x509_csr_parse_der, and mbedtls_x509_csr_parse_free. + // Taking a step back, embedded targets likely will not process CSR requests. Adding this action item to reevaluate + // this if there's a need for this processing for embedded targets. + CHIP_ERROR error = CHIP_NO_ERROR; + size_t pubkey_size = 0; + + mbedtls_ecp_keypair * keypair = nullptr; + + P256ECDSASignature signature; + MutableByteSpan out_raw_sig_span(signature.Bytes(), signature.Capacity()); + + mbedtls_x509_csr csr; + mbedtls_x509_csr_init(&csr); + + int result = mbedtls_x509_csr_parse_der(&csr, csr_buf, csr_length); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + // Verify the signature algorithm and public key type + VerifyOrExit(csr.CHIP_CRYPTO_PAL_PRIVATE(sig_md) == MBEDTLS_MD_SHA256, error = CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE); + VerifyOrExit(csr.CHIP_CRYPTO_PAL_PRIVATE(sig_pk) == MBEDTLS_PK_ECDSA, error = CHIP_ERROR_WRONG_KEY_TYPE); + + keypair = mbedtls_pk_ec(csr.CHIP_CRYPTO_PAL_PRIVATE_X509(pk)); + + // Copy the public key from the CSR + result = mbedtls_ecp_point_write_binary(&keypair->CHIP_CRYPTO_PAL_PRIVATE(grp), &keypair->CHIP_CRYPTO_PAL_PRIVATE(Q), + MBEDTLS_ECP_PF_UNCOMPRESSED, &pubkey_size, Uint8::to_uchar(pubkey), pubkey.Length()); + + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(pubkey_size == pubkey.Length(), error = CHIP_ERROR_INTERNAL); + + // Convert DER signature to raw signature + error = EcdsaAsn1SignatureToRaw(kP256_FE_Length, + ByteSpan{ csr.CHIP_CRYPTO_PAL_PRIVATE(sig).CHIP_CRYPTO_PAL_PRIVATE_X509(p), + csr.CHIP_CRYPTO_PAL_PRIVATE(sig).CHIP_CRYPTO_PAL_PRIVATE_X509(len) }, + out_raw_sig_span); + + VerifyOrExit(error == CHIP_NO_ERROR, error = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(out_raw_sig_span.size() == (kP256_FE_Length * 2), error = CHIP_ERROR_INTERNAL); + signature.SetLength(out_raw_sig_span.size()); + + // Verify the signature using the public key + error = pubkey.ECDSA_validate_msg_signature(csr.CHIP_CRYPTO_PAL_PRIVATE_X509(cri).CHIP_CRYPTO_PAL_PRIVATE_X509(p), + csr.CHIP_CRYPTO_PAL_PRIVATE_X509(cri).CHIP_CRYPTO_PAL_PRIVATE_X509(len), signature); + + SuccessOrExit(error); + +exit: + mbedtls_x509_csr_free(&csr); + _log_mbedTLS_error(result); + return error; +#else + ChipLogError(Crypto, "MBEDTLS_X509_CSR_PARSE_C is not enabled. CSR cannot be parsed"); + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +typedef struct Spake2p_Context +{ + const mbedtls_md_info_t * md_info; + uECC_word_t M[2 * NUM_ECC_WORDS]; + uECC_word_t N[2 * NUM_ECC_WORDS]; + uECC_word_t X[2 * NUM_ECC_WORDS]; + uECC_word_t Y[2 * NUM_ECC_WORDS]; + uECC_word_t L[2 * NUM_ECC_WORDS]; + uECC_word_t Z[2 * NUM_ECC_WORDS]; + uECC_word_t V[2 * NUM_ECC_WORDS]; + + uECC_word_t w0[NUM_ECC_WORDS]; + uECC_word_t w1[NUM_ECC_WORDS]; + uECC_word_t xy[NUM_ECC_WORDS]; + uECC_word_t tempbn[NUM_ECC_WORDS]; +} Spake2p_Context; + +static inline Spake2p_Context * to_inner_spake2p_context(Spake2pOpaqueContext * context) +{ + return SafePointerCast(context); +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); + + memset(context, 0, sizeof(Spake2p_Context)); + + M = context->M; + N = context->N; + X = context->X; + Y = context->Y; + L = context->L; + V = context->V; + Z = context->Z; + + w0 = context->w0; + w1 = context->w1; + xy = context->xy; + tempbn = context->tempbn; + + G = curve_G; + + return error; + +exit: + _log_mbedTLS_error(result); + Clear(); + return error; +} + +void Spake2p_P256_SHA256_HKDF_HMAC::Clear() +{ + VerifyOrReturn(state != CHIP_SPAKE2P_STATE::PREINIT); + + Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); + memset(&context->M, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->N, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->X, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->Y, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->L, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->Z, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->V, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); + + memset(&context->w0, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->w1, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->xy, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); + memset(&context->tempbn, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); + + G = NULL; + state = CHIP_SPAKE2P_STATE::PREINIT; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::Mac(const uint8_t * key, size_t key_len, const uint8_t * in, size_t in_len, + MutableByteSpan & out_span) +{ + HMAC_sha hmac; + VerifyOrReturnError(out_span.size() >= kSHA256_Hash_Length, CHIP_ERROR_BUFFER_TOO_SMALL); + ReturnErrorOnFailure(hmac.HMAC_SHA256(key, key_len, in, in_len, out_span.data(), kSHA256_Hash_Length)); + out_span = out_span.SubSpan(0, kSHA256_Hash_Length); + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::MacVerify(const uint8_t * key, size_t key_len, const uint8_t * mac, size_t mac_len, + const uint8_t * in, size_t in_len) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + uint8_t computed_mac[kSHA256_Hash_Length]; + MutableByteSpan computed_mac_span{ computed_mac }; + VerifyOrExit(mac_len == kSHA256_Hash_Length, error = CHIP_ERROR_INVALID_ARGUMENT); + + SuccessOrExit(error = Mac(key, key_len, in, in_len, computed_mac_span)); + VerifyOrExit(computed_mac_span.size() == mac_len, error = CHIP_ERROR_INTERNAL); + + VerifyOrExit(IsBufferContentEqualConstantTime(mac, computed_mac, kSHA256_Hash_Length), error = CHIP_ERROR_INTERNAL); + +exit: + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FELoad(const uint8_t * in, size_t in_len, void * fe) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + uECC_word_t tmp[2 * NUM_ECC_WORDS] = { 0 }; + uECC_vli_bytesToNative(tmp, in, NUM_ECC_BYTES); + + uECC_vli_mmod((uECC_word_t *) fe, tmp, curve_n); + +exit: + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEWrite(const void * fe, uint8_t * out, size_t out_len) +{ + uECC_vli_nativeToBytes(out, NUM_ECC_BYTES, (const unsigned int *) fe); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEGenerate(void * fe) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + mbedtls_uecc_keypair keypair; + + result = UECC_FAILURE; + + result = uECC_make_key(keypair.public_key, keypair.private_key); + VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); + + uECC_vli_bytesToNative((uECC_word_t *) fe, keypair.private_key, NUM_ECC_BYTES); + +exit: + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEMul(void * fer, const void * fe1, const void * fe2) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + uECC_vli_modMult((uECC_word_t *) fer, (const uECC_word_t *) fe1, (const uECC_word_t *) fe2, (const uECC_word_t *) curve_n); + +exit: + _log_mbedTLS_error(result); + return error; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointLoad(const uint8_t * in, size_t in_len, void * R) +{ + uint8_t tmp[2 * NUM_ECC_BYTES]; + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + memcpy(tmp, in + 1, 2 * NUM_ECC_BYTES); + + uECC_vli_bytesToNative((uECC_word_t *) R, tmp, NUM_ECC_BYTES); + uECC_vli_bytesToNative((uECC_word_t *) R + NUM_ECC_WORDS, tmp + NUM_ECC_BYTES, NUM_ECC_BYTES); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointWrite(const void * R, uint8_t * out, size_t out_len) +{ + memset(out, 0, out_len); + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + out[0] = 0x04; + uECC_vli_nativeToBytes(out + 1, NUM_ECC_BYTES, (uECC_word_t *) R); + uECC_vli_nativeToBytes(out + NUM_ECC_BYTES + 1, NUM_ECC_BYTES, (uECC_word_t *) R + NUM_ECC_WORDS); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointMul(void * R, const void * P1, const void * fe1) +{ + + if (EccPoint_mult_safer((uECC_word_t *) R, (const uECC_word_t *) P1, (const uECC_word_t *) fe1) != UECC_SUCCESS) + { + return CHIP_ERROR_INTERNAL; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointAddMul(void * R, const void * P1, const void * fe1, const void * P2, + const void * fe2) +{ + uECC_word_t R1[2 * NUM_ECC_WORDS]; + uECC_word_t R2[2 * NUM_ECC_WORDS]; + uECC_word_t z[NUM_ECC_WORDS]; + uint8_t ret = UECC_SUCCESS; + + if (EccPoint_mult_safer(R1, (const uECC_word_t *) P1, (const uECC_word_t *) fe1) != UECC_SUCCESS) + { + return CHIP_ERROR_INTERNAL; + } + + if (EccPoint_mult_safer(R2, (const uECC_word_t *) P2, (const uECC_word_t *) fe2) != UECC_SUCCESS) + { + return CHIP_ERROR_INTERNAL; + } + + uECC_vli_modSub(z, R2, R1, curve_p); + XYcZ_add(R1, R1 + NUM_ECC_WORDS, R2, R2 + NUM_ECC_WORDS); + uECC_vli_modInv(z, z, curve_p); + apply_z(R2, R2 + NUM_ECC_WORDS, z); + + memcpy((uECC_word_t *) R, R2, 2 * NUM_ECC_BYTES); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointInvert(void * R) +{ + uECC_word_t tmp[NUM_ECC_WORDS] = { 0 }; + + uECC_vli_sub(tmp, curve_p, (uECC_word_t *) R + NUM_ECC_WORDS); + memcpy((uECC_word_t *) R + NUM_ECC_WORDS, tmp, NUM_ECC_BYTES); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointCofactorMul(void * R) +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::ComputeL(uint8_t * Lout, size_t * L_len, const uint8_t * w1in, size_t w1in_len) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + result = UECC_SUCCESS; + uECC_word_t tmp[2 * NUM_ECC_WORDS]; + uECC_word_t w1_bn[NUM_ECC_WORDS]; + uECC_word_t L_tmp[2 * NUM_ECC_WORDS]; + + uECC_vli_bytesToNative(tmp, w1in, NUM_ECC_BYTES); + + uECC_vli_mmod(w1_bn, tmp, curve_n); + + result = EccPoint_mult_safer(L_tmp, curve_G, w1_bn); + VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); + + // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed + Lout[0] = 0x04; + uECC_vli_nativeToBytes(Lout + 1, NUM_ECC_BYTES, L_tmp); + uECC_vli_nativeToBytes(Lout + NUM_ECC_BYTES + 1, NUM_ECC_BYTES, L_tmp + NUM_ECC_WORDS); + +exit: + _log_mbedTLS_error(result); + + return error; +} + +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointIsValid(void * R) +{ + if (uECC_valid_point((const uECC_word_t *) R) != 0) + { + return CHIP_ERROR_INTERNAL; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t rootCertificateLen, const uint8_t * caCertificate, + size_t caCertificateLen, const uint8_t * leafCertificate, size_t leafCertificateLen, + CertificateChainValidationResult & result) +{ +#if defined(MBEDTLS_X509_CRT_PARSE_C) + CHIP_ERROR error = CHIP_NO_ERROR; + mbedtls_x509_crt certChain; + mbedtls_x509_crt rootCert; + int mbedResult; + uint32_t flags; + + result = CertificateChainValidationResult::kInternalFrameworkError; + + VerifyOrReturnError(rootCertificate != nullptr && rootCertificateLen != 0, + (result = CertificateChainValidationResult::kRootArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); + VerifyOrReturnError(caCertificate != nullptr && caCertificateLen != 0, + (result = CertificateChainValidationResult::kICAArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); + VerifyOrReturnError(leafCertificate != nullptr && leafCertificateLen != 0, + (result = CertificateChainValidationResult::kLeafArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); + + mbedtls_x509_crt_init(&certChain); + mbedtls_x509_crt_init(&rootCert); + + /* Start of chain */ + mbedResult = mbedtls_x509_crt_parse(&certChain, Uint8::to_const_uchar(leafCertificate), leafCertificateLen); + VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kLeafFormatInvalid, error = CHIP_ERROR_INTERNAL)); + + /* Add the intermediate to the chain */ + mbedResult = mbedtls_x509_crt_parse(&certChain, Uint8::to_const_uchar(caCertificate), caCertificateLen); + VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kICAFormatInvalid, error = CHIP_ERROR_INTERNAL)); + + /* Parse the root cert */ + mbedResult = mbedtls_x509_crt_parse(&rootCert, Uint8::to_const_uchar(rootCertificate), rootCertificateLen); + VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kRootFormatInvalid, error = CHIP_ERROR_INTERNAL)); + + /* Verify the chain against the root */ + mbedResult = mbedtls_x509_crt_verify(&certChain, &rootCert, NULL, NULL, &flags, NULL, NULL); + + switch (mbedResult) + { + case 0: + VerifyOrExit(flags == 0, (result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kSuccess; + break; + case MBEDTLS_ERR_X509_CERT_VERIFY_FAILED: + result = CertificateChainValidationResult::kChainInvalid; + error = CHIP_ERROR_CERT_NOT_TRUSTED; + break; + default: + SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + } + +exit: + _log_mbedTLS_error(mbedResult); + mbedtls_x509_crt_free(&certChain); + mbedtls_x509_crt_free(&rootCert); + +#else + (void) rootCertificate; + (void) rootCertificateLen; + (void) caCertificate; + (void) caCertificateLen; + (void) leafCertificate; + (void) leafCertificateLen; + (void) result; + CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) + + return error; +} + +inline bool IsTimeGreaterThanEqual(const mbedtls_x509_time * const timeA, const mbedtls_x509_time * const timeB) +{ + + // checks if two values are different and if yes, then returns first > second. +#define RETURN_STRICTLY_GREATER_IF_DIFFERENT(component) \ + { \ + auto valueA = timeA->CHIP_CRYPTO_PAL_PRIVATE_X509(component); \ + auto valueB = timeB->CHIP_CRYPTO_PAL_PRIVATE_X509(component); \ + \ + if (valueA != valueB) \ + { \ + return valueA > valueB; \ + } \ + } + + RETURN_STRICTLY_GREATER_IF_DIFFERENT(year); + RETURN_STRICTLY_GREATER_IF_DIFFERENT(mon); + RETURN_STRICTLY_GREATER_IF_DIFFERENT(day); + RETURN_STRICTLY_GREATER_IF_DIFFERENT(hour); + RETURN_STRICTLY_GREATER_IF_DIFFERENT(min); + RETURN_STRICTLY_GREATER_IF_DIFFERENT(sec); + + // all above are equal + return true; +} + +CHIP_ERROR IsCertificateValidAtIssuance(const ByteSpan & referenceCertificate, const ByteSpan & toBeEvaluatedCertificate) +{ +#if defined(MBEDTLS_X509_CRT_PARSE_C) + CHIP_ERROR error = CHIP_NO_ERROR; + mbedtls_x509_crt mbedReferenceCertificate; + mbedtls_x509_crt mbedToBeEvaluatedCertificate; + mbedtls_x509_time refNotBeforeTime; + mbedtls_x509_time tbeNotBeforeTime; + mbedtls_x509_time tbeNotAfterTime; + int result; + + VerifyOrReturnError(!referenceCertificate.empty() && !toBeEvaluatedCertificate.empty(), CHIP_ERROR_INVALID_ARGUMENT); + + mbedtls_x509_crt_init(&mbedReferenceCertificate); + mbedtls_x509_crt_init(&mbedToBeEvaluatedCertificate); + + result = mbedtls_x509_crt_parse(&mbedReferenceCertificate, Uint8::to_const_uchar(referenceCertificate.data()), + referenceCertificate.size()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + result = mbedtls_x509_crt_parse(&mbedToBeEvaluatedCertificate, Uint8::to_const_uchar(toBeEvaluatedCertificate.data()), + toBeEvaluatedCertificate.size()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + refNotBeforeTime = mbedReferenceCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_from); + tbeNotBeforeTime = mbedToBeEvaluatedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_from); + tbeNotAfterTime = mbedToBeEvaluatedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_to); + + // check if referenceCertificate is issued at or after tbeCertificate's notBefore timestamp + VerifyOrExit(IsTimeGreaterThanEqual(&refNotBeforeTime, &tbeNotBeforeTime), error = CHIP_ERROR_CERT_EXPIRED); + + // check if referenceCertificate is issued at or before tbeCertificate's notAfter timestamp + VerifyOrExit(IsTimeGreaterThanEqual(&tbeNotAfterTime, &refNotBeforeTime), error = CHIP_ERROR_CERT_EXPIRED); + +exit: + _log_mbedTLS_error(result); + mbedtls_x509_crt_free(&mbedReferenceCertificate); + mbedtls_x509_crt_free(&mbedToBeEvaluatedCertificate); + +#else + (void) referenceCertificate; + (void) toBeEvaluatedCertificate; + CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) + + return error; +} + +CHIP_ERROR IsCertificateValidAtCurrentTime(const ByteSpan & certificate) +{ +#if defined(MBEDTLS_X509_CRT_PARSE_C) + CHIP_ERROR error = CHIP_NO_ERROR; + mbedtls_x509_crt mbedCertificate; + int result; + + VerifyOrReturnError(!certificate.empty(), CHIP_ERROR_INVALID_ARGUMENT); + + mbedtls_x509_crt_init(&mbedCertificate); + + result = mbedtls_x509_crt_parse(&mbedCertificate, Uint8::to_const_uchar(certificate.data()), certificate.size()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + // check if certificate's notBefore timestamp is earlier than or equal to current time. + result = mbedtls_x509_time_is_past(&mbedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_from)); + VerifyOrExit(result == 1, error = CHIP_ERROR_CERT_EXPIRED); + + // check if certificate's notAfter timestamp is later than current time. + result = mbedtls_x509_time_is_future(&mbedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_to)); + VerifyOrExit(result == 1, error = CHIP_ERROR_CERT_EXPIRED); + +exit: + _log_mbedTLS_error(result); + mbedtls_x509_crt_free(&mbedCertificate); + +#else + (void) certificate; + CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) + + return error; +} + +CHIP_ERROR ExtractPubkeyFromX509Cert(const ByteSpan & certificate, Crypto::P256PublicKey & pubkey) +{ +#if defined(MBEDTLS_X509_CRT_PARSE_C) + CHIP_ERROR error = CHIP_NO_ERROR; + mbedtls_x509_crt mbed_cert; + mbedtls_ecp_keypair * keypair = nullptr; + size_t pubkey_size = 0; + + mbedtls_x509_crt_init(&mbed_cert); + + int result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(certificate.data()), certificate.size()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + VerifyOrExit(mbedtls_pk_get_type(&(mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(pk))) == MBEDTLS_PK_ECKEY, + error = CHIP_ERROR_INVALID_ARGUMENT); + + keypair = mbedtls_pk_ec(mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(pk)); + VerifyOrExit(keypair->CHIP_CRYPTO_PAL_PRIVATE(grp).id == MapECPGroupId(pubkey.Type()), error = CHIP_ERROR_INVALID_ARGUMENT); + // Copy the public key from the cert in raw point format + result = + mbedtls_ecp_point_write_binary(&keypair->CHIP_CRYPTO_PAL_PRIVATE(grp), &keypair->CHIP_CRYPTO_PAL_PRIVATE(Q), + MBEDTLS_ECP_PF_UNCOMPRESSED, &pubkey_size, Uint8::to_uchar(pubkey.Bytes()), pubkey.Length()); + + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(pubkey_size == pubkey.Length(), error = CHIP_ERROR_INTERNAL); + +exit: + _log_mbedTLS_error(result); + mbedtls_x509_crt_free(&mbed_cert); + +#else + (void) certificate; + (void) pubkey; + CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) + + return error; +} + +namespace { + +CHIP_ERROR ExtractKIDFromX509Cert(bool extractSKID, const ByteSpan & certificate, MutableByteSpan & kid) +{ +#if defined(MBEDTLS_X509_CRT_PARSE_C) + CHIP_ERROR error = CHIP_NO_ERROR; + mbedtls_x509_crt mbed_cert; + unsigned char * p; + const unsigned char * end; + size_t len; + + constexpr uint8_t sOID_Extension_SubjectKeyIdentifier[] = { 0x55, 0x1D, 0x0E }; + constexpr uint8_t sOID_Extension_AuthorityKeyIdentifier[] = { 0x55, 0x1D, 0x23 }; + + mbedtls_x509_crt_init(&mbed_cert); + + int result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(certificate.data()), certificate.size()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + // TODO: The mbedTLS team is working on supporting SKID and AKID extensions processing. + // Once it is supported, this code should be updated. + + p = mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(p); + end = mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(p) + + mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(len); + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + + while (p < end) + { + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OID); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + + bool extractCurrentExtSKID = extractSKID && (sizeof(sOID_Extension_SubjectKeyIdentifier) == len) && + (memcmp(p, sOID_Extension_SubjectKeyIdentifier, len) == 0); + bool extractCurrentExtAKID = !extractSKID && (sizeof(sOID_Extension_AuthorityKeyIdentifier) == len) && + (memcmp(p, sOID_Extension_AuthorityKeyIdentifier, len) == 0); + p += len; + + int is_critical = 0; + result = mbedtls_asn1_get_bool(&p, end, &is_critical); + VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_WRONG_CERT_TYPE); + + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OCTET_STRING); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + + if (extractCurrentExtSKID || extractCurrentExtAKID) + { + if (extractCurrentExtSKID) + { + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OCTET_STRING); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + } + else + { + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONTEXT_SPECIFIC); + VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); + // Other optional fields, authorityCertIssuer and authorityCertSerialNumber, + // will be skipped if present. + } + VerifyOrExit(len == kSubjectKeyIdentifierLength, error = CHIP_ERROR_WRONG_CERT_TYPE); + VerifyOrExit(len <= kid.size(), error = CHIP_ERROR_BUFFER_TOO_SMALL); + memcpy(kid.data(), p, len); + if (kid.size() > len) + { + kid.reduce_size(len); + } + break; + } + p += len; + } + +exit: + _log_mbedTLS_error(result); + mbedtls_x509_crt_free(&mbed_cert); + +#else + (void) certificate; + (void) kid; + CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) + + return error; +} + +} // namespace + +CHIP_ERROR ExtractSKIDFromX509Cert(const ByteSpan & certificate, MutableByteSpan & skid) +{ + return ExtractKIDFromX509Cert(true, certificate, skid); +} + +CHIP_ERROR ExtractAKIDFromX509Cert(const ByteSpan & certificate, MutableByteSpan & akid) +{ + return ExtractKIDFromX509Cert(false, certificate, akid); +} + +CHIP_ERROR ExtractVIDPIDFromX509Cert(const ByteSpan & certificate, AttestationCertVidPid & vidpid) +{ +#if defined(MBEDTLS_X509_CRT_PARSE_C) + constexpr uint8_t sOID_AttributeType_CommonName[] = { 0x55, 0x04, 0x03 }; + constexpr uint8_t sOID_AttributeType_MatterVendorId[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xA2, 0x7C, 0x02, 0x01 }; + constexpr uint8_t sOID_AttributeType_MatterProductId[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xA2, 0x7C, 0x02, 0x02 }; + + CHIP_ERROR error = CHIP_NO_ERROR; + mbedtls_x509_crt mbed_cert; + mbedtls_asn1_named_data * dnIterator = nullptr; + AttestationCertVidPid vidpidFromCN; + + mbedtls_x509_crt_init(&mbed_cert); + + int result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(certificate.data()), certificate.size()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + for (dnIterator = &mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(subject); dnIterator != nullptr; + dnIterator = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(next)) + { + size_t oid_len = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(oid).CHIP_CRYPTO_PAL_PRIVATE_X509(len); + uint8_t * oid_p = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(oid).CHIP_CRYPTO_PAL_PRIVATE_X509(p); + size_t val_len = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(val).CHIP_CRYPTO_PAL_PRIVATE_X509(len); + uint8_t * val_p = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(val).CHIP_CRYPTO_PAL_PRIVATE_X509(p); + + if (oid_p != nullptr && val_p != nullptr) + { + DNAttrType attrType = DNAttrType::kUnspecified; + if ((oid_len == sizeof(sOID_AttributeType_CommonName)) && (memcmp(sOID_AttributeType_CommonName, oid_p, oid_len) == 0)) + { + attrType = DNAttrType::kCommonName; + } + else if ((oid_len == sizeof(sOID_AttributeType_MatterVendorId)) && + (memcmp(sOID_AttributeType_MatterVendorId, oid_p, oid_len) == 0)) + { + attrType = DNAttrType::kMatterVID; + } + else if ((oid_len == sizeof(sOID_AttributeType_MatterProductId)) && + (memcmp(sOID_AttributeType_MatterProductId, oid_p, oid_len) == 0)) + { + attrType = DNAttrType::kMatterPID; + } + + error = ExtractVIDPIDFromAttributeString(attrType, ByteSpan(val_p, val_len), vidpid, vidpidFromCN); + SuccessOrExit(error); + } + } + + // If Matter Attributes were not found use values extracted from the CN Attribute, + // which might be uninitialized as well. + if (!vidpid.Initialized()) + { + vidpid = vidpidFromCN; + } + +exit: + _log_mbedTLS_error(result); + mbedtls_x509_crt_free(&mbed_cert); + +#else + (void) certificate; + (void) vidpid; + CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; +#endif // defined(MBEDTLS_X509_CRT_PARSE_C) + + return error; +} + +} // namespace Crypto +} // namespace chip diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index f06c36a0c61c6c..59b11d1e34a681 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -44,13 +44,6 @@ #include #include -#if defined(MBEDTLS_USE_TINYCRYPT) -#include -#include -#include -#include -#endif // defined(MBEDTLS_USE_TINYCRYPT) - #include #include #include @@ -93,11 +86,7 @@ static EntropyContext gsEntropyContext; static void _log_mbedTLS_error(int error_code) { -#if defined(MBEDTLS_USE_TINYCRYPT) - if (error_code != 0 && error_code != UECC_SUCCESS) -#else if (error_code != 0) -#endif { #if defined(MBEDTLS_ERROR_C) char error_str[MAX_ERROR_STR_LEN]; @@ -496,24 +485,6 @@ static int CryptoRNG(void * ctxt, uint8_t * out_buffer, size_t out_length) return (chip::Crypto::DRBG_get_bytes(out_buffer, out_length) == CHIP_NO_ERROR) ? 0 : 1; } -#if defined(MBEDTLS_USE_TINYCRYPT) - -static int uecc_rng_wrapper(uint8_t * dest, unsigned int size) -{ - int ret; - - ret = CryptoRNG(NULL, dest, size); - - return (ret == 0) ? size : 0; -} - -static int uECC_is_rng_set(void) -{ - return (uecc_rng_wrapper == uECC_get_rng()) ? 1 : 0; -} - -#endif - mbedtls_ecp_group_id MapECPGroupId(SupportedECPKeyTypes keyType) { switch (keyType) @@ -525,20 +496,6 @@ mbedtls_ecp_group_id MapECPGroupId(SupportedECPKeyTypes keyType) } } -#if defined(MBEDTLS_USE_TINYCRYPT) - -static inline mbedtls_uecc_keypair * to_keypair(P256KeypairContext * context) -{ - return SafePointerCast(context); -} - -static inline const mbedtls_uecc_keypair * to_const_keypair(const P256KeypairContext * context) -{ - return SafePointerCast(context); -} - -#else - static inline mbedtls_ecp_keypair * to_keypair(P256KeypairContext * context) { return SafePointerCast(context); @@ -549,8 +506,6 @@ static inline const mbedtls_ecp_keypair * to_const_keypair(const P256KeypairCont return SafePointerCast(context); } -#endif - CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { VerifyOrReturnError(mInitialized, CHIP_ERROR_INCORRECT_STATE); @@ -560,24 +515,9 @@ CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_len memset(&digest[0], 0, sizeof(digest)); ReturnErrorOnFailure(Hash_SHA256(msg, msg_length, &digest[0])); -#if defined(MBEDTLS_USE_TINYCRYPT) - CHIP_ERROR error = CHIP_NO_ERROR; - int result = UECC_FAILURE; - - const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); - - result = uECC_sign(keypair->private_key, digest, sizeof(digest), out_signature.Bytes()); - - VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(out_signature.SetLength(kP256_ECDSA_Signature_Length_Raw) == CHIP_NO_ERROR, error = CHIP_ERROR_INTERNAL); - - keypair = nullptr; - -exit: - return error; -#elif defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; + int result = 0; mbedtls_mpi r, s; mbedtls_mpi_init(&r); mbedtls_mpi_init(&s); @@ -638,29 +578,13 @@ CHIP_ERROR P256PublicKey::ECDSA_validate_msg_signature(const uint8_t * msg, cons CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, const size_t hash_length, const P256ECDSASignature & signature) const { -#if defined(MBEDTLS_USE_TINYCRYPT) - VerifyOrReturnError(hash != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(hash_length == kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(signature.Length() == kP256_ECDSA_Signature_Length_Raw, CHIP_ERROR_INVALID_ARGUMENT); - - CHIP_ERROR error = CHIP_NO_ERROR; - int result = UECC_FAILURE; - - const uint8_t * public_key = *this; - - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - result = uECC_verify(public_key + 1, hash, hash_length, Uint8::to_const_uchar(signature.ConstBytes())); - VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INVALID_SIGNATURE); - -exit: - return error; -#elif defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) VerifyOrReturnError(hash != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(hash_length == kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(signature.Length() == kP256_ECDSA_Signature_Length_Raw, CHIP_ERROR_INVALID_ARGUMENT); CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; + int result = 0; mbedtls_mpi r, s; mbedtls_mpi_init(&r); @@ -712,26 +636,6 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k { #if defined(MBEDTLS_ECDH_C) -#if defined(MBEDTLS_USE_TINYCRYPT) - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - size_t secret_length = (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(); - - const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); - - VerifyOrExit(mInitialized, error = CHIP_ERROR_INCORRECT_STATE); - - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - result = uECC_shared_secret(remote_public_key.ConstBytes() + 1, keypair->private_key, Uint8::to_uchar(out_secret)); - VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - - SuccessOrExit(out_secret.SetLength(secret_length)); - -exit: - keypair = nullptr; - _log_mbedTLS_error(result); - return error; -#else CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; size_t secret_length = (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(); @@ -771,7 +675,6 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k mbedtls_ecp_point_free(&ecp_pubkey); _log_mbedTLS_error(result); return error; -#endif #else return CHIP_ERROR_NOT_IMPLEMENTED; @@ -811,34 +714,8 @@ bool IsBufferContentEqualConstantTime(const void * a, const void * b, size_t n) CHIP_ERROR P256Keypair::Initialize() { -#if defined(MBEDTLS_USE_TINYCRYPT) - CHIP_ERROR error = CHIP_NO_ERROR; - int result = UECC_FAILURE; - - Clear(); - - mbedtls_uecc_keypair * keypair = to_keypair(&mKeypair); - if (!uECC_is_rng_set()) - { - uECC_set_rng(&uecc_rng_wrapper); - } - - result = uECC_make_key(keypair->public_key, keypair->private_key); - VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - Uint8::to_uchar(mPublicKey)[0] = 0x04; - memcpy(Uint8::to_uchar(mPublicKey) + 1, keypair->public_key, 2 * NUM_ECC_BYTES); - - keypair = nullptr; - mInitialized = true; - -exit: - _log_mbedTLS_error(result); - return error; -#else CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; + int result = 0; size_t pubkey_size = 0; @@ -858,7 +735,7 @@ CHIP_ERROR P256Keypair::Initialize() VerifyOrExit(result == 0, error = CHIP_ERROR_INVALID_ARGUMENT); VerifyOrExit(pubkey_size == mPublicKey.Length(), error = CHIP_ERROR_INVALID_ARGUMENT); - keypair = nullptr; + keypair = nullptr; mInitialized = true; exit: @@ -870,42 +747,16 @@ CHIP_ERROR P256Keypair::Initialize() _log_mbedTLS_error(result); return error; -#endif } CHIP_ERROR P256Keypair::Serialize(P256SerializedKeypair & output) const { -#if defined(MBEDTLS_USE_TINYCRYPT) - const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); - size_t len = output.Length() == 0 ? output.Capacity() : output.Length(); - Encoding::BufferWriter bbuf(output, len); - uint8_t privkey[kP256_PrivateKey_Length]; - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - bbuf.Put(mPublicKey, mPublicKey.Length()); - - VerifyOrExit(bbuf.Available() == sizeof(privkey), error = CHIP_ERROR_INTERNAL); - VerifyOrExit(sizeof(keypair->private_key) <= bbuf.Available(), error = CHIP_ERROR_INTERNAL); - - memcpy(privkey, keypair->private_key, sizeof(privkey)); - - bbuf.Put(privkey, sizeof(privkey)); - VerifyOrExit(bbuf.Fit(), error = CHIP_ERROR_BUFFER_TOO_SMALL); - - output.SetLength(bbuf.Needed()); - -exit: - memset(privkey, 0, sizeof(privkey)); - _log_mbedTLS_error(result); - return error; -#else const mbedtls_ecp_keypair * keypair = to_const_keypair(&mKeypair); - size_t len = output.Length() == 0 ? output.Capacity() : output.Length(); + size_t len = output.Length() == 0 ? output.Capacity() : output.Length(); Encoding::BufferWriter bbuf(output, len); uint8_t privkey[kP256_PrivateKey_Length]; CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; + int result = 0; bbuf.Put(mPublicKey, mPublicKey.Length()); @@ -925,44 +776,13 @@ CHIP_ERROR P256Keypair::Serialize(P256SerializedKeypair & output) const ClearSecretData(privkey, sizeof(privkey)); _log_mbedTLS_error(result); return error; -#endif } CHIP_ERROR P256Keypair::Deserialize(P256SerializedKeypair & input) { -#if defined(MBEDTLS_USE_TINYCRYPT) - int result = 0; - CHIP_ERROR error = CHIP_NO_ERROR; - Encoding::BufferWriter bbuf(mPublicKey, mPublicKey.Length()); - - Clear(); - - mbedtls_uecc_keypair * keypair = to_keypair(&mKeypair); - if (!uECC_is_rng_set()) - { - uECC_set_rng(&uecc_rng_wrapper); - } - - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - memcpy(keypair->public_key, Uint8::to_uchar(input) + 1, 2 * NUM_ECC_BYTES); - memcpy(keypair->private_key, Uint8::to_uchar(input) + mPublicKey.Length(), NUM_ECC_BYTES); - - keypair = nullptr; - - VerifyOrExit(input.Length() == mPublicKey.Length() + kP256_PrivateKey_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - bbuf.Put((const uint8_t *) input, mPublicKey.Length()); - VerifyOrExit(bbuf.Fit(), error = CHIP_ERROR_NO_MEMORY); - - mInitialized = true; - - _log_mbedTLS_error(result); - -exit: - return error; -#else Encoding::BufferWriter bbuf(mPublicKey, mPublicKey.Length()); - int result = 0; + int result = 0; CHIP_ERROR error = CHIP_NO_ERROR; Clear(); @@ -993,22 +813,15 @@ CHIP_ERROR P256Keypair::Deserialize(P256SerializedKeypair & input) exit: _log_mbedTLS_error(result); return error; -#endif } void P256Keypair::Clear() { if (mInitialized) { -#if defined(MBEDTLS_USE_TINYCRYPT) - mbedtls_uecc_keypair * keypair = to_keypair(&mKeypair); - memset(keypair, 0, sizeof(mbedtls_uecc_keypair)); - mInitialized = false; -#else mbedtls_ecp_keypair * keypair = to_keypair(&mKeypair); mbedtls_ecp_keypair_free(keypair); mInitialized = false; -#endif } } @@ -1134,21 +947,6 @@ CHIP_ERROR VerifyCertificateSigningRequest(const uint8_t * csr_buf, size_t csr_l typedef struct Spake2p_Context { -#if defined(MBEDTLS_USE_TINYCRYPT) - const mbedtls_md_info_t * md_info; - uECC_word_t M[2 * NUM_ECC_WORDS]; - uECC_word_t N[2 * NUM_ECC_WORDS]; - uECC_word_t X[2 * NUM_ECC_WORDS]; - uECC_word_t Y[2 * NUM_ECC_WORDS]; - uECC_word_t L[2 * NUM_ECC_WORDS]; - uECC_word_t Z[2 * NUM_ECC_WORDS]; - uECC_word_t V[2 * NUM_ECC_WORDS]; - - uECC_word_t w0[NUM_ECC_WORDS]; - uECC_word_t w1[NUM_ECC_WORDS]; - uECC_word_t xy[NUM_ECC_WORDS]; - uECC_word_t tempbn[NUM_ECC_WORDS]; -#else mbedtls_ecp_group curve; const mbedtls_md_info_t * md_info; mbedtls_ecp_point M; @@ -1163,7 +961,6 @@ typedef struct Spake2p_Context mbedtls_mpi w1; mbedtls_mpi xy; mbedtls_mpi tempbn; -#endif } Spake2p_Context; static inline Spake2p_Context * to_inner_spake2p_context(Spake2pOpaqueContext * context) @@ -1180,27 +977,6 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) memset(context, 0, sizeof(Spake2p_Context)); -#if defined(MBEDTLS_USE_TINYCRYPT) - M = context->M; - N = context->N; - X = context->X; - Y = context->Y; - L = context->L; - V = context->V; - Z = context->Z; - - w0 = context->w0; - w1 = context->w1; - xy = context->xy; - tempbn = context->tempbn; - - G = curve_G; - - if (!uECC_is_rng_set()) - { - uECC_set_rng(&uecc_rng_wrapper); - } -#else mbedtls_ecp_group_init(&context->curve); result = mbedtls_ecp_group_load(&context->curve, MBEDTLS_ECP_DP_SECP256R1); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); @@ -1227,14 +1003,13 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) mbedtls_mpi_init(&context->w1); mbedtls_mpi_init(&context->xy); mbedtls_mpi_init(&context->tempbn); - w0 = &context->w0; - w1 = &context->w1; - xy = &context->xy; + w0 = &context->w0; + w1 = &context->w1; + xy = &context->xy; tempbn = &context->tempbn; - G = &context->curve.G; + G = &context->curve.G; order = &context->curve.N; -#endif return error; @@ -1249,22 +1024,6 @@ void Spake2p_P256_SHA256_HKDF_HMAC::Clear() VerifyOrReturn(state != CHIP_SPAKE2P_STATE::PREINIT); Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); -#if defined(MBEDTLS_USE_TINYCRYPT) - memset(&context->M, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->N, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->X, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->Y, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->L, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->Z, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->V, 0, 2 * NUM_ECC_WORDS * sizeof(uECC_word_t)); - - memset(&context->w0, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->w1, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->xy, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); - memset(&context->tempbn, 0, NUM_ECC_WORDS * sizeof(uECC_word_t)); - - G = NULL; -#else mbedtls_ecp_point_free(&context->M); mbedtls_ecp_point_free(&context->N); mbedtls_ecp_point_free(&context->X); @@ -1279,7 +1038,6 @@ void Spake2p_P256_SHA256_HKDF_HMAC::Clear() mbedtls_mpi_free(&context->tempbn); mbedtls_ecp_group_free(&context->curve); -#endif state = CHIP_SPAKE2P_STATE::PREINIT; } @@ -1318,18 +1076,11 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FELoad(const uint8_t * in, size_t in_l CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; -#if defined(MBEDTLS_USE_TINYCRYPT) - uECC_word_t tmp[2 * NUM_ECC_WORDS] = { 0 }; - uECC_vli_bytesToNative(tmp, in, NUM_ECC_BYTES); - - uECC_vli_mmod((uECC_word_t *) fe, tmp, curve_n); -#else result = mbedtls_mpi_read_binary((mbedtls_mpi *) fe, Uint8::to_const_uchar(in), in_len); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); result = mbedtls_mpi_mod_mpi((mbedtls_mpi *) fe, (mbedtls_mpi *) fe, (const mbedtls_mpi *) order); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); -#endif exit: _log_mbedTLS_error(result); @@ -1338,14 +1089,10 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FELoad(const uint8_t * in, size_t in_l CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEWrite(const void * fe, uint8_t * out, size_t out_len) { -#if defined(MBEDTLS_USE_TINYCRYPT) - uECC_vli_nativeToBytes(out, NUM_ECC_BYTES, (const unsigned int *) fe); -#else if (mbedtls_mpi_write_binary((const mbedtls_mpi *) fe, Uint8::to_uchar(out), out_len) != 0) { return CHIP_ERROR_INTERNAL; } -#endif return CHIP_NO_ERROR; } @@ -1354,21 +1101,10 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEGenerate(void * fe) CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; -#if defined(MBEDTLS_USE_TINYCRYPT) - mbedtls_uecc_keypair keypair; - - result = UECC_FAILURE; - - result = uECC_make_key(keypair.public_key, keypair.private_key); - VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - - uECC_vli_bytesToNative((uECC_word_t *) fe, keypair.private_key, NUM_ECC_BYTES); -#else Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); result = mbedtls_ecp_gen_privkey(&context->curve, (mbedtls_mpi *) fe, CryptoRNG, nullptr); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); -#endif exit: _log_mbedTLS_error(result); @@ -1380,15 +1116,11 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEMul(void * fer, const void * fe1, co CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; -#if defined(MBEDTLS_USE_TINYCRYPT) - uECC_vli_modMult((uECC_word_t *) fer, (const uECC_word_t *) fe1, (const uECC_word_t *) fe2, (const uECC_word_t *) curve_n); -#else result = mbedtls_mpi_mul_mpi((mbedtls_mpi *) fer, (const mbedtls_mpi *) fe1, (const mbedtls_mpi *) fe2); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); result = mbedtls_mpi_mod_mpi((mbedtls_mpi *) fer, (mbedtls_mpi *) fer, (const mbedtls_mpi *) order); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); -#endif exit: _log_mbedTLS_error(result); @@ -1397,22 +1129,12 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEMul(void * fer, const void * fe1, co CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointLoad(const uint8_t * in, size_t in_len, void * R) { -#if defined(MBEDTLS_USE_TINYCRYPT) - uint8_t tmp[2 * NUM_ECC_BYTES]; - - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - memcpy(tmp, in + 1, 2 * NUM_ECC_BYTES); - - uECC_vli_bytesToNative((uECC_word_t *) R, tmp, NUM_ECC_BYTES); - uECC_vli_bytesToNative((uECC_word_t *) R + NUM_ECC_WORDS, tmp + NUM_ECC_BYTES, NUM_ECC_BYTES); -#else Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); if (mbedtls_ecp_point_read_binary(&context->curve, (mbedtls_ecp_point *) R, Uint8::to_const_uchar(in), in_len) != 0) { return CHIP_ERROR_INTERNAL; } -#endif return CHIP_NO_ERROR; } @@ -1421,12 +1143,6 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointWrite(const void * R, uint8_t * o { memset(out, 0, out_len); -#if defined(MBEDTLS_USE_TINYCRYPT) - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - out[0] = 0x04; - uECC_vli_nativeToBytes(out + 1, NUM_ECC_BYTES, (uECC_word_t *) R); - uECC_vli_nativeToBytes(out + NUM_ECC_BYTES + 1, NUM_ECC_BYTES, (uECC_word_t *) R + NUM_ECC_WORDS); -#else size_t mbedtls_out_len = out_len; Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); @@ -1436,22 +1152,16 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointWrite(const void * R, uint8_t * o { return CHIP_ERROR_INTERNAL; } -#endif return CHIP_NO_ERROR; } CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointMul(void * R, const void * P1, const void * fe1) { - -#if defined(MBEDTLS_USE_TINYCRYPT) - if (EccPoint_mult_safer((uECC_word_t *) R, (const uECC_word_t *) P1, (const uECC_word_t *) fe1) != UECC_SUCCESS) -#else Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); if (mbedtls_ecp_mul(&context->curve, (mbedtls_ecp_point *) R, (const mbedtls_mpi *) fe1, (const mbedtls_ecp_point *) P1, CryptoRNG, nullptr) != 0) -#endif { return CHIP_ERROR_INTERNAL; } @@ -1462,29 +1172,6 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointMul(void * R, const void * P1, co CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointAddMul(void * R, const void * P1, const void * fe1, const void * P2, const void * fe2) { -#if defined(MBEDTLS_USE_TINYCRYPT) - uECC_word_t R1[2 * NUM_ECC_WORDS]; - uECC_word_t R2[2 * NUM_ECC_WORDS]; - uECC_word_t z[NUM_ECC_WORDS]; - uint8_t ret = UECC_SUCCESS; - - if (EccPoint_mult_safer(R1, (const uECC_word_t *) P1, (const uECC_word_t *) fe1) != UECC_SUCCESS) - { - return CHIP_ERROR_INTERNAL; - } - - if (EccPoint_mult_safer(R2, (const uECC_word_t *) P2, (const uECC_word_t *) fe2) != UECC_SUCCESS) - { - return CHIP_ERROR_INTERNAL; - } - - uECC_vli_modSub(z, R2, R1, curve_p); - XYcZ_add(R1, R1 + NUM_ECC_WORDS, R2, R2 + NUM_ECC_WORDS); - uECC_vli_modInv(z, z, curve_p); - apply_z(R2, R2 + NUM_ECC_WORDS, z); - - memcpy((uECC_word_t *) R, R2, 2 * NUM_ECC_BYTES); -#else Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); if (mbedtls_ecp_muladd(&context->curve, (mbedtls_ecp_point *) R, (const mbedtls_mpi *) fe1, (const mbedtls_ecp_point *) P1, @@ -1492,27 +1179,19 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointAddMul(void * R, const void * P1, { return CHIP_ERROR_INTERNAL; } -#endif return CHIP_NO_ERROR; } CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointInvert(void * R) { -#if defined(MBEDTLS_USE_TINYCRYPT) - uECC_word_t tmp[NUM_ECC_WORDS] = { 0 }; - - uECC_vli_sub(tmp, curve_p, (uECC_word_t *) R + NUM_ECC_WORDS); - memcpy((uECC_word_t *) R + NUM_ECC_WORDS, tmp, NUM_ECC_BYTES); -#else - mbedtls_ecp_point * Rp = (mbedtls_ecp_point *) R; + mbedtls_ecp_point * Rp = (mbedtls_ecp_point *) R; Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); if (mbedtls_mpi_sub_mpi(&Rp->CHIP_CRYPTO_PAL_PRIVATE(Y), &context->curve.P, &Rp->CHIP_CRYPTO_PAL_PRIVATE(Y)) != 0) { return CHIP_ERROR_INTERNAL; } -#endif return CHIP_NO_ERROR; } @@ -1527,24 +1206,6 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::ComputeL(uint8_t * Lout, size_t * L_le CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; -#if defined(MBEDTLS_USE_TINYCRYPT) - result = UECC_SUCCESS; - uECC_word_t tmp[2 * NUM_ECC_WORDS]; - uECC_word_t w1_bn[NUM_ECC_WORDS]; - uECC_word_t L_tmp[2 * NUM_ECC_WORDS]; - - uECC_vli_bytesToNative(tmp, w1in, NUM_ECC_BYTES); - - uECC_vli_mmod(w1_bn, tmp, curve_n); - - result = EccPoint_mult_safer(L_tmp, curve_G, w1_bn); - VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - - // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed - Lout[0] = 0x04; - uECC_vli_nativeToBytes(Lout + 1, NUM_ECC_BYTES, L_tmp); - uECC_vli_nativeToBytes(Lout + NUM_ECC_BYTES + 1, NUM_ECC_BYTES, L_tmp + NUM_ECC_WORDS); -#else mbedtls_ecp_group curve; mbedtls_mpi w1_bn; mbedtls_ecp_point Ltemp; @@ -1569,28 +1230,21 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::ComputeL(uint8_t * Lout, size_t * L_le result = mbedtls_ecp_point_write_binary(&curve, &Ltemp, MBEDTLS_ECP_PF_UNCOMPRESSED, L_len, Uint8::to_uchar(Lout), *L_len); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); -#endif exit: _log_mbedTLS_error(result); -#if !defined(MBEDTLS_USE_TINYCRYPT) mbedtls_ecp_point_free(&Ltemp); mbedtls_mpi_free(&w1_bn); mbedtls_ecp_group_free(&curve); -#endif return error; } CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointIsValid(void * R) { -#if defined(MBEDTLS_USE_TINYCRYPT) - if (uECC_valid_point((const uECC_word_t *) R) != 0) -#else Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); if (mbedtls_ecp_check_pubkey(&context->curve, (mbedtls_ecp_point *) R) != 0) -#endif { return CHIP_ERROR_INTERNAL; } @@ -1634,7 +1288,7 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kRootFormatInvalid, error = CHIP_ERROR_INTERNAL)); /* Verify the chain against the root */ - mbedResult = mbedtls_x509_crt_verify(&certChain, &rootCert, NULL, NULL, &flags, NULL, NULL); + mbedResult = mbedtls_x509_crt_verify(&certChain, &rootCert, nullptr, nullptr, &flags, nullptr, nullptr); switch (mbedResult) { diff --git a/src/crypto/crypto.gni b/src/crypto/crypto.gni index 80d94e042224c7..c77f91a4823083 100644 --- a/src/crypto/crypto.gni +++ b/src/crypto/crypto.gni @@ -30,5 +30,5 @@ if (chip_crypto == "") { assert( chip_crypto == "mbedtls" || chip_crypto == "openssl" || - chip_crypto == "boringssl", - "Please select a valid crypto implementation: mbedtls, openssl, boringssl") + chip_crypto == "tinycrypt" || chip_crypto == "boringssl", + "Please select a valid crypto implementation: mbedtls, openssl, tinycrypt, boringssl") diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index e4dfadf90d0544..cd23e90e68d856 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -22492,7 +22492,6 @@ typedef NS_ENUM(uint8_t, MTROperationalCredentialsOperationalCertStatus) { MTROperationalCredentialsOperationalCertStatusMissingCsr = 0x04, MTROperationalCredentialsOperationalCertStatusTableFull = 0x05, MTROperationalCredentialsOperationalCertStatusInvalidAdminSubject = 0x06, - MTROperationalCredentialsOperationalCertStatusInsufficientPrivilege = 0x08, MTROperationalCredentialsOperationalCertStatusFabricConflict = 0x09, MTROperationalCredentialsOperationalCertStatusLabelConflict = 0x0A, MTROperationalCredentialsOperationalCertStatusInvalidFabricIndex = 0x0B, diff --git a/src/include/platform/NetworkCommissioning.h b/src/include/platform/NetworkCommissioning.h index 589f1d17a61dfb..5880ec56658fca 100644 --- a/src/include/platform/NetworkCommissioning.h +++ b/src/include/platform/NetworkCommissioning.h @@ -135,7 +135,7 @@ class BaseDriver public: /** * @brief Callback for the network driver pushing the event of network status change to the network commissioning cluster. - * The platforms is explected to push the status from operations such as autonomous connection after loss of connectivity or + * The platforms is expected to push the status from operations such as autonomous connection after loss of connectivity or * during initial establishment. * * This function must be called in a thread-safe manner with CHIP stack. diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index 0626daf57ca137..5cf4821b7bf1a4 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -78,6 +78,7 @@ static void HandleNodeResolve(void * context, DnssdService * result, const Span< FillNodeDataFromTxt(key, val, nodeData.commissionData); } + nodeData.LogDetail(); proxy->OnNodeDiscovered(nodeData); proxy->Release(); } diff --git a/src/lib/dnssd/Resolver.h b/src/lib/dnssd/Resolver.h index 356fdf92f360e8..140a71617645b5 100644 --- a/src/lib/dnssd/Resolver.h +++ b/src/lib/dnssd/Resolver.h @@ -125,6 +125,7 @@ struct CommonResolutionData { ChipLogDetail(Discovery, "\tMrp Interval active: not present"); } + ChipLogDetail(Discovery, "\tTCP Supported: %d", supportsTcp); } }; @@ -243,6 +244,7 @@ struct DiscoveredNodeData void LogDetail() const { + ChipLogDetail(Discovery, "Discovered node:"); resolutionData.LogDetail(); commissionData.LogDetail(); } diff --git a/src/lib/shell/streamer_k32w.cpp b/src/lib/shell/streamer_k32w.cpp index ee0887766a8fb2..68523e7a2c44ff 100644 --- a/src/lib/shell/streamer_k32w.cpp +++ b/src/lib/shell/streamer_k32w.cpp @@ -28,7 +28,7 @@ #include #include "SerialManager.h" -extern uint8_t mOtSerMgrIfLog; +extern uint8_t gShellSerMgrIf; namespace chip { namespace Shell { @@ -48,7 +48,7 @@ ssize_t streamer_k32w_read(streamer_t * streamer, char * buffer, size_t length) uint16_t bytesRead = 0; (void) streamer; - Serial_Read(mOtSerMgrIfLog, (uint8_t *) buffer, length, &bytesRead); + Serial_Read(gShellSerMgrIf, (uint8_t *) buffer, length, &bytesRead); return bytesRead; } diff --git a/src/platform/Ameba/NetworkCommissioningDriver.h b/src/platform/Ameba/NetworkCommissioningDriver.h index 70708df983da45..0303642d3c6396 100644 --- a/src/platform/Ameba/NetworkCommissioningDriver.h +++ b/src/platform/Ameba/NetworkCommissioningDriver.h @@ -127,7 +127,6 @@ class AmebaWiFiDriver final : public WiFiDriver bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; ScanCallback * mpScanCallback; diff --git a/src/platform/Darwin/DnssdContexts.cpp b/src/platform/Darwin/DnssdContexts.cpp index 2699bec216983b..8a63a48752f8e1 100644 --- a/src/platform/Darwin/DnssdContexts.cpp +++ b/src/platform/Darwin/DnssdContexts.cpp @@ -262,7 +262,7 @@ RegisterContext::RegisterContext(const char * sType, DnssdPublishCallback cb, vo void RegisterContext::DispatchFailure(DNSServiceErrorType err) { - ChipLogError(DeviceLayer, "Register (%s)", Error::ToString(err)); + ChipLogError(Discovery, "Mdns: Register failure (%s)", Error::ToString(err)); callback(context, nullptr, CHIP_ERROR_INTERNAL); MdnsContexts::GetInstance().Remove(this); } @@ -283,7 +283,7 @@ BrowseContext::BrowseContext(void * cbContext, DnssdBrowseCallback cb, DnssdServ void BrowseContext::DispatchFailure(DNSServiceErrorType err) { - ChipLogError(DeviceLayer, "Browse (%s)", Error::ToString(err)); + ChipLogError(Discovery, "Mdns: Browse failure (%s)", Error::ToString(err)); callback(context, nullptr, 0, CHIP_ERROR_INTERNAL); MdnsContexts::GetInstance().Remove(this); } @@ -309,7 +309,7 @@ ResolveContext::~ResolveContext() void ResolveContext::DispatchFailure(DNSServiceErrorType err) { - ChipLogError(DeviceLayer, "Resolve (%s)", Error::ToString(err)); + ChipLogError(Discovery, "Mdns: Resolve failure (%s)", Error::ToString(err)); callback(context, nullptr, Span(), CHIP_ERROR_INTERNAL); MdnsContexts::GetInstance().Remove(this); } @@ -326,6 +326,7 @@ void ResolveContext::DispatchSuccess() continue; } + ChipLogDetail(Discovery, "Mdns: Resolve success on interface %" PRIu32, interface.first); callback(context, &interface.second.service, Span(ips.data(), ips.size()), CHIP_NO_ERROR); break; } @@ -342,7 +343,7 @@ CHIP_ERROR ResolveContext::OnNewAddress(uint32_t interfaceId, const struct socka #ifdef CHIP_DETAIL_LOGGING char addrStr[INET6_ADDRSTRLEN]; ip.ToString(addrStr, sizeof(addrStr)); - ChipLogDetail(DeviceLayer, "Mdns: %s interface: %" PRIu32 " ip:%s", __func__, interfaceId, addrStr); + ChipLogDetail(Discovery, "Mdns: %s interface: %" PRIu32 " ip:%s", __func__, interfaceId, addrStr); #endif // CHIP_DETAIL_LOGGING return CHIP_NO_ERROR; @@ -376,7 +377,7 @@ bool ResolveContext::HasAddress() void ResolveContext::OnNewInterface(uint32_t interfaceId, const char * fullname, const char * hostnameWithDomain, uint16_t port, uint16_t txtLen, const unsigned char * txtRecord) { - ChipLogDetail(DeviceLayer, "Mdns : %s hostname:%s fullname:%s interface: %" PRIu32, __func__, hostnameWithDomain, fullname, + ChipLogDetail(Discovery, "Mdns : %s hostname:%s fullname:%s interface: %" PRIu32, __func__, hostnameWithDomain, fullname, interfaceId); InterfaceInfo interface; diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp index 488998c8398d40..98fdd0e19d3b74 100644 --- a/src/platform/Darwin/DnssdImpl.cpp +++ b/src/platform/Darwin/DnssdImpl.cpp @@ -100,7 +100,7 @@ void LogOnFailure(const char * name, DNSServiceErrorType err) { if (kDNSServiceErr_NoError != err) { - ChipLogError(DeviceLayer, "%s (%s)", name, Error::ToString(err)); + ChipLogError(Discovery, "%s (%s)", name, Error::ToString(err)); } } @@ -165,7 +165,7 @@ namespace { static void OnRegister(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType err, const char * name, const char * type, const char * domain, void * context) { - ChipLogDetail(DeviceLayer, "Mdns: %s name: %s, type: %s, domain: %s, flags: %d", __func__, name, type, domain, flags); + ChipLogDetail(Discovery, "Mdns: %s name: %s, type: %s, domain: %s, flags: %d", __func__, name, type, domain, flags); auto sdCtx = reinterpret_cast(context); sdCtx->Finalize(err); @@ -174,7 +174,7 @@ static void OnRegister(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErr CHIP_ERROR Register(void * context, DnssdPublishCallback callback, uint32_t interfaceId, const char * type, const char * name, uint16_t port, ScopedTXTRecord & record) { - ChipLogProgress(DeviceLayer, "Publishing service %s on port %u with type: %s on interface id: %" PRIu32, name, port, type, + ChipLogProgress(Discovery, "Publishing service %s on port %u with type: %s on interface id: %" PRIu32, name, port, type, interfaceId); RegisterContext * sdCtx = nullptr; @@ -198,7 +198,7 @@ CHIP_ERROR Register(void * context, DnssdPublishCallback callback, uint32_t inte void OnBrowseAdd(BrowseContext * context, const char * name, const char * type, const char * domain, uint32_t interfaceId) { - ChipLogDetail(DeviceLayer, "Mdns: %s name: %s, type: %s, domain: %s, interface: %" PRIu32, __func__, name, type, domain, + ChipLogDetail(Discovery, "Mdns: %s name: %s, type: %s, domain: %s, interface: %" PRIu32, __func__, name, type, domain, interfaceId); VerifyOrReturn(strcmp(kLocalDot, domain) == 0); @@ -225,7 +225,7 @@ void OnBrowseAdd(BrowseContext * context, const char * name, const char * type, void OnBrowseRemove(BrowseContext * context, const char * name, const char * type, const char * domain, uint32_t interfaceId) { - ChipLogDetail(DeviceLayer, "Mdns: %s name: %s, type: %s, domain: %s, interface: %" PRIu32, __func__, name, type, domain, + ChipLogDetail(Discovery, "Mdns: %s name: %s, type: %s, domain: %s, interface: %" PRIu32, __func__, name, type, domain, interfaceId); VerifyOrReturn(strcmp(kLocalDot, domain) == 0); @@ -259,7 +259,7 @@ CHIP_ERROR Browse(void * context, DnssdBrowseCallback callback, uint32_t interfa auto sdCtx = chip::Platform::New(context, callback, protocol); VerifyOrReturnError(nullptr != sdCtx, CHIP_ERROR_NO_MEMORY); - ChipLogProgress(DeviceLayer, "Browsing for: %s", type); + ChipLogProgress(Discovery, "Browsing for: %s", type); DNSServiceRef sdRef; auto err = DNSServiceBrowse(&sdRef, kBrowseFlags, interfaceId, type, kLocalDot, OnBrowse, sdCtx); VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); @@ -329,7 +329,7 @@ static void OnResolve(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t inter static CHIP_ERROR Resolve(void * context, DnssdResolveCallback callback, uint32_t interfaceId, chip::Inet::IPAddressType addressType, const char * type, const char * name) { - ChipLogDetail(DeviceLayer, "Resolve type=%s name=%s interface=%" PRIu32, type, name, interfaceId); + ChipLogDetail(Discovery, "Resolve type=%s name=%s interface=%" PRIu32, type, name, interfaceId); auto sdCtx = chip::Platform::New(context, callback, addressType); VerifyOrReturnError(nullptr != sdCtx, CHIP_ERROR_NO_MEMORY); diff --git a/src/platform/EFR32/NetworkCommissioningWiFiDriver.h b/src/platform/EFR32/NetworkCommissioningWiFiDriver.h index 411de01e3d1637..d311b11dda43a7 100644 --- a/src/platform/EFR32/NetworkCommissioningWiFiDriver.h +++ b/src/platform/EFR32/NetworkCommissioningWiFiDriver.h @@ -134,9 +134,8 @@ class SlWiFiDriver final : public WiFiDriver bool StartScanWiFiNetworks(ByteSpan ssid); static void OnScanWiFiNetworkDone(wfx_wifi_scan_result_t * aScanResult); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); - WiFiNetwork mSavedNetwork = {}; - WiFiNetwork mStagingNetwork = {}; + WiFiNetwork mSavedNetwork = {}; + WiFiNetwork mStagingNetwork = {}; ScanCallback * mpScanCallback; ConnectCallback * mpConnectCallback; }; diff --git a/src/platform/ESP32/NetworkCommissioningDriver.h b/src/platform/ESP32/NetworkCommissioningDriver.h index d8d9288508e06c..d2c6bb160e745d 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.h +++ b/src/platform/ESP32/NetworkCommissioningDriver.h @@ -127,7 +127,6 @@ class ESPWiFiDriver final : public WiFiDriver bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; ScanCallback * mpScanCallback; diff --git a/src/platform/Linux/NetworkCommissioningDriver.h b/src/platform/Linux/NetworkCommissioningDriver.h index e0e522a29eff3e..1fbe4588fcf264 100644 --- a/src/platform/Linux/NetworkCommissioningDriver.h +++ b/src/platform/Linux/NetworkCommissioningDriver.h @@ -47,7 +47,7 @@ class LinuxScanResponseIterator : public Iterator private: size_t currentIterating = 0; - // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copiable. + // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copyable. std::vector * mpScanResponse; }; @@ -102,7 +102,6 @@ class LinuxWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; Optional mScanStatus; diff --git a/src/platform/P6/NetworkCommissioningDriver.h b/src/platform/P6/NetworkCommissioningDriver.h index e56967fff761b1..76a232213e92c2 100644 --- a/src/platform/P6/NetworkCommissioningDriver.h +++ b/src/platform/P6/NetworkCommissioningDriver.h @@ -133,7 +133,6 @@ class P6WiFiDriver final : public WiFiDriver bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; ScanCallback * mpScanCallback; diff --git a/src/platform/P6/OTAImageProcessorImpl.cpp b/src/platform/P6/OTAImageProcessorImpl.cpp index b6e3bc175fab4a..5ca1fa089e98ea 100644 --- a/src/platform/P6/OTAImageProcessorImpl.cpp +++ b/src/platform/P6/OTAImageProcessorImpl.cpp @@ -16,11 +16,16 @@ * limitations under the License. */ +#include "OTAImageProcessorImpl.h" #include +#include +#include +#include -#include "OTAImageProcessorImpl.h" +using namespace ::chip::DeviceLayer::Internal; namespace chip { +namespace DeviceLayer { #ifdef P6_OTA CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() @@ -99,6 +104,39 @@ CHIP_ERROR OTAImageProcessorImpl::ProcessBlock(ByteSpan & block) return CHIP_NO_ERROR; } +bool OTAImageProcessorImpl::IsFirstImageRun() +{ + OTARequestorInterface * requestor = GetRequestorInstance(); + ReturnErrorCodeIf(requestor == nullptr, false); + + uint32_t currentVersion; + ReturnErrorCodeIf(ConfigurationMgr().GetSoftwareVersion(currentVersion) != CHIP_NO_ERROR, false); + + ChipLogProgress(SoftwareUpdate, "%ld", currentVersion); + ChipLogProgress(SoftwareUpdate, "%ld", requestor->GetTargetVersion()); + + return ((requestor->GetCurrentUpdateState() == OTARequestorInterface::OTAUpdateStateEnum::kApplying) && + (requestor->GetTargetVersion() == currentVersion)); +} + +CHIP_ERROR OTAImageProcessorImpl::ConfirmCurrentImage() +{ + OTARequestorInterface * requestor = chip::GetRequestorInstance(); + if (requestor == nullptr) + { + return CHIP_ERROR_INTERNAL; + } + + uint32_t currentVersion; + ReturnErrorOnFailure(DeviceLayer::ConfigurationMgr().GetSoftwareVersion(currentVersion)); + if (currentVersion != requestor->GetTargetVersion()) + { + return CHIP_ERROR_INCORRECT_STATE; + } + + return CHIP_NO_ERROR; +} + void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) { auto * imageProcessor = reinterpret_cast(context); @@ -264,4 +302,5 @@ CHIP_ERROR OTAImageProcessorImpl::ReleaseBlock() } #endif // P6_OTA +} // namespace DeviceLayer } // namespace chip diff --git a/src/platform/P6/OTAImageProcessorImpl.h b/src/platform/P6/OTAImageProcessorImpl.h index 0f6a53fc7bd52a..4150565f8867ec 100644 --- a/src/platform/P6/OTAImageProcessorImpl.h +++ b/src/platform/P6/OTAImageProcessorImpl.h @@ -33,6 +33,7 @@ extern "C" { } namespace chip { +namespace DeviceLayer { class OTAImageProcessorImpl : public OTAImageProcessorInterface { @@ -43,8 +44,8 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface CHIP_ERROR Apply() override; CHIP_ERROR Abort() override; CHIP_ERROR ProcessBlock(ByteSpan & block) override; - bool IsFirstImageRun() override { return false; } - CHIP_ERROR ConfirmCurrentImage() override { return CHIP_NO_ERROR; } + bool IsFirstImageRun() override; + CHIP_ERROR ConfirmCurrentImage() override; void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; } @@ -80,5 +81,6 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface OTAImageHeaderParser mHeaderParser; }; +} // namespace DeviceLayer } // namespace chip #endif diff --git a/src/platform/Tizen/NetworkCommissioningDriver.h b/src/platform/Tizen/NetworkCommissioningDriver.h index d128b8ab04b40c..d998d76c6c7384 100644 --- a/src/platform/Tizen/NetworkCommissioningDriver.h +++ b/src/platform/Tizen/NetworkCommissioningDriver.h @@ -74,7 +74,6 @@ class TizenWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; }; diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index c5bfac61a21383..70090297551aa3 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -129,7 +129,6 @@ class BLWiFiDriver final : public WiFiDriver bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; ScanCallback * mpScanCallback; diff --git a/src/platform/mbed/NetworkCommissioningDriver.h b/src/platform/mbed/NetworkCommissioningDriver.h index 29c917c6b56888..82d83d73558417 100644 --- a/src/platform/mbed/NetworkCommissioningDriver.h +++ b/src/platform/mbed/NetworkCommissioningDriver.h @@ -143,7 +143,6 @@ class WiFiDriverImpl final : public WiFiDriver chip::DeviceLayer::Internal::WiFiAuthSecurityType NsapiToNetworkSecurity(nsapi_security_t nsapi_security); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; ScanCallback * mScanCallback; diff --git a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp index ce2c4a235cdaa8..f8e6518b2d466a 100644 --- a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp @@ -184,6 +184,7 @@ CHIP_ERROR BLEManagerImpl::_Init() VerifyOrExit(bleAppCreated == pdPASS, err = CHIP_ERROR_INCORRECT_STATE); /* BLE Radio Init */ + XCVR_TemperatureUpdate(BOARD_GetTemperature()); VerifyOrExit(XCVR_Init(BLE_MODE, DR_2MBPS) == gXcvrSuccess_c, err = CHIP_ERROR_INCORRECT_STATE); /* Create BLE Controller Task */ diff --git a/src/platform/nxp/k32w/k32w0/BUILD.gn b/src/platform/nxp/k32w/k32w0/BUILD.gn index dddeef7374b20a..e813d8253c48bd 100644 --- a/src/platform/nxp/k32w/k32w0/BUILD.gn +++ b/src/platform/nxp/k32w/k32w0/BUILD.gn @@ -47,8 +47,6 @@ static_library("k32w0") { "NFCManagerImpl.h", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", - "RamStorage.cpp", - "RamStorage.h", "ble_function_mux.c", ] diff --git a/src/platform/nxp/k32w/k32w0/K32W0Config.cpp b/src/platform/nxp/k32w/k32w0/K32W0Config.cpp index bab9d1eb2e618b..c22f4c5a862312 100644 --- a/src/platform/nxp/k32w/k32w0/K32W0Config.cpp +++ b/src/platform/nxp/k32w/k32w0/K32W0Config.cpp @@ -36,7 +36,8 @@ namespace chip { namespace DeviceLayer { namespace Internal { -static ramBufferDescriptor * ramDescr; +osaMutexId_t K32WConfig::pdmMutexHandle = NULL; +static ramBufferDescriptor * ramDescr = NULL; constexpr uint16_t kNvmIdChipConfigData = 0x5000; constexpr uint16_t kRamBufferInitialSize = 3072; @@ -47,6 +48,8 @@ CHIP_ERROR K32WConfig::Init() int pdmStatus; /* Initialise the Persistent Data Manager */ + pdmMutexHandle = OSA_MutexCreate(); + VerifyOrExit((NULL != pdmMutexHandle), err = CHIP_ERROR_NO_MEMORY); pdmStatus = PDM_Init(); SuccessOrExit(err = MapPdmInitStatus(pdmStatus)); @@ -57,9 +60,38 @@ CHIP_ERROR K32WConfig::Init() } exit: + if (err != CHIP_NO_ERROR) + { + if (pdmMutexHandle) + { + OSA_MutexDestroy(pdmMutexHandle); + } + if (ramDescr) + { + free(ramDescr); + } + } return err; } +void K32WConfig::MutexLock(osaMutexId_t mutexId, uint32_t millisec) +{ + osaStatus_t status = OSA_MutexLock(mutexId, millisec); + if (osaStatus_Success != status) + { + ChipLogProgress(DeviceLayer, "OSA mutex lock failed."); + } +} + +void K32WConfig::MutexUnlock(osaMutexId_t mutexId) +{ + osaStatus_t status = OSA_MutexUnlock(mutexId); + if (osaStatus_Success != status) + { + ChipLogProgress(DeviceLayer, "OSA mutex unlock failed."); + } +} + CHIP_ERROR K32WConfig::ReadConfigValue(Key key, bool & val) { CHIP_ERROR err; @@ -139,53 +171,119 @@ CHIP_ERROR K32WConfig::ReadConfigValueCounter(uint8_t counterIdx, uint32_t & val CHIP_ERROR K32WConfig::WriteConfigValue(Key key, bool val) { CHIP_ERROR err; - rsError status; PDM_teStatus pdmStatus; + rsError ramStatus = RS_ERROR_NONE; VerifyOrExit(ValidConfigKey(key), err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // Verify key id. - status = ramStorageSet(&ramDescr, key, (uint8_t *) &val, sizeof(bool)); - SuccessOrExit(err = MapRamStorageStatus(status)); + MutexLock(pdmMutexHandle, osaWaitForever_c); + + /* first delete all occurrences of "key" */ + ramStorageDelete(ramDescr, key, -1); + + /* resize RAM Buffer if needed */ + ramStatus = ramStorageResize(&ramDescr, key, (uint8_t *) &val, sizeof(bool)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* add to RAM buffer */ + ramStatus = ramStorageSet(ramDescr, key, (uint8_t *) &val, sizeof(bool)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* schedule flash writing */ + pdmStatus = PDM_eSaveRecordDataInIdleTask(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + SuccessOrExit(err = MapPdmStatus(pdmStatus)); + +exit: + MutexUnlock(pdmMutexHandle); + return err; +} + +CHIP_ERROR K32WConfig::WriteConfigValueSync(Key key, bool val) +{ + CHIP_ERROR err; + PDM_teStatus pdmStatus; + rsError ramStatus = RS_ERROR_NONE; + + VerifyOrExit(ValidConfigKey(key), err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // Verify key id. + MutexLock(pdmMutexHandle, osaWaitForever_c); + + /* first delete all occurrences of "key" */ + ramStorageDelete(ramDescr, key, -1); - pdmStatus = - PDM_eSaveRecordDataInIdleTask((uint16_t) kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + /* resize RAM Buffer if needed */ + ramStatus = ramStorageResize(&ramDescr, key, (uint8_t *) &val, sizeof(bool)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* add to RAM buffer */ + ramStatus = ramStorageSet(ramDescr, key, (uint8_t *) &val, sizeof(bool)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + // Interrupts are disabled to ensure there is no context switch during the actual + // writing, thus avoiding race conditions. + OSA_InterruptDisable(); + pdmStatus = PDM_eSaveRecordData(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + OSA_InterruptEnable(); SuccessOrExit(err = MapPdmStatus(pdmStatus)); + exit: + MutexUnlock(pdmMutexHandle); return err; } CHIP_ERROR K32WConfig::WriteConfigValue(Key key, uint32_t val) { CHIP_ERROR err; - rsError status; PDM_teStatus pdmStatus; + rsError ramStatus = RS_ERROR_NONE; VerifyOrExit(ValidConfigKey(key), err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // Verify key id. - status = ramStorageSet(&ramDescr, key, (uint8_t *) &val, sizeof(uint32_t)); - SuccessOrExit(err = MapRamStorageStatus(status)); + MutexLock(pdmMutexHandle, osaWaitForever_c); + + /* first delete all occurrences of "key" */ + ramStorageDelete(ramDescr, key, -1); - pdmStatus = - PDM_eSaveRecordDataInIdleTask((uint16_t) kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + /* resize RAM Buffer if needed */ + ramStatus = ramStorageResize(&ramDescr, key, (uint8_t *) &val, sizeof(uint32_t)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* add to RAM buffer */ + ramStatus = ramStorageSet(ramDescr, key, (uint8_t *) &val, sizeof(uint32_t)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* schedule flash writing */ + pdmStatus = PDM_eSaveRecordDataInIdleTask(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); SuccessOrExit(err = MapPdmStatus(pdmStatus)); exit: + MutexUnlock(pdmMutexHandle); return err; } CHIP_ERROR K32WConfig::WriteConfigValue(Key key, uint64_t val) { CHIP_ERROR err; - rsError status; PDM_teStatus pdmStatus; + rsError ramStatus = RS_ERROR_NONE; VerifyOrExit(ValidConfigKey(key), err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // Verify key id. - status = ramStorageSet(&ramDescr, key, (uint8_t *) &val, sizeof(uint64_t)); - SuccessOrExit(err = MapRamStorageStatus(status)); + MutexLock(pdmMutexHandle, osaWaitForever_c); + + /* first delete all occurrences of "key" */ + ramStorageDelete(ramDescr, key, -1); + + /* resize RAM Buffer if needed */ + ramStatus = ramStorageResize(&ramDescr, key, (uint8_t *) &val, sizeof(uint64_t)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); - pdmStatus = - PDM_eSaveRecordDataInIdleTask((uint16_t) kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + /* add to RAM buffer */ + ramStatus = ramStorageSet(ramDescr, key, (uint8_t *) &val, sizeof(uint64_t)); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* schedule flash writing */ + pdmStatus = PDM_eSaveRecordDataInIdleTask(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); SuccessOrExit(err = MapPdmStatus(pdmStatus)); exit: + MutexUnlock(pdmMutexHandle); return err; } @@ -198,26 +296,35 @@ CHIP_ERROR K32WConfig::WriteConfigValueStr(Key key, const char * str, size_t str { CHIP_ERROR err; PDM_teStatus pdmStatus; - rsError status; + rsError ramStatus = RS_ERROR_NONE; VerifyOrExit(ValidConfigKey(key), err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // Verify key id. + MutexLock(pdmMutexHandle, osaWaitForever_c); - if (str != NULL) + if (!str) { - status = ramStorageSet(&ramDescr, key, (uint8_t *) str, strLen); - SuccessOrExit(err = MapRamStorageStatus(status)); - - pdmStatus = - PDM_eSaveRecordDataInIdleTask((uint16_t) kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); - SuccessOrExit(err = MapPdmStatus(pdmStatus)); + ramStatus = ramStorageDelete(ramDescr, key, -1); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); } else { - err = ClearConfigValue(key); - SuccessOrExit(err); + /* first delete all occurrences of "key" */ + ramStorageDelete(ramDescr, key, -1); + + /* resize RAM Buffer if needed */ + ramStatus = ramStorageResize(&ramDescr, key, (uint8_t *) str, strLen); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* add to RAM buffer */ + ramStatus = ramStorageSet(ramDescr, key, (uint8_t *) str, strLen); + SuccessOrExit(err = MapRamStorageStatus(ramStatus)); + + /* schedule flash writing */ + pdmStatus = PDM_eSaveRecordDataInIdleTask(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); } exit: + MutexUnlock(pdmMutexHandle); return err; } @@ -239,14 +346,15 @@ CHIP_ERROR K32WConfig::ClearConfigValue(Key key) PDM_teStatus pdmStatus; VerifyOrExit(ValidConfigKey(key), err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // Verify key id. - status = ramStorageDelete(ramDescr, key, 0); + MutexLock(pdmMutexHandle, osaWaitForever_c); + status = ramStorageDelete(ramDescr, key, -1); SuccessOrExit(err = MapRamStorageStatus(status)); - pdmStatus = - PDM_eSaveRecordDataInIdleTask((uint16_t) kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + pdmStatus = PDM_eSaveRecordDataInIdleTask(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); SuccessOrExit(err = MapPdmStatus(pdmStatus)); exit: + MutexUnlock(pdmMutexHandle); return err; } @@ -269,14 +377,18 @@ CHIP_ERROR K32WConfig::FactoryResetConfig(void) CHIP_ERROR err = CHIP_NO_ERROR; PDM_teStatus pdmStatus; + MutexLock(pdmMutexHandle, osaWaitForever_c); FactoryResetConfigInternal(kMinConfigKey_ChipConfig, kMaxConfigKey_ChipConfig); FactoryResetConfigInternal(kMinConfigKey_KVSKey, kMaxConfigKey_KVSKey); FactoryResetConfigInternal(kMinConfigKey_KVSValue, kMaxConfigKey_KVSValue); - pdmStatus = PDM_eSaveRecordData((uint16_t) kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); + pdmStatus = PDM_eSaveRecordData(kNvmIdChipConfigData, ramDescr, ramDescr->ramBufferLen + kRamDescHeaderSize); SuccessOrExit(err = MapPdmStatus(pdmStatus)); exit: + free((void *) ramDescr); + ramDescr = NULL; + MutexUnlock(pdmMutexHandle); return err; } @@ -284,7 +396,7 @@ void K32WConfig::FactoryResetConfigInternal(Key firstKey, Key lastKey) { for (Key key = firstKey; key <= lastKey; key++) { - ramStorageDelete(ramDescr, key, 0); + ramStorageDelete(ramDescr, key, -1); } } diff --git a/src/platform/nxp/k32w/k32w0/K32W0Config.h b/src/platform/nxp/k32w/k32w0/K32W0Config.h index 803149947a7a71..cc8919cf21ebb9 100644 --- a/src/platform/nxp/k32w/k32w0/K32W0Config.h +++ b/src/platform/nxp/k32w/k32w0/K32W0Config.h @@ -29,7 +29,9 @@ #include #include "PDM.h" -#include "RamStorage.h" +#include "fsl_os_abstraction.h" +#include "pdm_ram_storage_glue.h" +#include "ram_storage.h" namespace chip { namespace DeviceLayer { @@ -122,6 +124,7 @@ class K32WConfig static CHIP_ERROR ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen); static CHIP_ERROR ReadConfigValueCounter(uint8_t counterIdx, uint32_t & val); static CHIP_ERROR WriteConfigValue(Key key, bool val); + static CHIP_ERROR WriteConfigValueSync(Key key, bool val); static CHIP_ERROR WriteConfigValue(Key key, uint32_t val); static CHIP_ERROR WriteConfigValue(Key key, uint64_t val); static CHIP_ERROR WriteConfigValueStr(Key key, const char * str); @@ -135,6 +138,12 @@ class K32WConfig static void RunConfigUnitTest(void); + // Log error wrappers for OSA mutex lock/unlock. + static void MutexLock(osaMutexId_t mutexId, uint32_t millisec); + static void MutexUnlock(osaMutexId_t mutexId); + + static osaMutexId_t pdmMutexHandle; + protected: static constexpr uint8_t GetPDMId(uint32_t key); static constexpr uint8_t GetRecordKey(uint32_t key); diff --git a/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.cpp index 8cd1914211f121..f2fbd071bc3654 100644 --- a/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.cpp @@ -93,10 +93,14 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t { // This is the ID of the actual data pdmInternalId = chip::DeviceLayer::Internal::K32WConfigKey(pdmIdKvsValue, keyId); + ChipLogProgress(DeviceLayer, "KVS, get the value of Matter key [%s] with PDM id: %i", key, pdmInternalId); err = chip::DeviceLayer::Internal::K32WConfig::ReadConfigValueBin(pdmInternalId, (uint8_t *) value, value_size, read_bytes); *read_bytes_size = read_bytes; - - ChipLogProgress(DeviceLayer, "KVS, get Matter key [%s] with PDM id: %i", key, pdmInternalId); + } + else + { + ChipLogProgress(DeviceLayer, "KVS, error in getting the value of Matter key [%s]. Key not found in persistent storage.", + key); } exit: @@ -118,15 +122,9 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, keyId = GetStringKeyId(key, &freeKeyId); - // Key already exists - if (keyId < kMaxNumberOfKeys) - { - // Update just the value in this case - putKey = false; - } - else + // Key does not exist. Write both key and value in persistent storage. + if (kMaxNumberOfKeys == keyId) { - // Need to write both the value and the string key putKey = true; keyId = freeKeyId; } diff --git a/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.h b/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.h index 0b0a09178ed44d..df942779fe4bc2 100644 --- a/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.h +++ b/src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.h @@ -1,3 +1,4 @@ + /* * * Copyright (c) 2021 Project CHIP Authors diff --git a/src/platform/nxp/k32w/k32w0/Logging.cpp b/src/platform/nxp/k32w/k32w0/Logging.cpp index eca2baf51216c1..da545b6c7aff85 100644 --- a/src/platform/nxp/k32w/k32w0/Logging.cpp +++ b/src/platform/nxp/k32w/k32w0/Logging.cpp @@ -28,7 +28,6 @@ static constexpr uint8_t category_max_len_bytes = 3; #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD static bool isLogInitialized; -extern uint8_t gOtLogUartInstance; extern "C" uint32_t otPlatAlarmMilliGetNow(void); namespace chip { @@ -108,8 +107,7 @@ void ENFORCE_FORMAT(1, 0) GenericLog(const char * format, va_list arg, const cha if (!isLogInitialized) { - isLogInitialized = true; - gOtLogUartInstance = 0; + isLogInitialized = true; otPlatUartEnable(); } diff --git a/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp b/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp index 27deee3fece95f..a44d0cb1dfec6e 100644 --- a/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp @@ -83,7 +83,11 @@ void OTAImageProcessorImpl::TriggerNewRequestForData() { if (mDownloader) { + // The chip lock needs to be taken here to avoid having race conditions + // when trying to read attributes during OTA transfer. See https://github.com/project-chip/connectedhomeip/issues/18327 + PlatformMgr().LockChipStack(); this->mDownloader->FetchNextData(); + PlatformMgr().UnlockChipStack(); } } @@ -209,7 +213,7 @@ bool OTAImageProcessorImpl::IsFirstImageRun() { bool firstRun = false; - if (CHIP_NO_ERROR == (K32WConfig::ReadConfigValue(K32WConfig::kConfigKey_FirstRunOfOTAImage, firstRun))) + if (CHIP_NO_ERROR == K32WConfig::ReadConfigValue(K32WConfig::kConfigKey_FirstRunOfOTAImage, firstRun)) { return firstRun; } @@ -276,9 +280,7 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context) OTA_CommitImage(NULL); if (OTA_ImageAuthenticate() == gOtaImageAuthPass_c) { - - /* TODO internal: MATTER-126 */ - /*if (CHIP_NO_ERROR == K32WConfig::WriteConfigValue(K32WConfig::kConfigKey_FirstRunOfOTAImage, firstRun)) */ + if (CHIP_NO_ERROR == K32WConfig::WriteConfigValueSync(K32WConfig::kConfigKey_FirstRunOfOTAImage, firstRun)) { /* Set the necessary information to inform the SSBL that a new image is available */ DeviceLayer::ConfigurationMgr().StoreSoftwareVersion(imageProcessor->mSoftwareVersion); @@ -286,10 +288,14 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context) ChipLogProgress(SoftwareUpdate, "OTA image authentication success. Device will reboot with the new image!"); ResetMCU(); } + else + { + ChipLogProgress(SoftwareUpdate, "Failed to write kConfigKey_FirstRunOfOTAImage key."); + } } else { - ChipLogError(SoftwareUpdate, "Image authentication error"); + ChipLogError(SoftwareUpdate, "Image authentication error."); } } diff --git a/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp index 911b2e9ad73d71..4e7240c1f32202 100644 --- a/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp @@ -35,9 +35,12 @@ #include #endif +#if defined(MBEDTLS_USE_TINYCRYPT) +#include "ecc.h" +#endif + #include -#include "K32W061.h" #include "MemManager.h" #include "RNG_Interface.h" #include "TimersManager.h" @@ -49,6 +52,10 @@ namespace DeviceLayer { PlatformManagerImpl PlatformManagerImpl::sInstance; +#if defined(MBEDTLS_USE_TINYCRYPT) +osaMutexId_t PlatformManagerImpl::rngMutexHandle = NULL; +#endif + CHIP_ERROR PlatformManagerImpl::InitBoardFwk(void) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -93,6 +100,18 @@ static int app_entropy_source(void * data, unsigned char * output, size_t len, s return 0; } +#if defined(MBEDTLS_USE_TINYCRYPT) +int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size) +{ + int res; + OSA_MutexLock(rngMutexHandle, osaWaitForever_c); + res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0; + OSA_MutexUnlock(rngMutexHandle); + + return res; +} +#endif + CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) { uint32_t chipType; @@ -123,6 +142,13 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) err = chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16); SuccessOrExit(err); +#if defined(MBEDTLS_USE_TINYCRYPT) + /* Set RNG function for tinycrypt operations. */ + rngMutexHandle = OSA_MutexCreate(); + VerifyOrExit((NULL != rngMutexHandle), err = CHIP_ERROR_NO_MEMORY); + uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function); +#endif + // Call _InitChipStack() on the generic implementation base class // to finish the initialization process. err = Internal::GenericPlatformManagerImpl_FreeRTOS::_InitChipStack(); diff --git a/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.h b/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.h index 70ece1cdf11f3c..6e241c1dbd62b8 100644 --- a/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.h +++ b/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.h @@ -25,6 +25,7 @@ #pragma once +#include "fsl_os_abstraction.h" #include namespace chip { @@ -51,6 +52,17 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener System::Clock::Timestamp GetStartTime() { return mStartTime; } CHIP_ERROR InitBoardFwk(void); +#if defined(MBEDTLS_USE_TINYCRYPT) + // Since the RNG callback will be called from multiple threads, + // use this mutex to lock/unlock the call to Matter RNG API, which + // uses some global variables. + static osaMutexId_t rngMutexHandle; + // Callback used by tinycrypt to generate random numbers. + // It must be set before calling any sign operations, + // which are used in both Matter and OT threads. + static int uECC_RNG_Function(uint8_t * dest, unsigned int size); +#endif + private: // ===== Methods that implement the PlatformManager abstract interface. diff --git a/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h b/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h index a589a86223d16d..f7514dcb68bec9 100644 --- a/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h +++ b/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h @@ -37,7 +37,7 @@ struct ChipDeviceEvent; // ==================== Platform Adaptations ==================== #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 #define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * -#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 11 +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 7 // ========== Platform-specific Configuration Overrides ========= diff --git a/src/platform/nxp/k32w/k32w0/ThreadStackManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/ThreadStackManagerImpl.cpp index 7f5d4961ba41e4..78ccc1b9b0abf3 100644 --- a/src/platform/nxp/k32w/k32w0/ThreadStackManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/ThreadStackManagerImpl.cpp @@ -107,3 +107,8 @@ extern "C" void otPlatFree(void * aPtr) { return CHIPPlatformMemoryFree(aPtr); } + +extern "C" void * otPlatRealloc(void * p, size_t aSize) +{ + return CHIPPlatformMemoryRealloc(p, aSize); +} diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.cpp b/src/platform/qpg/DiagnosticDataProviderImpl.cpp index bde10b3cac0d71..e8b056879149df 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.cpp +++ b/src/platform/qpg/DiagnosticDataProviderImpl.cpp @@ -69,6 +69,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu return CHIP_NO_ERROR; } +CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() +{ + qvCHIP_ResetHeapStats(); + return CHIP_NO_ERROR; +} + DiagnosticDataProvider & GetDiagnosticDataProviderImpl() { return DiagnosticDataProviderImpl::GetDefaultInstance(); diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.h b/src/platform/qpg/DiagnosticDataProviderImpl.h index ab6e1ed09bb8d4..d4d0c47224b5f7 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.h +++ b/src/platform/qpg/DiagnosticDataProviderImpl.h @@ -39,9 +39,11 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider // ===== Methods that implement the PlatformManager abstract interface. + bool SupportsWatermarks() override { return true; } CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; + CHIP_ERROR ResetWatermarks() override; }; /** diff --git a/src/platform/webos/NetworkCommissioningDriver.h b/src/platform/webos/NetworkCommissioningDriver.h index 330f1b6d03295e..9a9dc45a73957f 100644 --- a/src/platform/webos/NetworkCommissioningDriver.h +++ b/src/platform/webos/NetworkCommissioningDriver.h @@ -47,7 +47,7 @@ class LinuxScanResponseIterator : public Iterator private: size_t currentIterating = 0; - // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copiable. + // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copyable. std::vector * mpScanResponse; }; @@ -102,7 +102,6 @@ class LinuxWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; Optional mScanStatus; diff --git a/src/setup_payload/Base38Decode.cpp b/src/setup_payload/Base38Decode.cpp index e2255335c2502e..3556182829e362 100644 --- a/src/setup_payload/Base38Decode.cpp +++ b/src/setup_payload/Base38Decode.cpp @@ -99,8 +99,8 @@ CHIP_ERROR base38Decode(std::string base38, std::vector & result) { result.clear(); - int base38CharactersNumber = static_cast(base38.length()); - int decodedBase38Characters = 0; + size_t base38CharactersNumber = base38.length(); + size_t decodedBase38Characters = 0; while (base38CharactersNumber > 0) { uint8_t base38CharactersInChunk; @@ -128,10 +128,10 @@ CHIP_ERROR base38Decode(std::string base38, std::vector & result) uint32_t value = 0; - for (int i = (base38CharactersInChunk - 1); i >= 0; i--) + for (size_t i = base38CharactersInChunk; i > 0; i--) { uint8_t v = 0; - CHIP_ERROR err = decodeChar(base38[static_cast(decodedBase38Characters + i)], v); + CHIP_ERROR err = decodeChar(base38[decodedBase38Characters + i - 1], v); if (err != CHIP_NO_ERROR) { @@ -143,7 +143,7 @@ CHIP_ERROR base38Decode(std::string base38, std::vector & result) decodedBase38Characters += base38CharactersInChunk; base38CharactersNumber -= base38CharactersInChunk; - for (int i = 0; i < bytesInDecodedChunk; i++) + for (size_t i = 0; i < bytesInDecodedChunk; i++) { result.push_back(static_cast(value)); value >>= 8; diff --git a/third_party/nxp/k32w0_sdk/BUILD.gn b/third_party/nxp/k32w0_sdk/BUILD.gn index f2307bafa95ca4..79d2e2a6ee1a6a 100644 --- a/third_party/nxp/k32w0_sdk/BUILD.gn +++ b/third_party/nxp/k32w0_sdk/BUILD.gn @@ -29,6 +29,13 @@ group("k32w0_sdk") { public_deps = [ k32w0_sdk_target ] } +if (chip_crypto == "tinycrypt") { + assert( + mbedtls_repo == + "//third_party/connectedhomeip/third_party/nxp/libs/mbedtls", + "mbedtls_repo must be set to nxp mbedtls-tinycrypt library when chip_crypto == \"tinycrypt\"") +} + config("mbedtls_k32w0_config") { defines = [ "MBEDTLS_CONFIG_FILE=", @@ -53,7 +60,7 @@ config("mbedtls_k32w0_config") { ] } - if (mbedtls_use_tinycrypt) { + if (chip_crypto == "tinycrypt") { defines += [ "MBEDTLS_USE_TINYCRYPT", "MBEDTLS_OPTIMIZE_TINYCRYPT_ASM", @@ -62,7 +69,7 @@ config("mbedtls_k32w0_config") { include_dirs = [ chip_root ] - if (mbedtls_use_tinycrypt) { + if (chip_crypto == "tinycrypt") { include_dirs += [ "${mbedtls_repo}/repo/include/tinycrypt" ] } } @@ -73,7 +80,7 @@ mbedtls_target("mbedtls") { "${k32w0_sdk_root}/middleware/mbedtls/port/ksdk/ksdk_mbedtls.c", ] - if (mbedtls_use_tinycrypt) { + if (chip_crypto == "tinycrypt") { sources += [ "${mbedtls_repo}/repo/tinycrypt/ecc.c", "${mbedtls_repo}/repo/tinycrypt/ecc_dh.c", diff --git a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni index a0aa55ada6b4be..d0aa619d6a6968 100644 --- a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni +++ b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni @@ -24,12 +24,19 @@ import("${chip_root}/src/platform/nxp/k32w/k32w0/args.gni") declare_args() { # Location of the k32w0 SDK. - k32w0_sdk_root = getenv("NXP_K32W061_SDK_ROOT") + k32w0_sdk_root = getenv("NXP_K32W0_SDK_ROOT") chip_with_DK6 = true chip_with_OM15082 = 0 chip_with_ot_cli = 0 chip_with_low_power = 0 - mbedtls_use_tinycrypt = false + build_for_k32w061 = 1 + build_for_k32w041am = 0 + build_for_k32w041a = 0 + build_for_k32w041 = 0 + device = "K32W061" + board = "k32w061dk6" + chip_with_ntag = 1 + chip_with_high_power = 0 } assert(k32w0_sdk_root != "", "k32w0_sdk_root must be specified") @@ -57,6 +64,54 @@ template("k32w0_sdk") { chip_with_ot_cli == 0 && chip_with_se05x == 0), "Please disable low power if expansion board, openthread CLI or SE is needed!") + if (build_for_k32w041am == 1 || build_for_k32w041a == 1 || + build_for_k32w041 == 1) { + build_for_k32w061 = 0 + } + + if (build_for_k32w061 == 1) { + assert(build_for_k32w061 == 1 && build_for_k32w041am == 0 && + build_for_k32w041a == 0 && build_for_k32w041 == 0, + "Please build for only one platform") + device = "K32W061" + board = "k32w061dk6" + chip_with_ntag = 1 + chip_with_high_power = 0 + } + if (build_for_k32w041am == 1) { + assert(build_for_k32w041am == 1 && build_for_k32w061 == 0 && + build_for_k32w041a == 0 && build_for_k32w041 == 0, + "Please build for only one platform") + device = "K32W041AM" + board = "k32w041amdk6" + chip_with_high_power = 1 + chip_with_ntag = 0 + } + if (build_for_k32w041a == 1) { + assert(build_for_k32w041a == 1 && build_for_k32w061 == 0 && + build_for_k32w041am == 0 && build_for_k32w041 == 0, + "Please build for only one platform") + device = "K32W041A" + board = "k32w041adk6" + chip_with_high_power = 1 + chip_with_ntag = 0 + } + if (build_for_k32w041 == 1) { + assert(build_for_k32w041 == 1 && build_for_k32w061 == 0 && + build_for_k32w041am == 0 && build_for_k32w041a == 0, + "Please build for only one platform") + device = "K32W041" + board = "k32w041dk6" + chip_with_ntag = 0 + chip_with_high_power = 0 + } + + print("device:", device) + print("board:", board) + print("ntag:", chip_with_ntag) + print("high power:", chip_with_high_power) + device_lowercase = string_replace(board, "dk6", "") + sdk_target_name = target_name config("${sdk_target_name}_config") { @@ -72,14 +127,23 @@ template("k32w0_sdk") { if (chip_with_DK6) { if (chip_with_low_power != 0) { - _sdk_include_dirs += [ "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/lped/bm" ] + _sdk_include_dirs += [ "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/lped/bm" ] } else { - _sdk_include_dirs += [ "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/reed/bm" ] + _sdk_include_dirs += [ "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/reed/bm" ] } } if (chip_with_low_power != 0) { - _sdk_include_dirs += [ "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common" ] + _sdk_include_dirs += [ "${k32w0_sdk_root}/boards/${board}/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common" ] + } + + if (chip_with_ntag != 0) { + _sdk_include_dirs += [ + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_I2C/inc", + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_NTAG/inc", + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/inc", + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_TMR/inc", + ] } _sdk_include_dirs += [ @@ -87,16 +151,12 @@ template("k32w0_sdk") { "${k32w0_sdk_root}/CMSIS/Include", "${k32w0_sdk_root}/components/serial_manager", "${k32w0_sdk_root}/components/uart", - "${k32w0_sdk_root}/devices/K32W061", - "${k32w0_sdk_root}/devices/K32W061/drivers", - "${k32w0_sdk_root}/devices/K32W061/utilities", - "${k32w0_sdk_root}/devices/K32W061/utilities/debug_console", - "${k32w0_sdk_root}/devices/K32W061/utilities/str", + "${k32w0_sdk_root}/devices/${device}", + "${k32w0_sdk_root}/devices/${device}/drivers", + "${k32w0_sdk_root}/devices/${device}/utilities", + "${k32w0_sdk_root}/devices/${device}/utilities/debug_console", + "${k32w0_sdk_root}/devices/${device}/utilities/str", "${k32w0_sdk_root}/middleware/mbedtls/port/ksdk", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_I2C/inc", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_NTAG/inc", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/inc", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_TMR/inc", "${k32w0_sdk_root}/middleware/wireless/ble_controller/interface", "${k32w0_sdk_root}/middleware/wireless/bluetooth/application/common", "${k32w0_sdk_root}/middleware/wireless/bluetooth/application/common/gatt_db", @@ -112,7 +172,7 @@ template("k32w0_sdk") { "${k32w0_sdk_root}/middleware/wireless/framework/Keyboard/Interface", "${k32w0_sdk_root}/middleware/wireless/framework/LED/Interface", "${k32w0_sdk_root}/middleware/wireless/framework/Lists", - "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Interface/k32w061dk6", + "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Interface/${board}", "${k32w0_sdk_root}/middleware/wireless/framework/MemManager/Interface", "${k32w0_sdk_root}/middleware/wireless/framework/Messaging/Interface", "${k32w0_sdk_root}/middleware/wireless/framework/ModuleInfo", @@ -137,9 +197,9 @@ template("k32w0_sdk") { ] libs = [ - "${k32w0_sdk_root}/middleware/wireless/ble_controller/lib/lib_ble_controller.a", - "${k32w0_sdk_root}//middleware/wireless/bluetooth/host/lib/lib_ble_5-0_host_peripheral_cm4_noFP.a", - "${k32w0_sdk_root}/middleware/wireless/ieee-802.15.4/lib/libMiniMac_Dynamic_MMAC.a", + "${k32w0_sdk_root}/middleware/wireless/ble_controller/lib/lib_ble_controller_peripheral_commissioning.a", + "${k32w0_sdk_root}//middleware/wireless/bluetooth/host/lib/lib_ble_5-0_host_matter_cm4_noFP.a", + "${k32w0_sdk_root}/middleware/wireless/ieee-802.15.4/lib/libMiniMac_Sched.a", "${k32w0_sdk_root}/middleware/wireless/framework/PDM/Library/libPDM_extFlash.a", "${k32w0_sdk_root}/middleware/wireless/framework/SecLib/lib_crypto_m4.a", "${k32w0_sdk_root}/middleware/wireless/framework/XCVR/lib/libRadio.a", @@ -148,18 +208,20 @@ template("k32w0_sdk") { defines = [ "gPWR_CpuClk_48MHz=1", "gMainThreadPriority_c=5", - "CPU_K32W061HN", "CPU_JN518X", "CPU_JN518X_REV=2", "JENNIC_CHIP_FAMILY_NAME=_JN518x", + "MAC_PROTO_TAG=1", + "JENNIC_CHIP_FAMILY_JN518x", "gPWR_LDOMEM_0_9V_PD=0", "SDK_DEBUGCONSOLE=DEBUGCONSOLE_REDIRECT_TO_SDK", + "PRINTF_ADVANCED_ENABLE", "NO_SYSCORECLK_UPD=0", "USE_RTOS=1", "USE_SDK_OSA=0", "gSerialManagerMaxInterfaces_c=2", "FSL_RTOS_FREE_RTOS=1", - "gTotalHeapSize_c=0xB000", + "gTotalHeapSize_c=0xC8BC", "gUartDebugConsole_d=1", "DEBUG_SERIAL_INTERFACE_INSTANCE=0", "APP_SERIAL_INTERFACE_INSTANCE=1", @@ -168,6 +230,7 @@ template("k32w0_sdk") { "gOtaEepromPostedOperations_d=1", "gOtaVerifyWrite_d=0", "gExternalFlashIsCiphered_d=1", + "PDM_USE_DYNAMIC_MEMORY=1", "gBootData_None_c=1", "PROGRAM_PAGE_SZ=256", "configFRTOS_MEMORY_SCHEME=4", @@ -220,6 +283,7 @@ template("k32w0_sdk") { "PDM_EXT_FLASH=1", "gEepromType_d=gEepromDevice_MX25R8035F_c", "gPdmNbSegments=63", + "gRadioUsePdm_d=1", ] if (chip_with_OM15082 != 0) { @@ -266,6 +330,34 @@ template("k32w0_sdk") { ] } + if (build_for_k32w061 == 1) { + defines += [ "CPU_K32W061HN" ] + } else if (build_for_k32w041am == 1) { + defines += [ "CPU_K32W041AMZ" ] + } else if (build_for_k32w041a == 1) { + defines += [ "CPU_K32W041AZ" ] + } else if (build_for_k32w041 == 1) { + defines += [ "CPU_K32W041HN" ] + } + + if (chip_with_high_power == 1) { + defines += [ + "K32WMCM_APP_BUILD", + "JENNIC_CHIP_FAMILY_JN518x", + ] + _sdk_include_dirs += [ + "${k32w0_sdk_root}/middleware/wireless/ieee-802.15.4/Include", + "${k32w0_sdk_root}/middleware/wireless/ieee-802.15.4/mMac/Include", + ] + } + + if (chip_with_ntag == 1) { + defines += [ + "CONFIG_CHIP_NFC_COMMISSIONING=1", + "CHIP_DEVICE_CONFIG_ENABLE_NFC=1", + ] + } + if (defined(invoker.defines)) { defines += invoker.defines } @@ -309,35 +401,31 @@ template("k32w0_sdk") { "${k32w0_sdk_root}/components/serial_manager/serial_manager.c", "${k32w0_sdk_root}/components/serial_manager/serial_port_uart.c", "${k32w0_sdk_root}/components/uart/usart_adapter.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_adc.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_aes.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_clock.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_common.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_ctimer.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_flash.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_flexcomm.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_fmeas.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_gpio.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_i2c.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_i2c_freertos.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_inputmux.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_ntag.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_pint.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_power.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_reset.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_rng.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_rtc.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_sha.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_spifi.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_usart.c", - "${k32w0_sdk_root}/devices/K32W061/drivers/fsl_wtimer.c", - "${k32w0_sdk_root}/devices/K32W061/mcuxpresso/startup_k32w061.c", - "${k32w0_sdk_root}/devices/K32W061/system_K32W061.c", - "${k32w0_sdk_root}/devices/K32W061/utilities/debug_console/fsl_debug_console.c", - "${k32w0_sdk_root}/devices/K32W061/utilities/str/fsl_str.c", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_I2C/i2c_jn_fsl.c", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_NTAG/ntag_driver.c", - "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_TMR/timer_driver_jn.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_adc.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_aes.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_clock.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_common.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_ctimer.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_flash.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_flexcomm.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_fmeas.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_gpio.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_i2c.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_i2c_freertos.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_inputmux.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_pint.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_power.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_reset.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_rng.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_rtc.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_sha.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_spifi.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_usart.c", + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_wtimer.c", + "${k32w0_sdk_root}/devices/${device}/mcuxpresso/startup_${device_lowercase}.c", + "${k32w0_sdk_root}/devices/${device}/system_${device}.c", + "${k32w0_sdk_root}/devices/${device}/utilities/debug_console/fsl_debug_console.c", + "${k32w0_sdk_root}/devices/${device}/utilities/str/fsl_str.c", "${k32w0_sdk_root}/middleware/wireless/ble_controller/config/controller_config.c", "${k32w0_sdk_root}/middleware/wireless/bluetooth/application/common/ble_conn_manager.c", "${k32w0_sdk_root}/middleware/wireless/bluetooth/application/common/ble_host_tasks.c", @@ -351,9 +439,9 @@ template("k32w0_sdk") { "${k32w0_sdk_root}/middleware/wireless/framework/LED/Source/LED.c", "${k32w0_sdk_root}/middleware/wireless/framework/Lists/GenericList.c", "${k32w0_sdk_root}/middleware/wireless/framework/Logging/Source/dbg_logging.c", - "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Source/k32w061dk6/PWR.c", - "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Source/k32w061dk6/PWRLib.c", - "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Source/k32w061dk6/PWR_setjmp.S", + "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Source/${board}/PWR.c", + "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Source/${board}/PWRLib.c", + "${k32w0_sdk_root}/middleware/wireless/framework/LowPower/Source/${board}/PWR_setjmp.S", "${k32w0_sdk_root}/middleware/wireless/framework/MemManager/Source/MemManager.c", "${k32w0_sdk_root}/middleware/wireless/framework/Messaging/Source/Messaging.c", "${k32w0_sdk_root}/middleware/wireless/framework/OSAbstraction/Source/fsl_os_abstraction_free_rtos.c", @@ -379,37 +467,36 @@ template("k32w0_sdk") { ] if (chip_with_DK6) { - if (chip_with_low_power != 0) { + sources += [ + "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/reed/bm/board.c", + "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/reed/bm/board_utility.c", + "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/reed/bm/hardware_init.c", + ] + + if (chip_with_se05x != 0) { sources += [ - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/lped/bm/board.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/lped/bm/board_utility.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/lped/bm/clock_config.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/lped/bm/hardware_init.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/lped/bm/pin_mux.c", + "${chip_root}/third_party/simw-top-mini/repo/demos/ksdk/common/boards/DK6/wireless_examples/chip/clock_config.c", + "${chip_root}/third_party/simw-top-mini/repo/demos/ksdk/common/boards/DK6/wireless_examples/chip/pin_mux.c", ] } else { sources += [ - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/reed/bm/board.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/reed/bm/board_utility.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/reed/bm/hardware_init.c", + "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/reed/bm/clock_config.c", + "${k32w0_sdk_root}/boards/${board}/wireless_examples/openthread/reed/bm/pin_mux.c", ] - - if (chip_with_se05x != 0) { - sources += [ - "${chip_root}/third_party/simw-top-mini/repo/demos/ksdk/common/boards/DK6/wireless_examples/chip/clock_config.c", - "${chip_root}/third_party/simw-top-mini/repo/demos/ksdk/common/boards/DK6/wireless_examples/chip/pin_mux.c", - ] - } else { - sources += [ - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/reed/bm/clock_config.c", - "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/openthread/reed/bm/pin_mux.c", - ] - } } } if (chip_with_low_power != 0) { - sources += [ "${k32w0_sdk_root}/boards/k32w061dk6/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common/app_dual_mode_low_power.c" ] + sources += [ "${k32w0_sdk_root}/boards/${board}/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common/app_dual_mode_low_power.c" ] + } + + if (chip_with_ntag != 0) { + sources += [ + "${k32w0_sdk_root}/devices/${device}/drivers/fsl_ntag.c", + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_I2C/i2c_jn_fsl.c", + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_NTAG/ntag_driver.c", + "${k32w0_sdk_root}/middleware/ntag_i2c_plus/HAL_TMR/timer_driver_jn.c", + ] } if (!defined(public_deps)) { diff --git a/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh b/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh index 417731e01f5216..1ae747ee5dcf23 100755 --- a/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh +++ b/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh @@ -1,10 +1,12 @@ #!/bin/bash -if [[ ! -d $NXP_K32W061_SDK_ROOT ]]; then - echo "NXP_K32W061_SDK_ROOT is not set" +if [[ ! -d $NXP_K32W0_SDK_ROOT ]]; then + echo "NXP_K32W0_SDK_ROOT is not set" exit 1 fi +board=$(ls "$NXP_K32W0_SDK_ROOT"/boards) + convert_to_dos() { [[ $(file -b - <$1) != *"CRLF"* ]] && sed -i 's/$/\r/' "$1" @@ -13,59 +15,5 @@ convert_to_dos() { SOURCE=${BASH_SOURCE[0]} SOURCE_DIR=$(cd "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd) -convert_to_dos "$NXP_K32W061_SDK_ROOT"/boards/k32w061dk6/wireless_examples/openthread/reed/bm/gpio_pins.h -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/boards/k32w061dk6/wireless_examples/openthread/reed/bm -p1 <"$SOURCE_DIR/gpio_pins_h.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/boards/k32w061dk6/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common/app_dual_mode_low_power.h -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/boards/k32w061dk6/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common -p1 <"$SOURCE_DIR/app_dual_mode_low_power_h.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/boards/k32w061dk6/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common/app_dual_mode_switch.h -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/boards/k32w061dk6/wireless_examples/hybrid/ble_ot/lped_ble_wuart/ble_802_15_4_common -p1 <"$SOURCE_DIR/app_dual_mode_switch_h.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/SecLib/SecLib.h -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/SecLib -p1 <"$SOURCE_DIR/SecLib_h.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/OtaSupport/Source/OtaUtils.c -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/OtaSupport/Source -p1 <"$SOURCE_DIR/OtaUtils_c.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/OtaSupport/Source/OtaSupport.c -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/OtaSupport/Source -p1 <"$SOURCE_DIR/OtaSupport_c.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/middleware/wireless/bluetooth/host/interface/ble_utils.h -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/middleware/wireless/bluetooth/host/interface -p1 <"$SOURCE_DIR/ble_utils_h.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/Flash/External/Source/Eeprom_MX25R8035F.c -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/Flash/External/Source -p1 <"$SOURCE_DIR/Eeprom_MX25R8035F_c.patch" - -convert_to_dos "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/MemManager/Interface/MemManager.h -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/MemManager/Interface -p1 <"$SOURCE_DIR/MemManager_h.patch" - -#internal: THREADIP-3660 -patch -N --binary -d ./third_party/openthread/ot-nxp/src/k32w0/platform -p1 <"$SOURCE_DIR/settings_k32w_c.patch" - -SIGN_FILE_PATH="$NXP_K32W061_SDK_ROOT"/tools/imagetool/sign_images.sh -convert_to_dos "$SIGN_FILE_PATH" -patch -N --binary -d "$NXP_K32W061_SDK_ROOT"/tools/imagetool/ -p1 <"$SOURCE_DIR/sign_images_sh.patch" -sed -i 's/\r$//' "$SIGN_FILE_PATH" - -echo "Downloading PDM and BLE libraries from NXP server..." - -rm -rf patch_for_K32W061_SDK_2_6_4.zip patch_for_K32W061_SDK_2_6_4 -wget https://www.nxp.com/downloads/en/libraries/patch_for_K32W061_SDK_2_6_4.zip -exitCode=$? -if [ "$exitCode" -ne 0 ]; then - echo "Download error" - exit -fi - -unzip patch_for_K32W061_SDK_2_6_4.zip -cp patch_for_K32W061_SDK_2_6_4/controller_config.c "$NXP_K32W061_SDK_ROOT"/middleware/wireless/ble_controller/config/ -cp patch_for_K32W061_SDK_2_6_4/controller_interface.h "$NXP_K32W061_SDK_ROOT"/middleware/wireless/ble_controller/interface/ -cp patch_for_K32W061_SDK_2_6_4/lib_ble_controller.a "$NXP_K32W061_SDK_ROOT"/middleware/wireless/ble_controller/lib/ -cp patch_for_K32W061_SDK_2_6_4/libPDM_extFlash.a "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/PDM/Library/ - -rm -rf patch_for_K32W061_SDK_2_6_4.zip -rm -rf patch_for_K32W061_SDK_2_6_4 - -echo "K32W SDK MR3 QP1 was patched!" +echo "SDK 2.6.6 doesn't need any patching!" exit 0 diff --git a/third_party/openthread/ot-nxp b/third_party/openthread/ot-nxp index 7a55fa48f51188..611561714fed15 160000 --- a/third_party/openthread/ot-nxp +++ b/third_party/openthread/ot-nxp @@ -1 +1 @@ -Subproject commit 7a55fa48f51188f24135b9e57834ae57acf2e0ff +Subproject commit 611561714fed15d8046c30933f3d3b84b6a9908c diff --git a/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn b/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn index b942608b82ac9b..c6946d3d1d06ab 100644 --- a/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn +++ b/third_party/openthread/platforms/nxp/k32w/k32w0/BUILD.gn @@ -23,7 +23,11 @@ import("${chip_root}/third_party/nxp/k32w0_sdk/k32w0_sdk.gni") openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp" config("openthread_k32w0_config") { - include_dirs = [ "${openthread_nxp_root}/src/k32w0/k32w061" ] + include_dirs = [ + "${openthread_nxp_root}/src/k32w0/k32w061", + "${openthread_nxp_root}/src/k32w0/platform", + "${openthread_nxp_root}/src/common", + ] include_dirs += [ "${chip_root}/examples/platform/nxp/k32w/k32w0" ] if (is_clang) { @@ -52,14 +56,16 @@ source_set("openthread_mbedtls_config_k32w0") { source_set("libopenthread-k32w0") { sources = [ + "${openthread_nxp_root}/src/common/ram_storage.c", "${openthread_nxp_root}/src/k32w0/platform/alarm.c", "${openthread_nxp_root}/src/k32w0/platform/diag.c", "${openthread_nxp_root}/src/k32w0/platform/entropy.c", "${openthread_nxp_root}/src/k32w0/platform/flash.c", + "${openthread_nxp_root}/src/k32w0/platform/flash_pdm.c", "${openthread_nxp_root}/src/k32w0/platform/logging.c", "${openthread_nxp_root}/src/k32w0/platform/misc.c", + "${openthread_nxp_root}/src/k32w0/platform/pdm_ram_storage_glue.c", "${openthread_nxp_root}/src/k32w0/platform/radio.c", - "${openthread_nxp_root}/src/k32w0/platform/settings_k32w.c", "${openthread_nxp_root}/src/k32w0/platform/system.c", "${openthread_nxp_root}/src/k32w0/platform/uart.c", ] diff --git a/third_party/qpg_sdk/qpg_executable.gni b/third_party/qpg_sdk/qpg_executable.gni index 454040e25d728f..4950939182b1b4 100644 --- a/third_party/qpg_sdk/qpg_executable.gni +++ b/third_party/qpg_sdk/qpg_executable.gni @@ -97,7 +97,7 @@ template("qpg_executable") { gen_ota_header("$executable_target_name.ota") { ota_header_script_name = "${root_out_dir}/${executable_target_name}.ota" out_dir = rebase_path(root_out_dir, root_build_dir) - ota_header_generator = "${qpg_sdk_root}/Tools/ota/generate_ota_img.py" + ota_header_generator = "${qpg_sdk_root}/Tools/Ota/generate_ota_img.py" ota_header_options = [ string_join("=", @@ -119,7 +119,7 @@ template("qpg_executable") { [ "--pem_file_path", rebase_path(qpg_sdk_root, root_build_dir) + - "/Tools/ota/example_private_key.pem.example", + "/Tools/Ota/example_private_key.pem.example", ]), "--pem_password=test1234", "--sign", diff --git a/third_party/qpg_sdk/repo b/third_party/qpg_sdk/repo index fa660d1762c709..35ccb383fb401a 160000 --- a/third_party/qpg_sdk/repo +++ b/third_party/qpg_sdk/repo @@ -1 +1 @@ -Subproject commit fa660d1762c70938430d058f5830777770356bbd +Subproject commit 35ccb383fb401ad8ed02162a33915b1dff2af9d0 diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 0689d5dc931128..bf73c8371b1f7a 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -286,13 +286,16 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 46 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 47 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ + \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ \ @@ -482,8 +485,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* TemperatureUnit */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -780,14 +784,14 @@ { 0x00004003, ZAP_TYPE(ENUM8), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* StartUpOnOff */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* StartUpOnOff */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* switch type */ \ { 0x00000010, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* switch actions */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* switch actions */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -800,7 +804,7 @@ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* max frequency */ \ { 0x0000000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* options */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* options */ \ { 0x00000010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x0000) }, /* on off transition time */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -819,7 +823,7 @@ \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { 0x00000051, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* out of service */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* out of service */ \ { 0x00000055, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* present value */ \ { 0x0000006F, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* status flags */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ @@ -918,9 +922,9 @@ { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(27) }, /* Language */ \ { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(60) }, /* AutoRelockTime */ \ { 0x00000024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* SoundVolume */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* SoundVolume */ \ { 0x00000025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* OperatingMode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(7) }, /* OperatingMode */ \ { 0x00000026, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFF6) }, /* SupportedOperatingModes */ \ { 0x00000027, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0) }, /* DefaultConfigurationRegister */ \ { 0x00000029, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -929,9 +933,9 @@ { 0x0000002B, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x00) }, /* EnablePrivacyModeButton */ \ { 0x00000030, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(7) }, /* WrongCodeEntryLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(8) }, /* WrongCodeEntryLimit */ \ { 0x00000031, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(8) }, /* UserCodeTemporaryDisableTime */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* UserCodeTemporaryDisableTime */ \ { 0x00000033, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* RequirePINforRemoteOperation */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0xD13) }, /* FeatureMap */ \ @@ -974,7 +978,7 @@ ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x00000017, ZAP_TYPE(BITMAP8), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* Mode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* Mode */ \ { 0x0000001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x17) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ @@ -1012,9 +1016,9 @@ { 0x00000017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0x00000000) }, /* LifetimeEnergyConsumed */ \ { 0x00000020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* OperationMode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* OperationMode */ \ { 0x00000021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* ControlMode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(12) }, /* ControlMode */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ @@ -1025,40 +1029,40 @@ { 0x00000005, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x0640) }, /* AbsMinCoolSetpointLimit */ \ { 0x00000006, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x0C80) }, /* AbsMaxCoolSetpointLimit */ \ { 0x00000011, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(12) }, /* OccupiedCoolingSetpoint */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(13) }, /* OccupiedCoolingSetpoint */ \ { 0x00000012, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(13) }, /* OccupiedHeatingSetpoint */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(14) }, /* OccupiedHeatingSetpoint */ \ { 0x00000015, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(14) }, /* MinHeatSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(15) }, /* MinHeatSetpointLimit */ \ { 0x00000016, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(15) }, /* MaxHeatSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(16) }, /* MaxHeatSetpointLimit */ \ { 0x00000017, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(16) }, /* MinCoolSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(17) }, /* MinCoolSetpointLimit */ \ { 0x00000018, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(17) }, /* MaxCoolSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* MaxCoolSetpointLimit */ \ { 0x00000019, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* MinSetpointDeadBand */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(19) }, /* MinSetpointDeadBand */ \ { 0x0000001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(19) }, /* ControlSequenceOfOperation */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(20) }, /* ControlSequenceOfOperation */ \ { 0x0000001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(20) }, /* SystemMode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(21) }, /* SystemMode */ \ { 0x0000001E, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* ThermostatRunningMode */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x0023) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(21) }, /* fan mode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(22) }, /* fan mode */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(22) }, /* fan mode sequence */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(23) }, /* fan mode sequence */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(23) }, /* percent setting */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(24) }, /* percent setting */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* percent current */ \ { 0x00000004, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(100) }, /* speed max */ \ { 0x00000005, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(24) }, /* speed setting */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(25) }, /* speed setting */ \ { 0x00000006, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* speed current */ \ { 0x00000007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* rock support */ \ { 0x00000008, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* rock setting */ \ @@ -1069,11 +1073,11 @@ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(25) }, /* temperature display mode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(26) }, /* temperature display mode */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(26) }, /* keypad lockout */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(27) }, /* keypad lockout */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(27) }, /* schedule programming visibility */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(28) }, /* schedule programming visibility */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -1108,25 +1112,25 @@ { 0x00000029, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Primary6Y */ \ { 0x0000002A, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* Primary6Intensity */ \ { 0x00000030, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(28) }, /* WhitePointX */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(29) }, /* WhitePointX */ \ { 0x00000031, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(29) }, /* WhitePointY */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(30) }, /* WhitePointY */ \ { 0x00000032, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(30) }, /* ColorPointRX */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(31) }, /* ColorPointRX */ \ { 0x00000033, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(31) }, /* ColorPointRY */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(32) }, /* ColorPointRY */ \ { 0x00000034, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* ColorPointRIntensity */ \ { 0x00000036, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(32) }, /* ColorPointGX */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(33) }, /* ColorPointGX */ \ { 0x00000037, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(33) }, /* ColorPointGY */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* ColorPointGY */ \ { 0x00000038, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* ColorPointGIntensity */ \ { 0x0000003A, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* ColorPointBX */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(35) }, /* ColorPointBX */ \ { 0x0000003B, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(35) }, /* ColorPointBY */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(36) }, /* ColorPointBY */ \ { 0x0000003C, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* ColorPointBIntensity */ \ { 0x00004000, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* EnhancedCurrentHue */ \ @@ -1141,7 +1145,7 @@ { 0x0000400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* ColorTempPhysicalMaxMireds */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* CoupleColorTempToLevelMinMireds */ \ { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(36) }, /* StartUpColorTemperatureMireds */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(37) }, /* StartUpColorTemperatureMireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1F) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ @@ -1328,13 +1332,13 @@ { 0x00000025, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* struct_attr */ \ { 0x00000026, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(37) }, /* range_restricted_int8u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(38) }, /* range_restricted_int8u */ \ { 0x00000027, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(38) }, /* range_restricted_int8s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(39) }, /* range_restricted_int8s */ \ { 0x00000028, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(39) }, /* range_restricted_int16u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(40) }, /* range_restricted_int16u */ \ { 0x00000029, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(40) }, /* range_restricted_int16s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(41) }, /* range_restricted_int16s */ \ { 0x0000002A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_long_octet_string */ \ { 0x0000002B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1406,16 +1410,16 @@ ZAP_EMPTY_DEFAULT() }, /* nullable_struct */ \ { 0x00004026, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(41) }, /* nullable_range_restricted_int8u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(42) }, /* nullable_range_restricted_int8u */ \ { 0x00004027, ZAP_TYPE(INT8S), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(42) }, /* nullable_range_restricted_int8s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(43) }, /* nullable_range_restricted_int8s */ \ { 0x00004028, ZAP_TYPE(INT16U), 2, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(43) }, /* nullable_range_restricted_int16u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(44) }, /* nullable_range_restricted_int16u */ \ { 0x00004029, ZAP_TYPE(INT16S), 2, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(44) }, /* nullable_range_restricted_int16s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(45) }, /* nullable_range_restricted_int16s */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -1431,7 +1435,7 @@ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(45) }, /* StartUpOnOff */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(46) }, /* StartUpOnOff */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 2bca6b715cf75d..441c044b5d65d3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1020,7 +1020,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalCredentials: case EnumType::kMissingCsr: case EnumType::kTableFull: case EnumType::kInvalidAdminSubject: - case EnumType::kInsufficientPrivilege: case EnumType::kFabricConflict: case EnumType::kLabelConflict: case EnumType::kInvalidFabricIndex: 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 10a067fc1e3b53..828bece6f247ec 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 @@ -934,18 +934,17 @@ namespace OperationalCredentials { // Enum for OperationalCertStatus enum class OperationalCertStatus : uint8_t { - kSuccess = 0x00, - kInvalidPublicKey = 0x01, - kInvalidNodeOpId = 0x02, - kInvalidNOC = 0x03, - kMissingCsr = 0x04, - kTableFull = 0x05, - kInvalidAdminSubject = 0x06, - kInsufficientPrivilege = 0x08, - kFabricConflict = 0x09, - kLabelConflict = 0x0A, - kInvalidFabricIndex = 0x0B, - kUnknownEnumValue = 7, + kSuccess = 0x00, + kInvalidPublicKey = 0x01, + kInvalidNodeOpId = 0x02, + kInvalidNOC = 0x03, + kMissingCsr = 0x04, + kTableFull = 0x05, + kInvalidAdminSubject = 0x06, + kFabricConflict = 0x09, + kLabelConflict = 0x0A, + kInvalidFabricIndex = 0x0B, + kUnknownEnumValue = 7, }; } // namespace OperationalCredentials 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 6d5c4cb5cf654e..b7f9abcae5b4b8 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 @@ -20695,39 +20695,107 @@ bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand) return false; } -// TODO(#20811): Actually generate the following based on ZAP metadata -// See https://github.com/project-chip/zap/issues/609 bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) { // Maybe it would be smaller code to codegen a table and walk over it? // Not sure. switch (aCluster) { + case Clusters::Identify::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::Groups::Id: { switch (aCommand) { case Clusters::Groups::Commands::AddGroup::Id: + return true; case Clusters::Groups::Commands::ViewGroup::Id: + return true; case Clusters::Groups::Commands::GetGroupMembership::Id: + return true; case Clusters::Groups::Commands::RemoveGroup::Id: + return true; case Clusters::Groups::Commands::RemoveAllGroups::Id: return true; + case Clusters::Groups::Commands::AddGroupIfIdentifying::Id: + return true; default: return false; } } - case Clusters::GroupKeyManagement::Id: { + case Clusters::Scenes::Id: { switch (aCommand) { - case Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRead::Id: - case Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: - case Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: + case Clusters::Scenes::Commands::AddScene::Id: + return true; + case Clusters::Scenes::Commands::ViewScene::Id: + return true; + case Clusters::Scenes::Commands::RemoveScene::Id: + return true; + case Clusters::Scenes::Commands::RemoveAllScenes::Id: + return true; + case Clusters::Scenes::Commands::StoreScene::Id: + return true; + case Clusters::Scenes::Commands::RecallScene::Id: + return true; + case Clusters::Scenes::Commands::GetSceneMembership::Id: + return true; + case Clusters::Scenes::Commands::EnhancedAddScene::Id: + return true; + case Clusters::Scenes::Commands::EnhancedViewScene::Id: + return true; + case Clusters::Scenes::Commands::CopyScene::Id: return true; default: return false; } } + case Clusters::OnOff::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::LevelControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::BridgedActions::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::Basic::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::OtaSoftwareUpdateProvider::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::OtaSoftwareUpdateRequestor::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::GeneralCommissioning::Id: { switch (aCommand) { @@ -20737,24 +20805,215 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::Scenes::Id: { - // Entire cluster is fabric-scoped. - return true; + case Clusters::NetworkCommissioning::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::DiagnosticLogs::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::GeneralDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::SoftwareDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ThreadNetworkDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::WiFiNetworkDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::EthernetNetworkDiagnostics::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::AdministratorCommissioning::Id: { + switch (aCommand) + { + default: + return false; + } } case Clusters::OperationalCredentials::Id: { switch (aCommand) { case Clusters::OperationalCredentials::Commands::UpdateNOC::Id: + return true; case Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Id: return true; default: return false; } } - default: - break; + case Clusters::GroupKeyManagement::Id: { + switch (aCommand) + { + case Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: + return true; + case Clusters::GroupKeyManagement::Commands::KeySetRead::Id: + return true; + case Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: + return true; + case Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: + return true; + default: + return false; + } + } + case Clusters::ModeSelect::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::DoorLock::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::WindowCovering::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::BarrierControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::Thermostat::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ColorControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::Channel::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::TargetNavigator::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::MediaPlayback::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::MediaInput::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::LowPower::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::KeypadInput::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ContentLauncher::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::AudioOutput::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ApplicationLauncher::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::AccountLogin::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ElectricalMeasurement::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::TestCluster::Id: { + switch (aCommand) + { + default: + return false; + } + } } - return false; } diff --git a/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp index 93cd15f439ed14..198b5688cd957c 100644 --- a/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp @@ -99,6 +99,43 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning +namespace BridgedActions { + +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::InstantAction::Id: { + Commands::InstantAction::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfBridgedActionsClusterInstantActionCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) + { + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); + } +} + +} // namespace BridgedActions + namespace DiagnosticLogs { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -729,6 +766,9 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::BridgedActions::Id: + Clusters::BridgedActions::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::DiagnosticLogs::Id: Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index 2959aa6b9f8e48..a39aaf86134db5 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -38,6 +38,11 @@ \ /* 6 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Bridged Actions (server), big-endian */ \ + \ + /* 14 - setup url, */ \ + 0, 19, 'h', 't', 't', 'p', 's', ':', '/', '/', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm', \ } #else // !BIGENDIAN_CPU @@ -53,11 +58,16 @@ \ /* 6 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Bridged Actions (server), little-endian */ \ + \ + /* 14 - setup url, */ \ + 0, 19, 'h', 't', 't', 'p', 's', ':', '/', '/', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm', \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (2) +#define GENERATED_DEFAULTS_COUNT (3) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -78,19 +88,22 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 2 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 3 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ + \ /* Endpoint: 2, Cluster: Level Control (server) */ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 } /* options */ \ } #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 240 +#define GENERATED_ATTRIBUTE_COUNT 241 #define GENERATED_ATTRIBUTES \ { \ \ @@ -180,8 +193,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* TemperatureUnit */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -439,6 +453,7 @@ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* action list */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* endpoint list */ \ + { 0x00000002, ZAP_TYPE(LONG_CHAR_STRING), 514, 0, ZAP_LONG_DEFAULTS_INDEX(14) }, /* setup url */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -456,7 +471,7 @@ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* max frequency */ \ { 0x0000000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* options */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* options */ \ { 0x00000010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x0000) }, /* on off transition time */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -600,14 +615,18 @@ 0x00000000 /* Identify */, \ 0x00000040 /* TriggerEffect */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 2, Cluster: On/Off (server) */\ + /* Endpoint: 1, Cluster: Bridged Actions (server) */\ /* AcceptedCommandList (index=57) */ \ + 0x00000000 /* InstantAction */, \ + chip::kInvalidCommandId /* end of list */, \ + /* Endpoint: 2, Cluster: On/Off (server) */\ + /* AcceptedCommandList (index=59) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Level Control (server) */\ - /* AcceptedCommandList (index=61) */ \ + /* AcceptedCommandList (index=63) */ \ 0x00000000 /* MoveToLevel */, \ 0x00000001 /* Move */, \ 0x00000002 /* Step */, \ @@ -872,39 +891,39 @@ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ .clusterId = 0x00000025, \ .attributes = ZAP_ATTRIBUTE_INDEX(206), \ - .attributeCount = 4, \ - .clusterSize = 6, \ + .attributeCount = 5, \ + .clusterSize = 520, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = nullptr ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 57 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(210), \ + .attributes = ZAP_ATTRIBUTE_INDEX(211), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 57 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 59 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(213), \ + .attributes = ZAP_ATTRIBUTE_INDEX(214), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(229), \ + .attributes = ZAP_ATTRIBUTE_INDEX(230), \ .attributeCount = 6, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -915,7 +934,7 @@ { \ /* Endpoint: 2, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(235), \ + .attributes = ZAP_ATTRIBUTE_INDEX(236), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -934,11 +953,11 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 19, 230 }, { ZAP_CLUSTER_INDEX(19), 4, 21 }, { ZAP_CLUSTER_INDEX(23), 4, 47 }, \ + { ZAP_CLUSTER_INDEX(0), 19, 230 }, { ZAP_CLUSTER_INDEX(19), 4, 535 }, { ZAP_CLUSTER_INDEX(23), 4, 47 }, \ } // Largest attribute size is needed for various buffers -#define ATTRIBUTE_LARGEST (259) +#define ATTRIBUTE_LARGEST (515) static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, "ATTRIBUTE_LARGEST larger than expected"); @@ -946,7 +965,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (37) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (298) +#define ATTRIBUTE_MAX_SIZE (812) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 084f5b14dfd7d7..4f707a86b477c5 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -27334,7 +27334,7 @@ class Test_TC_TMP_2_1Suite : public TestCommand class Test_TC_TSTAT_1_1Suite : public TestCommand { public: - Test_TC_TSTAT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_1_1", 17, credsIssuerConfig) + Test_TC_TSTAT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_1_1", 16, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -27386,7 +27386,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "map32")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1UL)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 63UL)); } break; @@ -27412,7 +27412,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); } break; case 5: @@ -27421,7 +27421,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); } break; case 6: @@ -27430,7 +27430,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); } break; case 7: @@ -27439,7 +27439,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); } break; case 8: @@ -27448,7 +27448,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); } break; case 9: @@ -27457,6 +27457,8 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); } break; @@ -27522,10 +27524,6 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -27566,32 +27564,32 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand chip::NullOptional); } case 4: { - LogStep(4, "Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(4, "Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(5, "Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, chip::NullOptional); } case 6: { - LogStep(6, "Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(6, "Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(7, "Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(8, "Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::AttributeList::Id, true, chip::NullOptional); } @@ -27636,16 +27634,6 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Read the global attribute: EventList"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - 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(kIdentityAlpha, value); - } } return CHIP_NO_ERROR; } @@ -27654,7 +27642,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand class Test_TC_TSTAT_2_1Suite : public TestCommand { public: - Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_1", 51, credsIssuerConfig) + Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_1", 50, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -27807,8 +27795,8 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; case 13: @@ -27817,8 +27805,8 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; case 14: @@ -27827,8 +27815,8 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; case 15: @@ -27837,8 +27825,8 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; case 16: @@ -27847,8 +27835,8 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; case 17: @@ -27922,20 +27910,16 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } break; case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); } break; - case 26: + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27945,7 +27929,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); } break; - case 27: + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27955,7 +27939,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 28: + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27965,7 +27949,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 29: + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27975,7 +27959,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); } break; - case 30: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -27985,7 +27969,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 1440U)); } break; - case 31: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27995,7 +27979,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); } break; - case 32: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -28005,7 +27989,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); } break; - case 33: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28015,7 +27999,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); } break; - case 34: + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28025,7 +28009,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); } break; - case 35: + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -28033,7 +28017,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "utc")); } break; - case 36: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28043,7 +28027,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 37: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28053,7 +28037,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 38: + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28063,7 +28047,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 39: + case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28073,7 +28057,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 40: + case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28083,7 +28067,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 41: + case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28093,7 +28077,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 42: + case 41: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28103,7 +28087,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); } break; - case 43: + case 42: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28113,7 +28097,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); } break; - case 44: + case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -28123,7 +28107,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); } break; - case 45: + case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28133,7 +28117,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); } break; - case 46: + case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28143,7 +28127,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); } break; - case 47: + case 46: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -28151,7 +28135,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "map32")); } break; - case 48: + case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28161,7 +28145,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); } break; - case 49: + case 48: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -28171,7 +28155,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); } break; - case 50: + case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -28204,7 +28188,6 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } case 1: { LogStep(1, "Reads mandatory attributes from DUT: LocalTemperature"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::LocalTemperature::Id, true, chip::NullOptional); } @@ -28216,7 +28199,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } case 3: { LogStep(3, "Read Occupancy attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::Occupancy::Id, true, chip::NullOptional); } @@ -28270,36 +28253,36 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } case 12: { LogStep(12, "Reads optional attributes from DUT: OccupiedCoolingSetpoint"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 13: { LogStep(13, "Reads mandatory attributes from DUT: OccupiedHeatingSetpoint"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 14: { LogStep(14, "Read UnoccupiedCoolingSetpoint attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 15: { LogStep(15, "Read UnoccupiedHeatingSetpoint attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 16: { - LogStep(16, "Reads mandatory attributes from DUT: MinHeatSetpointLimit"); + LogStep(16, "Reads attribute from DUT: MinHeatSetpointLimit"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, true, chip::NullOptional); } case 17: { - LogStep(17, "Reads mandatory attributes from DUT: MaxHeatSetpointLimit"); + LogStep(17, "Reads attribute from DUT: MaxHeatSetpointLimit"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, true, chip::NullOptional); @@ -28318,7 +28301,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } case 20: { LogStep(20, "Reads optional attributes from DUT: MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, true, chip::NullOptional); } @@ -28330,180 +28313,166 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } case 22: { LogStep(22, "Reads mandatory attributes from DUT: ControlSequenceOfOperation"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } case 23: { LogStep(23, "Reads mandatory attributes from DUT: SystemMode"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A001c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SystemMode::Id, true, chip::NullOptional); } case 24: { - LogStep(24, - "Read AlarmMask attribute from the DUT and Verify that the DUT responds with a map8 value.The value has to be " - "in the range of 0x00 to 0x07."); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A001d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - 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(kIdentityAlpha, value); - } - case 25: { - LogStep(25, "Read ThermostatRunningMode attribute from the DUT"); + LogStep(24, "Read ThermostatRunningMode attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A001e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatRunningMode::Id, true, chip::NullOptional); } - case 26: { - LogStep(26, "Reads constraints of optional attributes from DUT: StartOfWeek"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 25: { + LogStep(25, "Reads constraints of optional attributes from DUT: StartOfWeek"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::StartOfWeek::Id, true, chip::NullOptional); } - case 27: { - LogStep(27, "Reads optional attributes from DUT: NumberOfWeeklyTransitions"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 26: { + LogStep(26, "Reads optional attributes from DUT: NumberOfWeeklyTransitions"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::NumberOfWeeklyTransitions::Id, true, chip::NullOptional); } - case 28: { - LogStep(28, "Reads optional attributes from DUT: NumberOfDailyTransitions"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 27: { + LogStep(27, "Reads optional attributes from DUT: NumberOfDailyTransitions"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::NumberOfDailyTransitions::Id, true, chip::NullOptional); } - case 29: { - LogStep(29, "Read TemperatureSetpointHold attribute from the DUT"); + case 28: { + LogStep(28, "Read TemperatureSetpointHold attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::TemperatureSetpointHold::Id, true, chip::NullOptional); } - case 30: { - LogStep(30, "Read TemperatureSetpointHoldDuration attribute from the DUT"); + case 29: { + LogStep(29, "Read TemperatureSetpointHoldDuration attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::TemperatureSetpointHoldDuration::Id, true, chip::NullOptional); } - case 31: { - LogStep(31, "Read ThermostatProgrammingOperationMode attribute from the DUT"); + case 30: { + LogStep(30, "Read ThermostatProgrammingOperationMode attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatProgrammingOperationMode::Id, true, chip::NullOptional); } - case 32: { - LogStep(32, "Read ThermostatRunningState attribute from the DUT"); + case 31: { + LogStep(31, "Read ThermostatRunningState attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatRunningState::Id, true, chip::NullOptional); } - case 33: { - LogStep(33, "Read SetpointChangeSource attribute from the DUT"); + case 32: { + LogStep(32, "Read SetpointChangeSource attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeSource::Id, true, chip::NullOptional); } - case 34: { - LogStep(34, "Read SetpointChangeAmount attribute from the DUT"); + case 33: { + LogStep(33, "Read SetpointChangeAmount attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeAmount::Id, true, chip::NullOptional); } - case 35: { - LogStep(35, "Read SetpointChangeSourceTimestamp attribute from the DUT"); + case 34: { + LogStep(34, "Read SetpointChangeSourceTimestamp attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeSourceTimestamp::Id, true, chip::NullOptional); } - case 36: { - LogStep(36, "Read OccupiedSetback attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0034"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 35: { + LogStep(35, "Read OccupiedSetback attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetback::Id, true, chip::NullOptional); } - case 37: { - LogStep(37, "Read OccupiedSetbackMin attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0035"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 36: { + LogStep(36, "Read OccupiedSetbackMin attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetbackMin::Id, true, chip::NullOptional); } - case 38: { - LogStep(38, "Read OccupiedSetbackMax attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0036"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 37: { + LogStep(37, "Read OccupiedSetbackMax attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetbackMax::Id, true, chip::NullOptional); } - case 39: { - LogStep(39, "Read UnoccupiedSetback attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0037"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 38: { + LogStep(38, "Read UnoccupiedSetback attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetback::Id, true, chip::NullOptional); } - case 40: { - LogStep(40, "Read UnoccupiedSetbackMin attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 39: { + LogStep(39, "Read UnoccupiedSetbackMin attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetbackMin::Id, true, chip::NullOptional); } - case 41: { - LogStep(41, "Read UnoccupiedSetbackMax attribute from the DUT"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 40: { + LogStep(40, "Read UnoccupiedSetbackMax attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetbackMax::Id, true, chip::NullOptional); } - case 42: { - LogStep(42, "Read EmergencyHeatDelta attribute from the DUT"); + case 41: { + LogStep(41, "Read EmergencyHeatDelta attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::EmergencyHeatDelta::Id, true, chip::NullOptional); } - case 43: { - LogStep(43, "Read ACType attribute from the DUT"); + case 42: { + LogStep(42, "Read ACType attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0040"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACType::Id, true, chip::NullOptional); } - case 44: { - LogStep(44, "Read ACCapacity attribute from the DUT"); + case 43: { + LogStep(43, "Read ACCapacity attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0041"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCapacity::Id, true, chip::NullOptional); } - case 45: { - LogStep(45, "Read ACRefrigerantType attribute from the DUT"); + case 44: { + LogStep(44, "Read ACRefrigerantType attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0042"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACRefrigerantType::Id, true, chip::NullOptional); } - case 46: { - LogStep(46, "Read ACCompressorType attribute from the DUT"); + case 45: { + LogStep(45, "Read ACCompressorType attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0043"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCompressorType::Id, true, chip::NullOptional); } - case 47: { - LogStep(47, "Read ACErrorCode attribute from the DUT"); + case 46: { + LogStep(46, "Read ACErrorCode attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0044"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACErrorCode::Id, true, chip::NullOptional); } - case 48: { - LogStep(48, "Read ACLouverPosition attribute from the DUT"); + case 47: { + LogStep(47, "Read ACLouverPosition attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0045"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACLouverPosition::Id, true, chip::NullOptional); } - case 49: { - LogStep(49, "Read ACCoilTemperature attribute from the DUT"); + case 48: { + LogStep(48, "Read ACCoilTemperature attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0046"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCoilTemperature::Id, true, chip::NullOptional); } - case 50: { - LogStep(50, "Read ACCapacityFormat attribute from the DUT"); + case 49: { + LogStep(49, "Read ACCapacityFormat attribute from the DUT"); VerifyOrDo(!ShouldSkip("TSTAT.S.A0047"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCapacityformat::Id, true, chip::NullOptional); @@ -28582,7 +28551,6 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); @@ -28632,8 +28600,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -28716,11 +28683,14 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand break; case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("minHeatSetpointLimit", value, 800)); + } break; case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); @@ -28729,26 +28699,35 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", value, 3000)); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); + } break; case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28756,20 +28735,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("maxHeatSetpointLimit", value, 2900)); } break; - case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28780,10 +28758,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 49: + case 50: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 50: + case 51: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28791,14 +28769,11 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("minCoolSetpointLimit", value, 2000)); } break; - case 51: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; case 52: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 53: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -28807,6 +28782,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28817,23 +28795,22 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 57: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; case 58: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 59: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("maxCoolSetpointLimit", value, 2000)); + } break; case 60: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 61: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 62: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -28843,7 +28820,6 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand break; case 64: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 65: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -28855,6 +28831,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 69: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int8_t value; @@ -28865,10 +28844,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); } break; - case 69: + case 70: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 70: + case 71: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int8_t value; @@ -28876,19 +28855,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("minSetpointDeadBand", value, 5)); } break; - case 71: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; case 72: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 73: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 74: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 76: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Thermostat::ThermostatControlSequence value; @@ -28899,10 +28878,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); } break; - case 76: + case 77: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 77: + case 78: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Thermostat::ThermostatControlSequence value; @@ -28910,20 +28889,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("controlSequenceOfOperation", value, 2U)); } break; - case 78: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 79: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 80: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 81: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28931,24 +28909,20 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 1700)); } break; - case 83: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; case 84: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 86: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 30)); + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 2300)); } break; - case 86: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 87: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; @@ -28979,7 +28953,6 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand break; case 93: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 94: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -29005,7 +28978,6 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand break; case 98: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 99: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -29050,13 +29022,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 1: { LogStep(1, "Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 2: { LogStep(2, "Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2500; @@ -29066,13 +29038,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 3: { LogStep(3, "Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(4, "Writes OccupiedCoolingSetpoint to value below the ABSMinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 30; @@ -29082,7 +29054,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 5: { LogStep(5, "Writes OccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; @@ -29092,13 +29064,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 6: { LogStep(6, "Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 1600; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); } case 7: { LogStep(7, "Writes the CoolingSetpoint below the HeatingSetpoint when auto is enabled"); @@ -29112,7 +29084,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 8: { LogStep(8, "Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; @@ -29122,13 +29094,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 9: { LogStep(9, "Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 10: { LogStep(10, "Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2100; @@ -29138,13 +29110,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 11: { LogStep(11, "Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 12: { LogStep(12, "Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 600; @@ -29154,7 +29126,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 13: { LogStep(13, "Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4010; @@ -29164,7 +29136,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 14: { LogStep(14, "Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; @@ -29190,23 +29162,23 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 17: { LogStep(17, "Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); } case 18: { LogStep(18, "Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 19: { LogStep(19, "Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2500; @@ -29216,13 +29188,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 20: { LogStep(20, "Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 21: { - LogStep(21, "Writes UnoccupiedCoolingSetpoint to value below the MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(21, "Writes UnoccupiedCoolingSetpoint to value below the MinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1002; @@ -29231,8 +29203,8 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand chip::NullOptional); } case 22: { - LogStep(22, "Writes UnoccupiedCoolingSetpoint to value above the MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(22, "Writes UnoccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4010; @@ -29242,7 +29214,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 23: { LogStep(23, "Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1800; @@ -29252,7 +29224,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 24: { LogStep(24, "Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3000; @@ -29262,13 +29234,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 25: { LogStep(25, "Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 26: { LogStep(26, "Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2500; @@ -29278,13 +29250,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 27: { LogStep(27, "Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 28: { LogStep(28, "Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 500; @@ -29294,7 +29266,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 29: { LogStep(29, "Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4010; @@ -29304,7 +29276,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 30: { LogStep(30, "Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1800; @@ -29314,7 +29286,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 31: { LogStep(31, "Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3000; @@ -29324,389 +29296,382 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 32: { LogStep(32, "Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, true, chip::NullOptional); } case 33: { LogStep(33, "Writes a value back that is different but valid for MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 800; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } case 34: { LogStep(34, "Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - 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(kIdentityAlpha, value); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + true, chip::NullOptional); } case 35: { - LogStep(35, "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(35, "Writes a value back that is different but violates the deadband"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0015 && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; - value = 650; + value = 2000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } case 36: { - LogStep(36, "Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(36, "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; - value = 4050; + value = 650; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } case 37: { - LogStep(37, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(37, "Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; - value = 700; + value = 4050; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } case 38: { - LogStep(38, "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(38, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 700; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } case 39: { - LogStep(39, "Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(39, "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015 && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } case 40: { - LogStep(40, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(40, "Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 41: { + LogStep(41, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 41: { - LogStep(41, "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 42: { + LogStep(42, "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0015 && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 42: { - LogStep(42, "Writes a value back that is different but valid for MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 43: { + LogStep(43, "Writes a value back that is different but valid for MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2900; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 43: { - LogStep(43, "Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 44: { + LogStep(44, "Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, true, chip::NullOptional); } - case 44: { - LogStep(44, "Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 45: { + LogStep(45, "Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 500; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 45: { - LogStep(45, "Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 46: { + LogStep(46, "Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 46: { - LogStep(46, "Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 47: { + LogStep(47, "Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 47: { - LogStep(47, "Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 48: { + LogStep(48, "Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } - case 48: { - LogStep(48, "Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 49: { + LogStep(49, "Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, true, chip::NullOptional); } - case 49: { - LogStep(49, "Writes a value back that is different but valid for MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 50: { + LogStep(50, "Writes a value back that is different but valid for MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 50: { - LogStep(50, "Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 51: { + LogStep(51, "Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, true, chip::NullOptional); } - case 51: { - LogStep(51, "Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 52: { + LogStep(52, "Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 52: { - LogStep(52, "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 53: { + LogStep(53, "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 53: { - LogStep(53, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 54: { + LogStep(54, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1600; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 54: { - LogStep(54, "Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 55: { + LogStep(55, "Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 55: { - LogStep(55, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 56: { + LogStep(56, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1600; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 56: { - LogStep(56, "Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 57: { + LogStep(57, "Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, true, chip::NullOptional); } - case 57: { - LogStep(57, "Writes a value back that is different but valid for MaxCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - 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(kIdentityAlpha, value); - } case 58: { - LogStep(58, "Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(58, "Writes a value back that is different but valid for MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } case 59: { - LogStep(59, "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(59, "Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 60: { - LogStep(60, "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 61: { + LogStep(61, "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 61: { - LogStep(61, "Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 62: { + LogStep(62, "Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 1600; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } - case 62: { - LogStep(62, "Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 63: { + LogStep(63, "Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 63: { - LogStep(63, "Writes (sets back) default value of MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 64: { + LogStep(64, "Writes (sets back) default value of MinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 64: { - LogStep(64, "Writes (sets back)default value of MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 65: { + LogStep(65, "Writes (sets back)default value of MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0016 &&!TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); } - case 65: { - LogStep(65, "Writes MaxHeatSetpointLimit That meets the deadband of 2.5C"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 66: { + LogStep(66, "Writes MaxHeatSetpointLimit That meets the deadband of 2.5C"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0016 &&!TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2950; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 66: { - LogStep(66, "Writes (sets back) default value of MinCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 67: { + LogStep(67, "Writes (sets back) default value of MinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1600; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 67: { - LogStep(67, "Writes (sets back) default value of MaxCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 68: { + LogStep(68, "Writes (sets back) default value of MaxCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 68: { - LogStep(68, "Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 69: { + LogStep(69, "Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, true, chip::NullOptional); } - case 69: { - LogStep(69, "Writes a value back that is different but valid for MinSetpointDeadBand attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 70: { + LogStep(70, "Writes a value back that is different but valid for MinSetpointDeadBand attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 5; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 70: { - LogStep(70, "Reads it back again to confirm the successful write of MinSetpointDeadBand attribute"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 71: { + LogStep(71, "Reads it back again to confirm the successful write of MinSetpointDeadBand attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, true, chip::NullOptional); } - case 71: { - LogStep(71, "Writes the value below MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 72: { + LogStep(72, "Writes the value below MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = -1; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 72: { - LogStep(72, "Writes the value above MinSetpointDeadBand "); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 73: { + LogStep(73, "Writes the value above MinSetpointDeadBand "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 30; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 73: { - LogStep(73, "Writes the min limit of MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 74: { + LogStep(74, "Writes the min limit of MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 0; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 74: { - LogStep(74, "Writes the max limit of MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 75: { + LogStep(75, "Writes the max limit of MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 25; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 75: { - LogStep(75, "Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 76: { + LogStep(76, "Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } - case 76: { - LogStep(76, "Write Attribute command for ControlSequenceOfOperation with a new valid value"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 77: { + LogStep(77, "Write Attribute command for ControlSequenceOfOperation with a new valid value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::ThermostatControlSequence value; value = static_cast(2); @@ -29714,24 +29679,23 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::ControlSequenceOfOperation::Id, value, chip::NullOptional, chip::NullOptional); } - case 77: { - LogStep(77, "Read it back again to confirm the successful write"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 78: { + LogStep(78, "Read it back again to confirm the successful write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } - case 78: { - LogStep(78, "Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet deadband constraint"); - VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && TSTAT.S.F05"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 79: { + LogStep(79, "Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet deadband constraint"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015 && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2950; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 79: { - LogStep(79, "Sets OccupiedCoolingSetpoint to default value"); + case 80: { + LogStep(80, "Sets OccupiedCoolingSetpoint to default value"); VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; @@ -29740,20 +29704,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 80: { - LogStep(80, "Sets OccupiedHeatingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 81: { + LogStep(81, "Sets OccupiedHeatingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); } - case 81: { - LogStep(81, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 82: { + LogStep(82, "Sends SetpointRaise Command Heat Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(0); @@ -29763,26 +29726,25 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 82: { - LogStep(82, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 83: { + LogStep(83, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 83: { - LogStep(83, "Sets OccupiedHeatingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 84: { + LogStep(84, "Sets OccupiedHeatingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); } - case 84: { - LogStep(84, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 85: { + LogStep(85, "Sends SetpointRaise Command Heat Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(0); @@ -29792,26 +29754,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 85: { - LogStep(85, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 86: { + LogStep(86, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 86: { - LogStep(86, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - int16_t value; - value = 2600; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, - chip::NullOptional); - } case 87: { - LogStep(87, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(87, "Sends SetpointRaise Command Cool Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(1); @@ -29823,13 +29774,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 88: { LogStep(88, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 89: { LogStep(89, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2600; @@ -29838,9 +29789,8 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand chip::NullOptional); } case 90: { - LogStep(90, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(90, "Sends SetpointRaise Command Cool Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(1); @@ -29852,13 +29802,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 91: { LogStep(91, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 92: { LogStep(92, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2600; @@ -29868,18 +29818,17 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 93: { LogStep(93, "Sets OccupiedHeatingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); } case 94: { - LogStep(94, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(94, "Sends SetpointRaise Command Heat & Cool"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(2); @@ -29891,19 +29840,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 95: { LogStep(95, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 96: { LogStep(96, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 97: { LogStep(97, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2600; @@ -29913,18 +29862,17 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 98: { LogStep(98, "Sets OccupiedHeatingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - 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(kIdentityAlpha, value); + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); } case 99: { - LogStep(99, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(99, "Sends SetpointRaise Command Heat & Cool"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(2); @@ -29936,13 +29884,13 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 100: { LogStep(100, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 101: { LogStep(101, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } @@ -89457,7 +89405,7 @@ class Test_TC_LUNIT_2_1Suite : public TestCommand class Test_TC_LUNIT_3_1Suite : public TestCommand { public: - Test_TC_LUNIT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_3_1", 0, credsIssuerConfig) + Test_TC_LUNIT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_3_1", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -89490,6 +89438,54 @@ class Test_TC_LUNIT_3_1Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 1U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 2U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -89505,6 +89501,73 @@ class Test_TC_LUNIT_3_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads TemperatureUnit attribute from DUT"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH writes 0 (Fahrenheit) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Fahrenheit"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH writes 1 (Celsius) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Celsius"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH writes 2 (Kelvin) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Kelvin"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH writes 5 to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } } return CHIP_NO_ERROR; } 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 6bc5360c4ffbc4..0edeb7084a01c3 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -43889,50 +43889,50 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { break; case 4: ChipLogProgress( - chipTool, " ***** Test Step 4 : Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList\n"); - if (ShouldSkip("TSTAT.S.F01")) { + chipTool, " ***** Test Step 4 : Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadTheFeatureDependentTSTATSF01COOLAttributeInAttributeList_4(); + err = TestReadTheFeatureDependentTSTATSF00HEATAttributeInAttributeList_4(); break; case 5: ChipLogProgress( - chipTool, " ***** Test Step 5 : Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList\n"); - if (ShouldSkip("TSTAT.S.F02")) { + chipTool, " ***** Test Step 5 : Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestReadTheFeatureDependentTSTATSF02OCCAttributeInAttributeList_5(); + err = TestReadTheFeatureDependentTSTATSF01COOLAttributeInAttributeList_5(); break; case 6: ChipLogProgress( - chipTool, " ***** Test Step 6 : Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList\n"); - if (ShouldSkip("TSTAT.S.F00")) { + chipTool, " ***** Test Step 6 : Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList\n"); + if (ShouldSkip("TSTAT.S.F02")) { NextTest(); return; } - err = TestReadTheFeatureDependentTSTATSF00HEATAttributeInAttributeList_6(); + err = TestReadTheFeatureDependentTSTATSF02OCCAttributeInAttributeList_6(); break; case 7: ChipLogProgress(chipTool, - " ***** Test Step 7 : Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in " + " ***** Test Step 7 : Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in " "AttributeList\n"); - if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02")) { + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02")) { NextTest(); return; } - err = TestReadTheFeatureDependentTSTATSF01COOLTstatsf02occAttributeInAttributeList_7(); + err = TestReadTheFeatureDependentTSTATSF00HEATTstatsf02occAttributeInAttributeList_7(); break; case 8: ChipLogProgress(chipTool, - " ***** Test Step 8 : Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in " + " ***** Test Step 8 : Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in " "AttributeList\n"); - if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02")) { + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02")) { NextTest(); return; } - err = TestReadTheFeatureDependentTSTATSF00HEATTstatsf02occAttributeInAttributeList_8(); + err = TestReadTheFeatureDependentTSTATSF01COOLTstatsf02occAttributeInAttributeList_8(); break; case 9: ChipLogProgress( @@ -43991,14 +43991,6 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 15 : Read the global attribute: GeneratedCommandList\n"); err = TestReadTheGlobalAttributeGeneratedCommandList_15(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read the global attribute: EventList\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadTheGlobalAttributeEventList_16(); - break; } if (CHIP_NO_ERROR != err) { @@ -44058,9 +44050,6 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { 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. @@ -44074,7 +44063,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 16; chip::Optional mNodeId; chip::Optional mCluster; @@ -44127,7 +44116,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 1UL)); VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 63UL)); NextTest(); @@ -44165,7 +44154,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentTSTATSF01COOLAttributeInAttributeList_4() + CHIP_ERROR TestReadTheFeatureDependentTSTATSF00HEATAttributeInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -44174,12 +44163,12 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList Error: %@", err); + NSLog(@"Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); NextTest(); }]; @@ -44187,7 +44176,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentTSTATSF02OCCAttributeInAttributeList_5() + CHIP_ERROR TestReadTheFeatureDependentTSTATSF01COOLAttributeInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -44196,12 +44185,12 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList Error: %@", err); + NSLog(@"Read the Feature dependent(TSTAT.S.F01(COOL)) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); NextTest(); }]; @@ -44209,7 +44198,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentTSTATSF00HEATAttributeInAttributeList_6() + CHIP_ERROR TestReadTheFeatureDependentTSTATSF02OCCAttributeInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -44218,12 +44207,12 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Feature dependent(TSTAT.S.F00(HEAT)) attribute in AttributeList Error: %@", err); + NSLog(@"Read the Feature dependent(TSTAT.S.F02(OCC)) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -44231,7 +44220,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentTSTATSF01COOLTstatsf02occAttributeInAttributeList_7() + CHIP_ERROR TestReadTheFeatureDependentTSTATSF00HEATTstatsf02occAttributeInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -44240,12 +44229,12 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in AttributeList Error: %@", err); + NSLog(@"Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); NextTest(); }]; @@ -44253,7 +44242,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentTSTATSF00HEATTstatsf02occAttributeInAttributeList_8() + CHIP_ERROR TestReadTheFeatureDependentTSTATSF01COOLTstatsf02occAttributeInAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -44262,12 +44251,12 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Feature dependent(TSTAT.S.F00(HEAT) & TSTAT.S.F02(OCC)) attribute in AttributeList Error: %@", err); + NSLog(@"Read the Feature dependent(TSTAT.S.F01(COOL) & TSTAT.S.F02(OCC)) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); NextTest(); }]; @@ -44289,6 +44278,8 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 25UL)); NextTest(); @@ -44435,15 +44426,6 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - - CHIP_ERROR TestReadTheGlobalAttributeEventList_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_TSTAT_2_1 : public TestCommandBridge { @@ -44490,10 +44472,6 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attributes from DUT: LocalTemperature\n"); - if (ShouldSkip("TSTAT.S.A0000")) { - NextTest(); - return; - } err = TestReadsMandatoryAttributesFromDutLocalTemperature_1(); break; case 2: @@ -44506,7 +44484,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read Occupancy attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0002")) { + if (ShouldSkip("TSTAT.S.F02")) { NextTest(); return; } @@ -44578,7 +44556,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Reads optional attributes from DUT: OccupiedCoolingSetpoint\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -44586,7 +44564,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Reads mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -44594,7 +44572,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Read UnoccupiedCoolingSetpoint attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.F02")) { NextTest(); return; } @@ -44602,27 +44580,27 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 15: ChipLogProgress(chipTool, " ***** Test Step 15 : Read UnoccupiedHeatingSetpoint attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.F02")) { NextTest(); return; } err = TestReadUnoccupiedHeatingSetpointAttributeFromTheDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads mandatory attributes from DUT: MinHeatSetpointLimit\n"); + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads attribute from DUT: MinHeatSetpointLimit\n"); if (ShouldSkip("TSTAT.S.A0015")) { NextTest(); return; } - err = TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_16(); + err = TestReadsAttributeFromDutMinHeatSetpointLimit_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads attribute from DUT: MaxHeatSetpointLimit\n"); if (ShouldSkip("TSTAT.S.A0016")) { NextTest(); return; } - err = TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_17(); + err = TestReadsAttributeFromDutMaxHeatSetpointLimit_17(); break; case 18: ChipLogProgress(chipTool, " ***** Test Step 18 : Reads optional attributes from DUT: MinCoolSetpointLimit\n"); @@ -44642,7 +44620,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 20: ChipLogProgress(chipTool, " ***** Test Step 20 : Reads optional attributes from DUT: MinSetpointDeadBand\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } @@ -44658,237 +44636,219 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { break; case 22: ChipLogProgress(chipTool, " ***** Test Step 22 : Reads mandatory attributes from DUT: ControlSequenceOfOperation\n"); - if (ShouldSkip("TSTAT.S.A001b")) { - NextTest(); - return; - } err = TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_22(); break; case 23: ChipLogProgress(chipTool, " ***** Test Step 23 : Reads mandatory attributes from DUT: SystemMode\n"); - if (ShouldSkip("TSTAT.S.A001c")) { - NextTest(); - return; - } err = TestReadsMandatoryAttributesFromDutSystemMode_23(); break; case 24: - ChipLogProgress(chipTool, - " ***** Test Step 24 : Read AlarmMask attribute from the DUT and Verify that the DUT responds with a map8 " - "value.The value has to be in the range of 0x00 to 0x07.\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A001d")) { + ChipLogProgress(chipTool, " ***** Test Step 24 : Read ThermostatRunningMode attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A001e")) { NextTest(); return; } - err = TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24(); + err = TestReadThermostatRunningModeAttributeFromTheDut_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read ThermostatRunningMode attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A001e")) { + ChipLogProgress(chipTool, " ***** Test Step 25 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); + if (ShouldSkip("TSTAT.S.F03")) { NextTest(); return; } - err = TestReadThermostatRunningModeAttributeFromTheDut_25(); + err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); - if (ShouldSkip("TSTAT.S.A0020")) { + ChipLogProgress(chipTool, " ***** Test Step 26 : Reads optional attributes from DUT: NumberOfWeeklyTransitions\n"); + if (ShouldSkip("TSTAT.S.F03")) { NextTest(); return; } - err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26(); + err = TestReadsOptionalAttributesFromDutNumberOfWeeklyTransitions_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Reads optional attributes from DUT: NumberOfWeeklyTransitions\n"); - if (ShouldSkip("TSTAT.S.A0021")) { + ChipLogProgress(chipTool, " ***** Test Step 27 : Reads optional attributes from DUT: NumberOfDailyTransitions\n"); + if (ShouldSkip("TSTAT.S.F03")) { NextTest(); return; } - err = TestReadsOptionalAttributesFromDutNumberOfWeeklyTransitions_27(); + err = TestReadsOptionalAttributesFromDutNumberOfDailyTransitions_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Reads optional attributes from DUT: NumberOfDailyTransitions\n"); - if (ShouldSkip("TSTAT.S.A0022")) { + ChipLogProgress(chipTool, " ***** Test Step 28 : Read TemperatureSetpointHold attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0023")) { NextTest(); return; } - err = TestReadsOptionalAttributesFromDutNumberOfDailyTransitions_28(); + err = TestReadTemperatureSetpointHoldAttributeFromTheDut_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read TemperatureSetpointHold attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0023")) { + ChipLogProgress(chipTool, " ***** Test Step 29 : Read TemperatureSetpointHoldDuration attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0024")) { NextTest(); return; } - err = TestReadTemperatureSetpointHoldAttributeFromTheDut_29(); + err = TestReadTemperatureSetpointHoldDurationAttributeFromTheDut_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Read TemperatureSetpointHoldDuration attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0024")) { + ChipLogProgress(chipTool, " ***** Test Step 30 : Read ThermostatProgrammingOperationMode attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0025")) { NextTest(); return; } - err = TestReadTemperatureSetpointHoldDurationAttributeFromTheDut_30(); + err = TestReadThermostatProgrammingOperationModeAttributeFromTheDut_30(); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read ThermostatProgrammingOperationMode attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0025")) { + ChipLogProgress(chipTool, " ***** Test Step 31 : Read ThermostatRunningState attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0029")) { NextTest(); return; } - err = TestReadThermostatProgrammingOperationModeAttributeFromTheDut_31(); + err = TestReadThermostatRunningStateAttributeFromTheDut_31(); break; case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Read ThermostatRunningState attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0029")) { + ChipLogProgress(chipTool, " ***** Test Step 32 : Read SetpointChangeSource attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0030")) { NextTest(); return; } - err = TestReadThermostatRunningStateAttributeFromTheDut_32(); + err = TestReadSetpointChangeSourceAttributeFromTheDut_32(); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read SetpointChangeSource attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0030")) { + ChipLogProgress(chipTool, " ***** Test Step 33 : Read SetpointChangeAmount attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0031")) { NextTest(); return; } - err = TestReadSetpointChangeSourceAttributeFromTheDut_33(); + err = TestReadSetpointChangeAmountAttributeFromTheDut_33(); break; case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Read SetpointChangeAmount attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0031")) { + ChipLogProgress(chipTool, " ***** Test Step 34 : Read SetpointChangeSourceTimestamp attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0032")) { NextTest(); return; } - err = TestReadSetpointChangeAmountAttributeFromTheDut_34(); + err = TestReadSetpointChangeSourceTimestampAttributeFromTheDut_34(); break; case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read SetpointChangeSourceTimestamp attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0032")) { + ChipLogProgress(chipTool, " ***** Test Step 35 : Read OccupiedSetback attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.F02")) { NextTest(); return; } - err = TestReadSetpointChangeSourceTimestampAttributeFromTheDut_35(); + err = TestReadOccupiedSetbackAttributeFromTheDut_35(); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read OccupiedSetback attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0034")) { + ChipLogProgress(chipTool, " ***** Test Step 36 : Read OccupiedSetbackMin attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.F02")) { NextTest(); return; } - err = TestReadOccupiedSetbackAttributeFromTheDut_36(); + err = TestReadOccupiedSetbackMinAttributeFromTheDut_36(); break; case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Read OccupiedSetbackMin attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0035")) { + ChipLogProgress(chipTool, " ***** Test Step 37 : Read OccupiedSetbackMax attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.F02")) { NextTest(); return; } - err = TestReadOccupiedSetbackMinAttributeFromTheDut_37(); + err = TestReadOccupiedSetbackMaxAttributeFromTheDut_37(); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read OccupiedSetbackMax attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0036")) { + ChipLogProgress(chipTool, " ***** Test Step 38 : Read UnoccupiedSetback attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04")) { NextTest(); return; } - err = TestReadOccupiedSetbackMaxAttributeFromTheDut_38(); + err = TestReadUnoccupiedSetbackAttributeFromTheDut_38(); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read UnoccupiedSetback attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0037")) { + ChipLogProgress(chipTool, " ***** Test Step 39 : Read UnoccupiedSetbackMin attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04")) { NextTest(); return; } - err = TestReadUnoccupiedSetbackAttributeFromTheDut_39(); + err = TestReadUnoccupiedSetbackMinAttributeFromTheDut_39(); break; case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read UnoccupiedSetbackMin attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0038")) { + ChipLogProgress(chipTool, " ***** Test Step 40 : Read UnoccupiedSetbackMax attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F04")) { NextTest(); return; } - err = TestReadUnoccupiedSetbackMinAttributeFromTheDut_40(); + err = TestReadUnoccupiedSetbackMaxAttributeFromTheDut_40(); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read UnoccupiedSetbackMax attribute from the DUT\n"); - if (ShouldSkip("TSTAT.S.A0039")) { - NextTest(); - return; - } - err = TestReadUnoccupiedSetbackMaxAttributeFromTheDut_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Read EmergencyHeatDelta attribute from the DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 41 : Read EmergencyHeatDelta attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A003a")) { NextTest(); return; } - err = TestReadEmergencyHeatDeltaAttributeFromTheDut_42(); + err = TestReadEmergencyHeatDeltaAttributeFromTheDut_41(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read ACType attribute from the DUT\n"); + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Read ACType attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0040")) { NextTest(); return; } - err = TestReadACTypeAttributeFromTheDut_43(); + err = TestReadACTypeAttributeFromTheDut_42(); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read ACCapacity attribute from the DUT\n"); + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read ACCapacity attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0041")) { NextTest(); return; } - err = TestReadACCapacityAttributeFromTheDut_44(); + err = TestReadACCapacityAttributeFromTheDut_43(); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read ACRefrigerantType attribute from the DUT\n"); + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Read ACRefrigerantType attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0042")) { NextTest(); return; } - err = TestReadACRefrigerantTypeAttributeFromTheDut_45(); + err = TestReadACRefrigerantTypeAttributeFromTheDut_44(); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read ACCompressorType attribute from the DUT\n"); + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read ACCompressorType attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0043")) { NextTest(); return; } - err = TestReadACCompressorTypeAttributeFromTheDut_46(); + err = TestReadACCompressorTypeAttributeFromTheDut_45(); break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Read ACErrorCode attribute from the DUT\n"); + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read ACErrorCode attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0044")) { NextTest(); return; } - err = TestReadACErrorCodeAttributeFromTheDut_47(); + err = TestReadACErrorCodeAttributeFromTheDut_46(); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read ACLouverPosition attribute from the DUT\n"); + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Read ACLouverPosition attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0045")) { NextTest(); return; } - err = TestReadACLouverPositionAttributeFromTheDut_48(); + err = TestReadACLouverPositionAttributeFromTheDut_47(); break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read ACCoilTemperature attribute from the DUT\n"); + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read ACCoilTemperature attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0046")) { NextTest(); return; } - err = TestReadACCoilTemperatureAttributeFromTheDut_49(); + err = TestReadACCoilTemperatureAttributeFromTheDut_48(); break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read ACCapacityFormat attribute from the DUT\n"); + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read ACCapacityFormat attribute from the DUT\n"); if (ShouldSkip("TSTAT.S.A0047")) { NextTest(); return; } - err = TestReadACCapacityFormatAttributeFromTheDut_50(); + err = TestReadACCapacityFormatAttributeFromTheDut_49(); break; } @@ -45051,9 +45011,6 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 50: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -45067,7 +45024,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 51; + const uint16_t mTestCount = 50; chip::Optional mNodeId; chip::Optional mCluster; @@ -45356,8 +45313,8 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], -27315)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], 1600)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 3200)); NextTest(); }]; @@ -45379,8 +45336,8 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], -27315)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 3000)); NextTest(); }]; @@ -45403,8 +45360,8 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("unoccupiedCoolingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("unoccupiedCoolingSetpoint", [value shortValue], -27315)); - VerifyOrReturn(CheckConstraintMaxValue("unoccupiedCoolingSetpoint", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("unoccupiedCoolingSetpoint", [value shortValue], 1600)); + VerifyOrReturn(CheckConstraintMaxValue("unoccupiedCoolingSetpoint", [value shortValue], 3200)); NextTest(); }]; @@ -45427,8 +45384,8 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("unoccupiedHeatingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("unoccupiedHeatingSetpoint", [value shortValue], -27315)); - VerifyOrReturn(CheckConstraintMaxValue("unoccupiedHeatingSetpoint", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("unoccupiedHeatingSetpoint", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMaxValue("unoccupiedHeatingSetpoint", [value shortValue], 3000)); NextTest(); }]; @@ -45436,7 +45393,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_16() + CHIP_ERROR TestReadsAttributeFromDutMinHeatSetpointLimit_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45445,13 +45402,13 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err); + NSLog(@"Reads attribute from DUT: MinHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], -27315)); - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 3000)); NextTest(); }]; @@ -45459,7 +45416,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_17() + CHIP_ERROR TestReadsAttributeFromDutMaxHeatSetpointLimit_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45468,7 +45425,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err); + NSLog(@"Reads attribute from DUT: MaxHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -45621,17 +45578,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24() - { - 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 TestReadThermostatRunningModeAttributeFromTheDut_25() + CHIP_ERROR TestReadThermostatRunningModeAttributeFromTheDut_24() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45646,7 +45593,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("thermostatRunningMode", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("thermostatRunningMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("thermostatRunningMode", [value unsignedCharValue], 4U)); + VerifyOrReturn(CheckConstraintMaxValue("thermostatRunningMode", [value unsignedCharValue], 9U)); NextTest(); }]; @@ -45654,7 +45601,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_25() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45677,7 +45624,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributesFromDutNumberOfWeeklyTransitions_27() + CHIP_ERROR TestReadsOptionalAttributesFromDutNumberOfWeeklyTransitions_26() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45701,7 +45648,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributesFromDutNumberOfDailyTransitions_28() + CHIP_ERROR TestReadsOptionalAttributesFromDutNumberOfDailyTransitions_27() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45724,7 +45671,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTemperatureSetpointHoldAttributeFromTheDut_29() + CHIP_ERROR TestReadTemperatureSetpointHoldAttributeFromTheDut_28() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45747,7 +45694,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTemperatureSetpointHoldDurationAttributeFromTheDut_30() + CHIP_ERROR TestReadTemperatureSetpointHoldDurationAttributeFromTheDut_29() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45776,7 +45723,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadThermostatProgrammingOperationModeAttributeFromTheDut_31() + CHIP_ERROR TestReadThermostatProgrammingOperationModeAttributeFromTheDut_30() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45800,7 +45747,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadThermostatRunningStateAttributeFromTheDut_32() + CHIP_ERROR TestReadThermostatRunningStateAttributeFromTheDut_31() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45823,7 +45770,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSetpointChangeSourceAttributeFromTheDut_33() + CHIP_ERROR TestReadSetpointChangeSourceAttributeFromTheDut_32() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45846,7 +45793,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSetpointChangeAmountAttributeFromTheDut_34() + CHIP_ERROR TestReadSetpointChangeAmountAttributeFromTheDut_33() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45872,7 +45819,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSetpointChangeSourceTimestampAttributeFromTheDut_35() + CHIP_ERROR TestReadSetpointChangeSourceTimestampAttributeFromTheDut_34() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45893,7 +45840,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOccupiedSetbackAttributeFromTheDut_36() + CHIP_ERROR TestReadOccupiedSetbackAttributeFromTheDut_35() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45919,7 +45866,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOccupiedSetbackMinAttributeFromTheDut_37() + CHIP_ERROR TestReadOccupiedSetbackMinAttributeFromTheDut_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45945,7 +45892,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOccupiedSetbackMaxAttributeFromTheDut_38() + CHIP_ERROR TestReadOccupiedSetbackMaxAttributeFromTheDut_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45971,7 +45918,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadUnoccupiedSetbackAttributeFromTheDut_39() + CHIP_ERROR TestReadUnoccupiedSetbackAttributeFromTheDut_38() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45997,7 +45944,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadUnoccupiedSetbackMinAttributeFromTheDut_40() + CHIP_ERROR TestReadUnoccupiedSetbackMinAttributeFromTheDut_39() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46023,7 +45970,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadUnoccupiedSetbackMaxAttributeFromTheDut_41() + CHIP_ERROR TestReadUnoccupiedSetbackMaxAttributeFromTheDut_40() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46049,7 +45996,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEmergencyHeatDeltaAttributeFromTheDut_42() + CHIP_ERROR TestReadEmergencyHeatDeltaAttributeFromTheDut_41() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46072,7 +46019,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACTypeAttributeFromTheDut_43() + CHIP_ERROR TestReadACTypeAttributeFromTheDut_42() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46095,7 +46042,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACCapacityAttributeFromTheDut_44() + CHIP_ERROR TestReadACCapacityAttributeFromTheDut_43() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46118,7 +46065,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACRefrigerantTypeAttributeFromTheDut_45() + CHIP_ERROR TestReadACRefrigerantTypeAttributeFromTheDut_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46141,7 +46088,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACCompressorTypeAttributeFromTheDut_46() + CHIP_ERROR TestReadACCompressorTypeAttributeFromTheDut_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46164,7 +46111,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACErrorCodeAttributeFromTheDut_47() + CHIP_ERROR TestReadACErrorCodeAttributeFromTheDut_46() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46184,7 +46131,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACLouverPositionAttributeFromTheDut_48() + CHIP_ERROR TestReadACLouverPositionAttributeFromTheDut_47() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46207,7 +46154,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACCoilTemperatureAttributeFromTheDut_49() + CHIP_ERROR TestReadACCoilTemperatureAttributeFromTheDut_48() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46233,7 +46180,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACCapacityFormatAttributeFromTheDut_50() + CHIP_ERROR TestReadACCapacityFormatAttributeFromTheDut_49() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46305,7 +46252,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " "within range\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46314,7 +46261,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46323,7 +46270,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46331,17 +46278,17 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 4: ChipLogProgress( - chipTool, " ***** Test Step 4 : Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + chipTool, " ***** Test Step 4 : Writes OccupiedCoolingSetpoint to value below the ABSMinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesOccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_4(); + err = TestWritesOccupiedCoolingSetpointToValueBelowTheABSMinCoolSetpointLimit_4(); break; case 5: ChipLogProgress( chipTool, " ***** Test Step 5 : Writes OccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46350,7 +46297,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 6: ChipLogProgress( chipTool, " ***** Test Step 6 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01 && !TSTAT.S.F05")) { NextTest(); return; } @@ -46368,7 +46315,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 8: ChipLogProgress( chipTool, " ***** Test Step 8 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46378,7 +46325,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 9 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " "within range\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -46387,7 +46334,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -46396,7 +46343,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -46405,7 +46352,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 12: ChipLogProgress( chipTool, " ***** Test Step 12 : Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -46414,7 +46361,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 13: ChipLogProgress( chipTool, " ***** Test Step 13 : Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -46423,7 +46370,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 14: ChipLogProgress( chipTool, " ***** Test Step 14 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -46450,7 +46397,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 17: ChipLogProgress( chipTool, " ***** Test Step 17 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } @@ -46460,7 +46407,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 18 : Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " "within range\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } @@ -46469,7 +46416,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 19: ChipLogProgress(chipTool, " ***** Test Step 19 : Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } @@ -46479,7 +46426,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 20 : Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint " "attribute\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } @@ -46487,26 +46434,26 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 21: ChipLogProgress( - chipTool, " ***** Test Step 21 : Writes UnoccupiedCoolingSetpoint to value below the MinHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + chipTool, " ***** Test Step 21 : Writes UnoccupiedCoolingSetpoint to value below the MinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinHeatSetpointLimit_21(); + err = TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_21(); break; case 22: ChipLogProgress( - chipTool, " ***** Test Step 22 : Writes UnoccupiedCoolingSetpoint to value above the MaxHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + chipTool, " ***** Test Step 22 : Writes UnoccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxHeatSetpointLimit_22(); + err = TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxCoolSetpointLimit_22(); break; case 23: ChipLogProgress(chipTool, " ***** Test Step 23 : Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } @@ -46515,7 +46462,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 24: ChipLogProgress(chipTool, " ***** Test Step 24 : Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0013")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } @@ -46525,7 +46472,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 25 : Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " "within range\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46534,7 +46481,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 26: ChipLogProgress(chipTool, " ***** Test Step 26 : Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46544,7 +46491,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 27 : Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint " "attribute\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46553,7 +46500,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 28: ChipLogProgress( chipTool, " ***** Test Step 28 : Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46562,7 +46509,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 29: ChipLogProgress( chipTool, " ***** Test Step 29 : Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46571,7 +46518,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 30: ChipLogProgress(chipTool, " ***** Test Step 30 : Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46580,7 +46527,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 31: ChipLogProgress(chipTool, " ***** Test Step 31 : Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("TSTAT.S.A0014")) { + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } @@ -46590,7 +46537,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 32 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within " "range\n"); - if (ShouldSkip("TSTAT.S.A0015")) { + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } @@ -46599,7 +46546,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 33: ChipLogProgress(chipTool, " ***** Test Step 33 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0015")) { + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } @@ -46608,481 +46555,481 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 34: ChipLogProgress(chipTool, " ***** Test Step 34 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0015")) { + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_34(); break; case 35: - ChipLogProgress( - chipTool, " ***** Test Step 35 : Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0015")) { + ChipLogProgress(chipTool, " ***** Test Step 35 : Writes a value back that is different but violates the deadband\n"); + if (ShouldSkip("TSTAT.S.A0015 && TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_35(); + err = TestWritesAValueBackThatIsDifferentButViolatesTheDeadband_35(); break; case 36: ChipLogProgress( - chipTool, " ***** Test Step 36 : Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0015")) { + chipTool, " ***** Test Step 36 : Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } - err = TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_36(); + err = TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_36(); break; case 37: ChipLogProgress( - chipTool, " ***** Test Step 37 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0015")) { + chipTool, " ***** Test Step 37 : Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_37(); + err = TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_37(); break; case 38: ChipLogProgress( - chipTool, " ***** Test Step 38 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0015")) { + chipTool, " ***** Test Step 38 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_38(); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_38(); break; case 39: - ChipLogProgress(chipTool, - " ***** Test Step 39 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0016")) { + ChipLogProgress( + chipTool, " ***** Test Step 39 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_39(); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_39(); break; case 40: - ChipLogProgress( - chipTool, " ***** Test Step 40 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 40 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_40(); + err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_40(); break; case 41: ChipLogProgress( - chipTool, " ***** Test Step 41 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT && TSTAT.S.F05")) { + chipTool, " ***** Test Step 41 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_41(); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_41(); break; case 42: - ChipLogProgress(chipTool, - " ***** Test Step 42 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0016")) { + ChipLogProgress( + chipTool, " ***** Test Step 42 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.A0015 && TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_42(); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_42(); break; case 43: ChipLogProgress(chipTool, - " ***** Test Step 43 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0016")) { + " ***** Test Step 43 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_43(); + err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_43(); break; case 44: - ChipLogProgress( - chipTool, " ***** Test Step 44 : Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0016")) { + ChipLogProgress(chipTool, + " ***** Test Step 44 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_44(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_44(); break; case 45: ChipLogProgress( - chipTool, " ***** Test Step 45 : Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0016")) { + chipTool, " ***** Test Step 45 : Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016")) { NextTest(); return; } - err = TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_45(); + err = TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_45(); break; case 46: ChipLogProgress( - chipTool, " ***** Test Step 46 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0016")) { + chipTool, " ***** Test Step 46 : Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_46(); + err = TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_46(); break; case 47: ChipLogProgress( - chipTool, " ***** Test Step 47 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0016")) { + chipTool, " ***** Test Step 47 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_47(); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_47(); break; case 48: - ChipLogProgress(chipTool, - " ***** Test Step 48 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("TSTAT.S.A0017")) { + ChipLogProgress( + chipTool, " ***** Test Step 48 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_48(); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_48(); break; case 49: ChipLogProgress(chipTool, - " ***** Test Step 49 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0017")) { + " ***** Test Step 49 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_49(); + err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_49(); break; case 50: ChipLogProgress(chipTool, - " ***** Test Step 50 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0017")) { + " ***** Test Step 50 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_50(); + err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_50(); break; case 51: - ChipLogProgress( - chipTool, " ***** Test Step 51 : Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0017")) { + ChipLogProgress(chipTool, + " ***** Test Step 51 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_51(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_51(); break; case 52: ChipLogProgress( - chipTool, " ***** Test Step 52 : Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0017")) { + chipTool, " ***** Test Step 52 : Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_52(); + err = TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_52(); break; case 53: ChipLogProgress( - chipTool, " ***** Test Step 53 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0017")) { + chipTool, " ***** Test Step 53 : Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_53(); + err = TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_53(); break; case 54: ChipLogProgress( - chipTool, " ***** Test Step 54 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0017")) { + chipTool, " ***** Test Step 54 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_54(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_54(); break; case 55: ChipLogProgress( - chipTool, " ***** Test Step 55 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { + chipTool, " ***** Test Step 55 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_55(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_55(); break; case 56: - ChipLogProgress(chipTool, - " ***** Test Step 56 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("TSTAT.S.A0018")) { + ChipLogProgress( + chipTool, " ***** Test Step 56 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_56(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_56(); break; case 57: ChipLogProgress(chipTool, - " ***** Test Step 57 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0018")) { + " ***** Test Step 57 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_57(); + err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_57(); break; case 58: ChipLogProgress(chipTool, - " ***** Test Step 58 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0018")) { + " ***** Test Step 58 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_58(); + err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_58(); break; case 59: - ChipLogProgress( - chipTool, " ***** Test Step 59 : Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0018")) { + ChipLogProgress(chipTool, + " ***** Test Step 59 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_59(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_59(); break; case 60: ChipLogProgress( - chipTool, " ***** Test Step 60 : Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); - if (ShouldSkip("TSTAT.S.A0018")) { + chipTool, " ***** Test Step 60 : Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018")) { NextTest(); return; } - err = TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_60(); + err = TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_60(); break; case 61: ChipLogProgress( - chipTool, " ***** Test Step 61 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0018")) { + chipTool, " ***** Test Step 61 : Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_61(); + err = TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_61(); break; case 62: ChipLogProgress( - chipTool, " ***** Test Step 62 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("TSTAT.S.A0018")) { + chipTool, " ***** Test Step 62 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_62(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_62(); break; case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Writes (sets back) default value of MinHeatSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0015")) { + ChipLogProgress( + chipTool, " ***** Test Step 63 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018")) { NextTest(); return; } - err = TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_63(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_63(); break; case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Writes (sets back)default value of MaxHeatSetpointLimit\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0016")) { + ChipLogProgress(chipTool, " ***** Test Step 64 : Writes (sets back) default value of MinHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0015")) { NextTest(); return; } - err = TestWritesSetsBackdefaultValueOfMaxHeatSetpointLimit_64(); + err = TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_64(); break; case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Writes MaxHeatSetpointLimit That meets the deadband of 2.5C\n"); - if (ShouldSkip("TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05")) { + ChipLogProgress(chipTool, " ***** Test Step 65 : Writes (sets back)default value of MaxHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0016 &&!TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMaxHeatSetpointLimitThatMeetsTheDeadbandOf25c_65(); + err = TestWritesSetsBackdefaultValueOfMaxHeatSetpointLimit_65(); break; case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Writes (sets back) default value of MinCoolSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0017")) { + ChipLogProgress(chipTool, " ***** Test Step 66 : Writes MaxHeatSetpointLimit That meets the deadband of 2.5C\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0016 &&!TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_66(); + err = TestWritesMaxHeatSetpointLimitThatMeetsTheDeadbandOf25c_66(); break; case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Writes (sets back) default value of MaxCoolSetpointLimit\n"); - if (ShouldSkip("TSTAT.S.A0018")) { + ChipLogProgress(chipTool, " ***** Test Step 67 : Writes (sets back) default value of MinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0017")) { NextTest(); return; } - err = TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_67(); + err = TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_67(); break; case 68: - ChipLogProgress(chipTool, - " ***** Test Step 68 : Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + ChipLogProgress(chipTool, " ***** Test Step 68 : Writes (sets back) default value of MaxCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && TSTAT.S.A0018")) { NextTest(); return; } - err = TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_68(); + err = TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_68(); break; case 69: ChipLogProgress(chipTool, - " ***** Test Step 69 : Writes a value back that is different but valid for MinSetpointDeadBand attribute\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + " ***** Test Step 69 : Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_69(); + err = TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_69(); break; case 70: ChipLogProgress(chipTool, - " ***** Test Step 70 : Reads it back again to confirm the successful write of MinSetpointDeadBand attribute\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + " ***** Test Step 70 : Writes a value back that is different but valid for MinSetpointDeadBand attribute\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_70(); + err = TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_70(); break; case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Writes the value below MinSetpointDeadBand\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + ChipLogProgress(chipTool, + " ***** Test Step 71 : Reads it back again to confirm the successful write of MinSetpointDeadBand attribute\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheValueBelowMinSetpointDeadBand_71(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_71(); break; case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Writes the value above MinSetpointDeadBand \n"); - if (ShouldSkip("TSTAT.S.A0019")) { + ChipLogProgress(chipTool, " ***** Test Step 72 : Writes the value below MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheValueAboveMinSetpointDeadBand_72(); + err = TestWritesTheValueBelowMinSetpointDeadBand_72(); break; case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Writes the min limit of MinSetpointDeadBand\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + ChipLogProgress(chipTool, " ***** Test Step 73 : Writes the value above MinSetpointDeadBand \n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheMinLimitOfMinSetpointDeadBand_73(); + err = TestWritesTheValueAboveMinSetpointDeadBand_73(); break; case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Writes the max limit of MinSetpointDeadBand\n"); - if (ShouldSkip("TSTAT.S.A0019")) { + ChipLogProgress(chipTool, " ***** Test Step 74 : Writes the min limit of MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheMaxLimitOfMinSetpointDeadBand_74(); + err = TestWritesTheMinLimitOfMinSetpointDeadBand_74(); break; case 75: - ChipLogProgress(chipTool, - " ***** Test Step 75 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); - if (ShouldSkip("TSTAT.S.A001b")) { + ChipLogProgress(chipTool, " ***** Test Step 75 : Writes the max limit of MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_75(); + err = TestWritesTheMaxLimitOfMinSetpointDeadBand_75(); break; case 76: - ChipLogProgress( - chipTool, " ***** Test Step 76 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); - if (ShouldSkip("TSTAT.S.A001b")) { + ChipLogProgress(chipTool, + " ***** Test Step 76 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { NextTest(); return; } - err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_76(); + err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_76(); break; case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Read it back again to confirm the successful write\n"); - if (ShouldSkip("TSTAT.S.A001b")) { + ChipLogProgress( + chipTool, " ***** Test Step 77 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { NextTest(); return; } - err = TestReadItBackAgainToConfirmTheSuccessfulWrite_77(); + err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_77(); break; case 78: - ChipLogProgress(chipTool, - " ***** Test Step 78 : Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet deadband " - "constraint\n"); - if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && TSTAT.S.F05")) { + ChipLogProgress(chipTool, " ***** Test Step 78 : Read it back again to confirm the successful write\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesMaxHeatSetpointLimitAttributeToDefaultValueOf2950ToMeetDeadbandConstraint_78(); + err = TestReadItBackAgainToConfirmTheSuccessfulWrite_78(); break; case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("TSTAT.S.F01")) { + ChipLogProgress(chipTool, + " ***** Test Step 79 : Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet deadband " + "constraint\n"); + if (ShouldSkip("TSTAT.S.F00 && TSTAT.S.A0015 && TSTAT.S.F05")) { NextTest(); return; } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_79(); + err = TestWritesMaxHeatSetpointLimitAttributeToDefaultValueOf2950ToMeetDeadbandConstraint_79(); break; case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 80 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_80(); + err = TestSetsOccupiedCoolingSetpointToDefaultValue_80(); break; case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 81 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_81(); + err = TestSetsOccupiedHeatingSetpointToDefaultValue_81(); break; case 82: - ChipLogProgress( - chipTool, " ***** Test Step 82 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 82 : Sends SetpointRaise Command Heat Only\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_82(); + err = TestSendsSetpointRaiseCommandHeatOnly_82(); break; case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012")) { + ChipLogProgress( + chipTool, " ***** Test Step 83 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_83(); + err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_83(); break; case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 84 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_84(); + err = TestSetsOccupiedHeatingSetpointToDefaultValue_84(); break; case 85: - ChipLogProgress( - chipTool, " ***** Test Step 85 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 85 : Sends SetpointRaise Command Heat Only\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_85(); + err = TestSendsSetpointRaiseCommandHeatOnly_85(); break; case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + ChipLogProgress( + chipTool, " ***** Test Step 86 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_86(); + err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_86(); break; case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 87 : Sends SetpointRaise Command Cool Only\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_87(); + err = TestSendsSetpointRaiseCommandCoolOnly_87(); break; case 88: ChipLogProgress( chipTool, " ***** Test Step 88 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -47090,24 +47037,24 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 89: ChipLogProgress(chipTool, " ***** Test Step 89 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } err = TestSetsOccupiedCoolingSetpointToDefaultValue_89(); break; case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 90 : Sends SetpointRaise Command Cool Only\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_90(); + err = TestSendsSetpointRaiseCommandCoolOnly_90(); break; case 91: ChipLogProgress( chipTool, " ***** Test Step 91 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -47115,7 +47062,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 92: ChipLogProgress(chipTool, " ***** Test Step 92 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -47123,24 +47070,24 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 93: ChipLogProgress(chipTool, " ***** Test Step 93 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } err = TestSetsOccupiedHeatingSetpointToDefaultValue_93(); break; case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 94 : Sends SetpointRaise Command Heat & Cool\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_94(); + err = TestSendsSetpointRaiseCommandHeatCool_94(); break; case 95: ChipLogProgress( chipTool, " ***** Test Step 95 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -47149,7 +47096,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 96: ChipLogProgress( chipTool, " ***** Test Step 96 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -47157,7 +47104,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 97: ChipLogProgress(chipTool, " ***** Test Step 97 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -47165,24 +47112,24 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 98: ChipLogProgress(chipTool, " ***** Test Step 98 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } err = TestSetsOccupiedHeatingSetpointToDefaultValue_98(); break; case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.C00.Rsp && TSTAT.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 99 : Sends SetpointRaise Command Heat & Cool\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_99(); + err = TestSendsSetpointRaiseCommandHeatCool_99(); break; case 100: ChipLogProgress( chipTool, " ***** Test Step 100 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0011")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -47191,7 +47138,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 101: ChipLogProgress( chipTool, " ***** Test Step 101 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && TSTAT.S.A0012")) { + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } @@ -47260,7 +47207,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47320,7 +47267,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47332,22 +47279,22 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47362,13 +47309,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 51: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 52: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 53: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47386,13 +47333,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 59: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 60: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 61: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 62: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47422,13 +47369,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 71: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 72: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 73: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 74: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47613,7 +47560,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesOccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_4() + CHIP_ERROR TestWritesOccupiedCoolingSetpointToValueBelowTheABSMinCoolSetpointLimit_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47625,8 +47572,8 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { occupiedCoolingSetpointArgument = [NSNumber numberWithShort:30]; [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit " - @"Error: %@", + NSLog(@"Writes OccupiedCoolingSetpoint to value below the " + @"ABSMinCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", @@ -47671,11 +47618,26 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestWritesTheCoolingSetpointBelowTheHeatingSetpointWhenAutoIsEnabled_7() @@ -47932,11 +47894,30 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_17() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] + ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestReadsUnoccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_18() @@ -48019,7 +48000,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinHeatSetpointLimit_21() + CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48032,7 +48013,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster writeAttributeUnoccupiedCoolingSetpointWithValue:unoccupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes UnoccupiedCoolingSetpoint to value below the " - @"MinHeatSetpointLimit Error: %@", + @"MinCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", @@ -48047,7 +48028,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxHeatSetpointLimit_22() + CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxCoolSetpointLimit_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48060,7 +48041,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster writeAttributeUnoccupiedCoolingSetpointWithValue:unoccupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes UnoccupiedCoolingSetpoint to value above the " - @"MaxHeatSetpointLimit Error: %@", + @"MaxCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", @@ -48338,23 +48319,80 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_33() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:800]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_34() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MinHeatSetpointLimit", actualValue, 800)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButViolatesTheDeadband_35() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster + writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but violates the deadband Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] + ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_35() + CHIP_ERROR TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48383,7 +48421,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_36() + CHIP_ERROR TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48412,7 +48450,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_37() + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_38() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48436,25 +48474,60 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_38() + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_39() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_39() + CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_40() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxHeatSetpointLimit", actualValue, 3000)); + } + + VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", [value shortValue], 3000)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_40() + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_41() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48478,7 +48551,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_41() + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_42() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48506,7 +48579,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_42() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_43() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48530,7 +48603,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_43() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48554,7 +48627,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_44() + CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48583,7 +48656,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_45() + CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_46() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48612,7 +48685,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_46() + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_47() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48636,16 +48709,31 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_47() + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_48() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_48() + CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_49() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48674,7 +48762,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_49() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_50() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48698,7 +48786,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_50() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_51() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48722,7 +48810,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_51() + CHIP_ERROR TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_52() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48751,7 +48839,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_52() + CHIP_ERROR TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_53() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48779,7 +48867,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_53() + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_54() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48803,7 +48891,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_54() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_55() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48827,7 +48915,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_55() + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_56() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48851,7 +48939,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_56() + CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_57() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48880,25 +48968,55 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_57() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_58() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MaxCoolSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_58() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_59() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxCoolSetpointLimit", actualValue, 2000)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_59() + CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_60() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48927,7 +49045,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_60() + CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_61() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48955,16 +49073,31 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_61() + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_62() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_62() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_63() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48988,7 +49121,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_63() + CHIP_ERROR TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_64() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49010,16 +49143,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackdefaultValueOfMaxHeatSetpointLimit_64() + CHIP_ERROR TestWritesSetsBackdefaultValueOfMaxHeatSetpointLimit_65() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back)default value of MaxHeatSetpointLimit Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxHeatSetpointLimitThatMeetsTheDeadbandOf25c_65() + CHIP_ERROR TestWritesMaxHeatSetpointLimitThatMeetsTheDeadbandOf25c_66() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49041,7 +49187,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_66() + CHIP_ERROR TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_67() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49063,7 +49209,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_67() + CHIP_ERROR TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_68() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49085,7 +49231,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_68() + CHIP_ERROR TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_69() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49114,7 +49260,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_69() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_70() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49138,7 +49284,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_70() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_71() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49162,7 +49308,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheValueBelowMinSetpointDeadBand_71() + CHIP_ERROR TestWritesTheValueBelowMinSetpointDeadBand_72() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49188,7 +49334,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheValueAboveMinSetpointDeadBand_72() + CHIP_ERROR TestWritesTheValueAboveMinSetpointDeadBand_73() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49214,7 +49360,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheMinLimitOfMinSetpointDeadBand_73() + CHIP_ERROR TestWritesTheMinLimitOfMinSetpointDeadBand_74() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49236,7 +49382,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheMaxLimitOfMinSetpointDeadBand_74() + CHIP_ERROR TestWritesTheMaxLimitOfMinSetpointDeadBand_75() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49258,7 +49404,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_75() + CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_76() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49287,7 +49433,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_76() + CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_77() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49311,7 +49457,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_77() + CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_78() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49336,7 +49482,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxHeatSetpointLimitAttributeToDefaultValueOf2950ToMeetDeadbandConstraint_78() + CHIP_ERROR TestWritesMaxHeatSetpointLimitAttributeToDefaultValueOf2950ToMeetDeadbandConstraint_79() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49360,7 +49506,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_79() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_80() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49382,16 +49528,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_80() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_81() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_81() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatOnly_82() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49404,7 +49563,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:-30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49414,7 +49573,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_82() + CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_83() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49438,16 +49597,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_83() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_84() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_84() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatOnly_85() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49460,7 +49632,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49470,7 +49642,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_85() + CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_86() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49485,7 +49657,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 30)); + VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 2300)); } NextTest(); @@ -49494,29 +49666,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_86() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendsSetpointRaiseCommand_87() + CHIP_ERROR TestSendsSetpointRaiseCommandCoolOnly_87() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49529,7 +49679,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:-30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Cool Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49585,7 +49735,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_90() + CHIP_ERROR TestSendsSetpointRaiseCommandCoolOnly_90() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49598,7 +49748,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Cool Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49656,14 +49806,27 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_93() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_94() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatCool_94() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49676,7 +49839,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:-30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat & Cool Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49758,14 +49921,27 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_98() { - 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"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_99() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatCool_99() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49778,7 +49954,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat & Cool Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index fcf8bb7ed5c0cc..c4d0febde581c8 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -78,14 +78,17 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 1 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 2 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ + \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { \ - (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 \ - } /* HourFormat */ \ + (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 \ + } /* TemperatureUnit */ \ } #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask @@ -180,8 +183,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* TemperatureUnit */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index ee80e845d22462..9a7871ad6eaeb8 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -78,13 +78,16 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 10 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 11 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ + \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ { (uint16_t) 0xA28, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedCoolingSetpoint */ \ { (uint16_t) 0x7D0, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedHeatingSetpoint */ \ @@ -206,8 +209,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* TemperatureUnit */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -521,23 +525,23 @@ { 0x00000005, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(1600) }, /* AbsMinCoolSetpointLimit */ \ { 0x00000006, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(3200) }, /* AbsMaxCoolSetpointLimit */ \ { 0x00000011, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* OccupiedCoolingSetpoint */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* OccupiedCoolingSetpoint */ \ { 0x00000012, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* OccupiedHeatingSetpoint */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* OccupiedHeatingSetpoint */ \ { 0x00000015, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* MinHeatSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* MinHeatSetpointLimit */ \ { 0x00000016, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* MaxHeatSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* MaxHeatSetpointLimit */ \ { 0x00000017, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* MinCoolSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* MinCoolSetpointLimit */ \ { 0x00000018, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* MaxCoolSetpointLimit */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(7) }, /* MaxCoolSetpointLimit */ \ { 0x00000019, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(7) }, /* MinSetpointDeadBand */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(8) }, /* MinSetpointDeadBand */ \ { 0x0000001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(8) }, /* ControlSequenceOfOperation */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* ControlSequenceOfOperation */ \ { 0x0000001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* SystemMode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* SystemMode */ \ { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartOfWeek */ \ { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* NumberOfWeeklyTransitions */ \ { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* NumberOfDailyTransitions */ \ diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 4c2e573255fe61..c1abffc5229436 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -134,13 +134,16 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 2 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 3 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ + \ /* Endpoint: 2, Cluster: Level Control (server) */ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 } /* options */ \ } @@ -246,8 +249,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* TemperatureUnit */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -594,7 +598,7 @@ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* max frequency */ \ { 0x0000000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* options */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* options */ \ { 0x00000010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x0000) }, /* on off transition time */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 91305d7f76281c..39b8327c8f5b6b 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -78,13 +78,16 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 4 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 5 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ + \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ \ @@ -199,8 +202,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* TemperatureUnit */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -473,7 +477,7 @@ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* StartUpOnOff */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* StartUpOnOff */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ @@ -486,7 +490,7 @@ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* max frequency */ \ { 0x0000000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* options */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* options */ \ { 0x00000010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x0000) }, /* on off transition time */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -505,7 +509,7 @@ \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { 0x00000051, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* out of service */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* out of service */ \ { 0x00000055, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* present value */ \ { 0x0000006F, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* status flags */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \