From 04d7a3e3385ac57f40156e12464877df4fff53e8 Mon Sep 17 00:00:00 2001 From: beckerzito Date: Thu, 29 Feb 2024 10:36:37 -0300 Subject: [PATCH 1/3] Updated OnOff Test script according most recent test plan. (#32306) * updated on off test scripts according test plan * added missing CI Pics * updated cluster revision * Restyled by prettier-yaml * update label * Restyled by prettier-yaml * Added missing pics * fix yaml --------- Co-authored-by: Restyled.io --- .../all-clusters-app.matter | 4 +- .../all-clusters-common/all-clusters-app.zap | 6 +- src/app/tests/suites/certification/PICS.yaml | 3 + .../suites/certification/Test_TC_OO_1_1.yaml | 90 ++++++++++++++++--- .../suites/certification/Test_TC_OO_2_1.yaml | 52 ++++++++++- .../suites/certification/Test_TC_OO_2_2.yaml | 59 ++++++++---- .../tests/suites/certification/ci-pics-values | 1 + 7 files changed, 183 insertions(+), 32 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 5a7b510b05b0c8..89823f18e7896f 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 @@ -7761,7 +7761,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0x0001; - ram attribute clusterRevision default = 5; + ram attribute clusterRevision default = 6; handle command Off; handle command On; @@ -9134,7 +9134,7 @@ endpoint 2 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0x0001; - ram attribute clusterRevision default = 5; + ram attribute clusterRevision default = 6; handle command Off; handle command On; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 21bcfee37b5e0d..9dde80962f52f1 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -6659,7 +6659,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6895,7 +6895,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -23993,7 +23993,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 49554c37f4e3b6..d23a1db8cdc6cb 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -5294,6 +5294,9 @@ PICS: - label: "Device has Deadfront behaviour" id: OO.S.F01 + - label: "Device has OffOnly feature" + id: OO.S.F02 + # # server / manually # diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml index 400bf68a776788..5b44953041dac7 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml @@ -38,38 +38,75 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 5 + value: 6 constraints: type: int16u - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." + - label: + "Step 3a: Given OO.S.F00(LT) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: ( !OO.S.F00 && !OO.S.F01 ) + PICS: ( OO.S.F00 && !OO.S.F02 ) response: - value: 0 constraints: type: bitmap32 - + hasMasksSet: [0x1] - label: "Step 3b: Given OO.S.F00(LT) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: OO.S.F00 + PICS: ( !( OO.S.F00 && !OO.S.F02 ) ) response: constraints: type: bitmap32 - hasMasksSet: [0x1] + hasMasksClear: [0x1] - label: "Step 3c: Given OO.S.F01(DF) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: OO.S.F01 + PICS: ( OO.S.F01 && !OO.S.F02 ) response: constraints: type: bitmap32 hasMasksSet: [0x2] + - label: + "Step 3d: Given OO.S.F01(DF) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( !( OO.S.F01 && !OO.S.F02 ) ) + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Step 3e: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap + attribute." + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4] + - label: + "Step 3f: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap + attribute." + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( !( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) ) + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + - label: "Step 3g: All remaining shall be zero" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksClear: [0xFFFFFFF8] - label: "Step 4a: TH reads from the DUT the AttributeList attribute." PICS: PICS_EVENT_LIST_ENABLED @@ -115,10 +152,32 @@ tests: response: constraints: type: list - contains: [0, 1, 2] + contains: [0] + + - label: + "Step 6b: TH reads the feature dependent(OO.S.F02) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: ( !OO.S.F02 ) + response: + constraints: + type: list + contains: [1, 2] + + - label: + "Step 6c: TH reads the feature dependent(OO.S.F02) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: OO.S.F02 + response: + constraints: + type: list + excludes: [1, 2] - label: - "Step 6b: TH reads the feature dependent(OO.S.F00) commands in + "Step 6d: TH reads the feature dependent(OO.S.F00) commands in AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -128,6 +187,17 @@ tests: type: list contains: [64, 65, 66] + - label: + "Step 6e: TH reads the feature dependent(OO.S.F00) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: ( !OO.S.F00 ) + response: + constraints: + type: list + excludes: [64, 65, 66] + - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml index 89d84218aef428..bd6feca4901fc3 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml @@ -52,22 +52,70 @@ tests: command: "readAttribute" attribute: "OnTime" response: + saveAs: initialOnTime constraints: type: int16u minValue: 0 maxValue: 65535 - - label: "Step 5: TH reads the OffWaitTime attribute from the DUT" + - label: "Step 5: TH writes the OnTime attribute as 30" + PICS: OO.S.A4001 + command: "writeAttribute" + attribute: "OnTime" + arguments: + value: 30 + + - label: "Step 6: TH reads the OnTime attribute from the DUT" + PICS: OO.S.A4001 + command: "readAttribute" + attribute: "OnTime" + response: + value: 30 + + - label: + "Step 7: TH writes the OnTime attribute as 'initial-On-time' to + restore the original value" + PICS: OO.S.A4001 + command: "writeAttribute" + attribute: "OnTime" + arguments: + value: initialOnTime + + - label: "Step 8: TH reads the OffWaitTime attribute from the DUT" PICS: OO.S.A4002 command: "readAttribute" attribute: "OffWaitTime" response: + saveAs: initialOffWaitTime constraints: type: int16u minValue: 0 maxValue: 65535 - - label: "Step 6: TH reads the StartUpOnOff attribute from the DUT" + - label: "Step 9: TH writes the OffWaitTime attribute as 30" + PICS: OO.S.A4002 + command: "writeAttribute" + attribute: "OffWaitTime" + arguments: + value: 30 + + - label: "Step 10: TH reads the OffWaitTime attribute from the DUT" + PICS: OO.S.A4002 + command: "readAttribute" + attribute: "OffWaitTime" + response: + value: 30 + + - label: + "Step 11: TH writes the OffWaitTime attribute as + 'initial-Off-waittime' to restore the original value" + PICS: OO.S.A4002 + command: "writeAttribute" + attribute: "OffWaitTime" + arguments: + value: initialOffWaitTime + + - label: "Step 12: TH reads the StartUpOnOff attribute from the DUT" PICS: OO.S.A4003 command: "readAttribute" attribute: "StartUpOnOff" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml index c477d542e8a7d9..e03bed6691bbd4 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml @@ -35,6 +35,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 2b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -46,6 +54,14 @@ tests: PICS: OO.S.C01.Rsp command: "On" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 3b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -57,6 +73,14 @@ tests: PICS: OO.S.C01.Rsp command: "On" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 3d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -68,6 +92,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 4b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -79,6 +111,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 4d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -86,7 +126,7 @@ tests: response: value: 0 - - label: "Step 5c: TH sends Toggle command to DUT" + - label: "Step 5a: TH sends Toggle command to DUT" PICS: OO.S.C02.Rsp command: "Toggle" @@ -98,14 +138,14 @@ tests: - name: "ms" value: 1000 - - label: "Step 5d: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" attribute: "OnOff" response: value: 1 - - label: "TH sends Toggle command to DUT" + - label: "Step 5c: TH sends Toggle command to DUT" PICS: OO.S.C02.Rsp command: "Toggle" @@ -117,7 +157,7 @@ tests: - name: "ms" value: 1000 - - label: "Check on/off attribute value is false after toggle command" + - label: "Step 5d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" attribute: "OnOff" @@ -161,14 +201,3 @@ tests: attribute: "OnOff" response: value: 0 - - - label: "Reset Off Command" - PICS: OO.S.C00.Rsp - command: "Off" - - - label: "Check on/off attribute value is false after off command" - PICS: OO.S.A0000 - command: "readAttribute" - attribute: "OnOff" - response: - value: 0 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 021f52e6547ec8..20f0a334979c40 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1211,6 +1211,7 @@ OO.S.C41.Rsp=1 OO.S.C42.Rsp=1 OO.S.F00=1 OO.S.F01=0 +OO.S.F02=0 OO.S.A4003=1 OO.M.ManuallyControlled=1 From e0b8a84fb99606332ca5d30fe881a93ee47dfc77 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 29 Feb 2024 12:04:55 -0500 Subject: [PATCH 2/3] Checking mFinishedCommandCount doesn't require mpPendingResponseTracker (#32375) --- src/app/CommandSender.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 268fd338ed89cd..af317f76003900 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -497,10 +497,7 @@ CHIP_ERROR CommandSender::PrepareCommand(const CommandPathParams & aCommandPathP bool canAddAnotherCommand = (mState == State::AddedCommand && mBatchCommandsEnabled && mUseExtendableCallback); VerifyOrReturnError(mState == State::Idle || canAddAnotherCommand, CHIP_ERROR_INCORRECT_STATE); - if (mpPendingResponseTracker != nullptr) - { - VerifyOrReturnError(mFinishedCommandCount < mRemoteMaxPathsPerInvoke, CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED); - } + VerifyOrReturnError(mFinishedCommandCount < mRemoteMaxPathsPerInvoke, CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED); if (mBatchCommandsEnabled) { From bdde9cf06ab251ec4a63524602728813d45096ef Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 29 Feb 2024 13:02:34 -0500 Subject: [PATCH 3/3] Define explicit `data_model` sub-targets for generated files (#32343) * Define some source sets for data_model * Update dependencies, this seems to work for non-gen for now (with odd naming) * Rename the generate commands and hopefully this makes pregen work * Start using privilege-constants * Add missing file * Fix lint error * Fix android build ... a bit ugly as this dynamic server business is too coupled * Restyle * fix dependency --------- Co-authored-by: Andrei Litvin --- build/chip/chip_codegen.gni | 8 +- .../all-clusters-app/app-templates/access.h | 2 +- .../lighting-app/app-templates/access.h | 2 +- src/app/BUILD.gn | 1 + src/app/chip_data_model.gni | 93 +++++++++++++++++++ src/app/util/privilege-constants.h | 23 +++++ src/app/util/privilege-storage.h | 7 +- .../zap-templates/templates/app/access.zapt | 2 +- 8 files changed, 125 insertions(+), 13 deletions(-) create mode 100644 src/app/util/privilege-constants.h diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index 08d9f17da6c1be..07f24bdc3e6bc0 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -35,7 +35,7 @@ template("_chip_build_time_codegen") { include_dirs = [ target_gen_dir ] } - pw_python_action("${_name}_codegen") { + pw_python_action("${_name}_generate") { script = "${chip_root}/scripts/codegen.py" # TODO: this seems to touch internals. Is this ok? speeds up builds! @@ -99,7 +99,7 @@ template("_chip_build_time_codegen") { if (!defined(deps)) { deps = [] } - deps += [ ":${_name}_codegen" ] + deps += [ ":${_name}_generate" ] } } @@ -152,7 +152,7 @@ template("_chip_build_time_zapgen") { _output_subdir = "zap-generated" } - pw_python_action("${_name}_zap") { + pw_python_action("${_name}_generate") { script = "${chip_root}/scripts/tools/zap/generate.py" # TODO: this seems to touch internals. Is this ok? speeds up builds! @@ -211,7 +211,7 @@ template("_chip_build_time_zapgen") { if (!defined(public_deps)) { public_deps = [] } - public_deps += [ ":${_name}_zap" ] + public_deps += [ ":${_name}_generate" ] } } diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h index 82dab06aeeae0f..f2260156616eed 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h @@ -20,7 +20,7 @@ // Prevent multiple inclusion #pragma once -#include +#include // Prevent changing generated format // clang-format off diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h index 119c12e6f05c06..d2b8c67daa3fa7 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h @@ -20,7 +20,7 @@ // Prevent multiple inclusion #pragma once -#include +#include // Prevent changing generated format // clang-format off diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index e6754bd8c32a31..618e51df303f3c 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -229,6 +229,7 @@ static_library("interaction-model") { "dynamic_server/AccessControl.cpp", "dynamic_server/AccessControl.h", "dynamic_server/DynamicDispatcher.cpp", + "util/privilege-constants.h", "util/privilege-storage.cpp", "util/privilege-storage.h", ] diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index a065d833b43846..29c5f0399737cc 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -32,6 +32,26 @@ _app_root = get_path_info(".", "abspath") # # Forwards all the remaining variables to the source_set. # +# +# +# Additional underlying source sets that will be provided +# +# - ${name}-endpoint-metadata +# contains HEADERS that define endpoint metadata from zap/matter files: +# - zap-generated/gen_config.h +# - zap-generated/endpoint_config.h +# - zap-generated/access.h +# - PluginApplicationCallbacks.h +# - ${name}-callbacks +# contains the callback implementation for cluster init: +# - cluster-init-callback.cpp +# - callback-stub.cpp (contains __weak__ implementations. TODO: we should not be using +# weak linkage over time at all) +# - ${name}-command-dispatch: +# contains the implementation of `DispatchServerCommand` which forwards data to +# `emberAf....Cluster...Callback` callbacks +# - zap-generated/IMClusterCommandHandler.cpp +# template("chip_data_model") { _data_model_name = target_name @@ -87,6 +107,79 @@ template("chip_data_model") { ] } + # where generated files reside + # TODO: where can this reside? + if (chip_code_pre_generated_directory == "") { + _zapgen_gen_dir = "${target_gen_dir}/zapgen" + _codegen_gen_dir = "${target_gen_dir}" + } else { + # NOTE: if zap and matter file will reside in different locations + # this path will change between zapgen and codegen + _pregen_dir = + chip_code_pre_generated_directory + "/" + + string_replace(rebase_path(invoker.zap_file, chip_root), ".zap", "") + + _zapgen_gen_dir = "${_pregen_dir}/zap/app-templates" + _codegen_gen_dir = "${_pregen_dir}/codegen/cpp-app" + } + + # Fixed source sets for allowing reasonable dependencies on things: + source_set("${_data_model_name}-endpoint-metadata") { + sources = [ + "${_codegen_gen_dir}/app/PluginApplicationCallbacks.h", + "${_zapgen_gen_dir}/zap-generated/access.h", + "${_zapgen_gen_dir}/zap-generated/endpoint_config.h", + "${_zapgen_gen_dir}/zap-generated/gen_config.h", + ] + + deps = [ "${chip_root}/src/lib/core:chip_config_header" ] + + if (chip_code_pre_generated_directory == "") { + deps += [ + ":${_data_model_name}_codegen_generate", + ":${_data_model_name}_zapgen_generate", + ] + } + } + + source_set("${_data_model_name}-callbacks") { + sources = [ + "${_codegen_gen_dir}/app/callback-stub.cpp", + "${_codegen_gen_dir}/app/cluster-init-callback.cpp", + ] + + deps = [ + "${chip_root}/src/app/common:ids", + "${chip_root}/src/lib/support:span", + "${chip_root}/src/protocols/interaction_model", + ] + + if (chip_code_pre_generated_directory == "") { + deps += [ ":${_data_model_name}_codegen_generate" ] + } + } + + if (!chip_build_controller_dynamic_server) { + source_set("${_data_model_name}-command-dispatch") { + sources = + [ "${_zapgen_gen_dir}/zap-generated/IMClusterCommandHandler.cpp" ] + + deps = [ + "${chip_root}/src/app", + "${chip_root}/src/app:interaction-model", + "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/app/common:enums", + "${chip_root}/src/app/common:ids", + "${chip_root}/src/lib/core", + "${chip_root}/src/lib/support", + ] + + if (chip_code_pre_generated_directory == "") { + deps += [ ":${_data_model_name}_zapgen_generate" ] + } + } + } + source_set(_data_model_name) { forward_variables_from(invoker, "*", diff --git a/src/app/util/privilege-constants.h b/src/app/util/privilege-constants.h new file mode 100644 index 00000000000000..a9f56b509ca4cc --- /dev/null +++ b/src/app/util/privilege-constants.h @@ -0,0 +1,23 @@ +/** + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +inline constexpr int kMatterAccessPrivilegeView = 0; +inline constexpr int kMatterAccessPrivilegeOperate = 1; +inline constexpr int kMatterAccessPrivilegeManage = 2; +inline constexpr int kMatterAccessPrivilegeAdminister = 3; +inline constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister; diff --git a/src/app/util/privilege-storage.h b/src/app/util/privilege-storage.h index 02d55488fd0780..6222d891b9c92a 100644 --- a/src/app/util/privilege-storage.h +++ b/src/app/util/privilege-storage.h @@ -16,14 +16,9 @@ */ #pragma once +#include #include -inline constexpr int kMatterAccessPrivilegeView = 0; -inline constexpr int kMatterAccessPrivilegeOperate = 1; -inline constexpr int kMatterAccessPrivilegeManage = 2; -inline constexpr int kMatterAccessPrivilegeAdminister = 3; -inline constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister; - int MatterGetAccessPrivilegeForReadAttribute(chip::ClusterId cluster, chip::AttributeId attribute); int MatterGetAccessPrivilegeForWriteAttribute(chip::ClusterId cluster, chip::AttributeId attribute); int MatterGetAccessPrivilegeForInvokeCommand(chip::ClusterId cluster, chip::CommandId command); diff --git a/src/app/zap-templates/templates/app/access.zapt b/src/app/zap-templates/templates/app/access.zapt index 483de62bce4c60..96ad5f54ae5075 100644 --- a/src/app/zap-templates/templates/app/access.zapt +++ b/src/app/zap-templates/templates/app/access.zapt @@ -3,7 +3,7 @@ // Prevent multiple inclusion #pragma once -#include +#include // Prevent changing generated format // clang-format off