Skip to content

Commit f306475

Browse files
authored
Merge branch 'master' into feature/enable_uart_logging
2 parents b2b5828 + bdde9cf commit f306475

File tree

16 files changed

+309
-49
lines changed

16 files changed

+309
-49
lines changed

build/chip/chip_codegen.gni

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ template("_chip_build_time_codegen") {
3535
include_dirs = [ target_gen_dir ]
3636
}
3737

38-
pw_python_action("${_name}_codegen") {
38+
pw_python_action("${_name}_generate") {
3939
script = "${chip_root}/scripts/codegen.py"
4040

4141
# TODO: this seems to touch internals. Is this ok? speeds up builds!
@@ -99,7 +99,7 @@ template("_chip_build_time_codegen") {
9999
if (!defined(deps)) {
100100
deps = []
101101
}
102-
deps += [ ":${_name}_codegen" ]
102+
deps += [ ":${_name}_generate" ]
103103
}
104104
}
105105

@@ -152,7 +152,7 @@ template("_chip_build_time_zapgen") {
152152
_output_subdir = "zap-generated"
153153
}
154154

155-
pw_python_action("${_name}_zap") {
155+
pw_python_action("${_name}_generate") {
156156
script = "${chip_root}/scripts/tools/zap/generate.py"
157157

158158
# TODO: this seems to touch internals. Is this ok? speeds up builds!
@@ -211,7 +211,7 @@ template("_chip_build_time_zapgen") {
211211
if (!defined(public_deps)) {
212212
public_deps = []
213213
}
214-
public_deps += [ ":${_name}_zap" ]
214+
public_deps += [ ":${_name}_generate" ]
215215
}
216216
}
217217

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+2-2
Original file line numberDiff line numberDiff line change
@@ -7761,7 +7761,7 @@ endpoint 1 {
77617761
callback attribute eventList;
77627762
callback attribute attributeList;
77637763
ram attribute featureMap default = 0x0001;
7764-
ram attribute clusterRevision default = 5;
7764+
ram attribute clusterRevision default = 6;
77657765

77667766
handle command Off;
77677767
handle command On;
@@ -9134,7 +9134,7 @@ endpoint 2 {
91349134
callback attribute eventList;
91359135
callback attribute attributeList;
91369136
ram attribute featureMap default = 0x0001;
9137-
ram attribute clusterRevision default = 5;
9137+
ram attribute clusterRevision default = 6;
91389138

91399139
handle command Off;
91409140
handle command On;

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+3-3
Original file line numberDiff line numberDiff line change
@@ -6659,7 +6659,7 @@
66596659
"storageOption": "RAM",
66606660
"singleton": 0,
66616661
"bounded": 0,
6662-
"defaultValue": "5",
6662+
"defaultValue": "6",
66636663
"reportable": 1,
66646664
"minInterval": 0,
66656665
"maxInterval": 65344,
@@ -6895,7 +6895,7 @@
68956895
"storageOption": "RAM",
68966896
"singleton": 0,
68976897
"bounded": 0,
6898-
"defaultValue": "5",
6898+
"defaultValue": "6",
68996899
"reportable": 1,
69006900
"minInterval": 0,
69016901
"maxInterval": 65344,
@@ -23993,7 +23993,7 @@
2399323993
"storageOption": "RAM",
2399423994
"singleton": 0,
2399523995
"bounded": 0,
23996-
"defaultValue": "5",
23996+
"defaultValue": "6",
2399723997
"reportable": 1,
2399823998
"minInterval": 0,
2399923999
"maxInterval": 65344,

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// Prevent multiple inclusion
2121
#pragma once
2222

23-
#include <app/util/privilege-storage.h>
23+
#include <app/util/privilege-constants.h>
2424

2525
// Prevent changing generated format
2626
// clang-format off

scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// Prevent multiple inclusion
2121
#pragma once
2222

23-
#include <app/util/privilege-storage.h>
23+
#include <app/util/privilege-constants.h>
2424

2525
// Prevent changing generated format
2626
// clang-format off

src/app/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static_library("interaction-model") {
229229
"dynamic_server/AccessControl.cpp",
230230
"dynamic_server/AccessControl.h",
231231
"dynamic_server/DynamicDispatcher.cpp",
232+
"util/privilege-constants.h",
232233
"util/privilege-storage.cpp",
233234
"util/privilege-storage.h",
234235
]

src/app/CommandSender.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,7 @@ CHIP_ERROR CommandSender::PrepareCommand(const CommandPathParams & aCommandPathP
497497
bool canAddAnotherCommand = (mState == State::AddedCommand && mBatchCommandsEnabled && mUseExtendableCallback);
498498
VerifyOrReturnError(mState == State::Idle || canAddAnotherCommand, CHIP_ERROR_INCORRECT_STATE);
499499

500-
if (mpPendingResponseTracker != nullptr)
501-
{
502-
VerifyOrReturnError(mFinishedCommandCount < mRemoteMaxPathsPerInvoke, CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED);
503-
}
500+
VerifyOrReturnError(mFinishedCommandCount < mRemoteMaxPathsPerInvoke, CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED);
504501

505502
if (mBatchCommandsEnabled)
506503
{

src/app/chip_data_model.gni

+93
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ _app_root = get_path_info(".", "abspath")
3232
#
3333
# Forwards all the remaining variables to the source_set.
3434
#
35+
#
36+
#
37+
# Additional underlying source sets that will be provided
38+
#
39+
# - ${name}-endpoint-metadata
40+
# contains HEADERS that define endpoint metadata from zap/matter files:
41+
# - zap-generated/gen_config.h
42+
# - zap-generated/endpoint_config.h
43+
# - zap-generated/access.h
44+
# - PluginApplicationCallbacks.h
45+
# - ${name}-callbacks
46+
# contains the callback implementation for cluster init:
47+
# - cluster-init-callback.cpp
48+
# - callback-stub.cpp (contains __weak__ implementations. TODO: we should not be using
49+
# weak linkage over time at all)
50+
# - ${name}-command-dispatch:
51+
# contains the implementation of `DispatchServerCommand` which forwards data to
52+
# `emberAf....Cluster...Callback` callbacks
53+
# - zap-generated/IMClusterCommandHandler.cpp
54+
#
3555
template("chip_data_model") {
3656
_data_model_name = target_name
3757

@@ -87,6 +107,79 @@ template("chip_data_model") {
87107
]
88108
}
89109

110+
# where generated files reside
111+
# TODO: where can this reside?
112+
if (chip_code_pre_generated_directory == "") {
113+
_zapgen_gen_dir = "${target_gen_dir}/zapgen"
114+
_codegen_gen_dir = "${target_gen_dir}"
115+
} else {
116+
# NOTE: if zap and matter file will reside in different locations
117+
# this path will change between zapgen and codegen
118+
_pregen_dir =
119+
chip_code_pre_generated_directory + "/" +
120+
string_replace(rebase_path(invoker.zap_file, chip_root), ".zap", "")
121+
122+
_zapgen_gen_dir = "${_pregen_dir}/zap/app-templates"
123+
_codegen_gen_dir = "${_pregen_dir}/codegen/cpp-app"
124+
}
125+
126+
# Fixed source sets for allowing reasonable dependencies on things:
127+
source_set("${_data_model_name}-endpoint-metadata") {
128+
sources = [
129+
"${_codegen_gen_dir}/app/PluginApplicationCallbacks.h",
130+
"${_zapgen_gen_dir}/zap-generated/access.h",
131+
"${_zapgen_gen_dir}/zap-generated/endpoint_config.h",
132+
"${_zapgen_gen_dir}/zap-generated/gen_config.h",
133+
]
134+
135+
deps = [ "${chip_root}/src/lib/core:chip_config_header" ]
136+
137+
if (chip_code_pre_generated_directory == "") {
138+
deps += [
139+
":${_data_model_name}_codegen_generate",
140+
":${_data_model_name}_zapgen_generate",
141+
]
142+
}
143+
}
144+
145+
source_set("${_data_model_name}-callbacks") {
146+
sources = [
147+
"${_codegen_gen_dir}/app/callback-stub.cpp",
148+
"${_codegen_gen_dir}/app/cluster-init-callback.cpp",
149+
]
150+
151+
deps = [
152+
"${chip_root}/src/app/common:ids",
153+
"${chip_root}/src/lib/support:span",
154+
"${chip_root}/src/protocols/interaction_model",
155+
]
156+
157+
if (chip_code_pre_generated_directory == "") {
158+
deps += [ ":${_data_model_name}_codegen_generate" ]
159+
}
160+
}
161+
162+
if (!chip_build_controller_dynamic_server) {
163+
source_set("${_data_model_name}-command-dispatch") {
164+
sources =
165+
[ "${_zapgen_gen_dir}/zap-generated/IMClusterCommandHandler.cpp" ]
166+
167+
deps = [
168+
"${chip_root}/src/app",
169+
"${chip_root}/src/app:interaction-model",
170+
"${chip_root}/src/app/common:cluster-objects",
171+
"${chip_root}/src/app/common:enums",
172+
"${chip_root}/src/app/common:ids",
173+
"${chip_root}/src/lib/core",
174+
"${chip_root}/src/lib/support",
175+
]
176+
177+
if (chip_code_pre_generated_directory == "") {
178+
deps += [ ":${_data_model_name}_zapgen_generate" ]
179+
}
180+
}
181+
}
182+
90183
source_set(_data_model_name) {
91184
forward_variables_from(invoker,
92185
"*",

src/app/tests/suites/certification/PICS.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -5294,6 +5294,9 @@ PICS:
52945294
- label: "Device has Deadfront behaviour"
52955295
id: OO.S.F01
52965296

5297+
- label: "Device has OffOnly feature"
5298+
id: OO.S.F02
5299+
52975300
#
52985301
# server / manually
52995302
#

src/app/tests/suites/certification/Test_TC_OO_1_1.yaml

+80-10
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,75 @@ tests:
3838
command: "readAttribute"
3939
attribute: "ClusterRevision"
4040
response:
41-
value: 5
41+
value: 6
4242
constraints:
4343
type: int16u
4444

45-
- label: "Step 3a: TH reads from the DUT the FeatureMap attribute."
45+
- label:
46+
"Step 3a: Given OO.S.F00(LT) ensure featuremap has the correct bit set"
4647
command: "readAttribute"
4748
attribute: "FeatureMap"
48-
PICS: ( !OO.S.F00 && !OO.S.F01 )
49+
PICS: ( OO.S.F00 && !OO.S.F02 )
4950
response:
50-
value: 0
5151
constraints:
5252
type: bitmap32
53-
53+
hasMasksSet: [0x1]
5454
- label:
5555
"Step 3b: Given OO.S.F00(LT) ensure featuremap has the correct bit set"
5656
command: "readAttribute"
5757
attribute: "FeatureMap"
58-
PICS: OO.S.F00
58+
PICS: ( !( OO.S.F00 && !OO.S.F02 ) )
5959
response:
6060
constraints:
6161
type: bitmap32
62-
hasMasksSet: [0x1]
62+
hasMasksClear: [0x1]
6363

6464
- label:
6565
"Step 3c: Given OO.S.F01(DF) ensure featuremap has the correct bit set"
6666
command: "readAttribute"
6767
attribute: "FeatureMap"
68-
PICS: OO.S.F01
68+
PICS: ( OO.S.F01 && !OO.S.F02 )
6969
response:
7070
constraints:
7171
type: bitmap32
7272
hasMasksSet: [0x2]
73+
- label:
74+
"Step 3d: Given OO.S.F01(DF) ensure featuremap has the correct bit set"
75+
command: "readAttribute"
76+
attribute: "FeatureMap"
77+
PICS: ( !( OO.S.F01 && !OO.S.F02 ) )
78+
response:
79+
constraints:
80+
type: bitmap32
81+
hasMasksClear: [0x2]
82+
83+
- label:
84+
"Step 3e: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap
85+
attribute."
86+
command: "readAttribute"
87+
attribute: "FeatureMap"
88+
PICS: ( OO.S.F02 && !OO.S.F00 && !OO.S.F01 )
89+
response:
90+
constraints:
91+
type: bitmap32
92+
hasMasksSet: [0x4]
93+
- label:
94+
"Step 3f: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap
95+
attribute."
96+
command: "readAttribute"
97+
attribute: "FeatureMap"
98+
PICS: ( !( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) )
99+
response:
100+
constraints:
101+
type: bitmap32
102+
hasMasksClear: [0x4]
103+
- label: "Step 3g: All remaining shall be zero"
104+
command: "readAttribute"
105+
attribute: "FeatureMap"
106+
response:
107+
constraints:
108+
type: bitmap32
109+
hasMasksClear: [0xFFFFFFF8]
73110

74111
- label: "Step 4a: TH reads from the DUT the AttributeList attribute."
75112
PICS: PICS_EVENT_LIST_ENABLED
@@ -115,10 +152,32 @@ tests:
115152
response:
116153
constraints:
117154
type: list
118-
contains: [0, 1, 2]
155+
contains: [0]
156+
157+
- label:
158+
"Step 6b: TH reads the feature dependent(OO.S.F02) commands in
159+
AcceptedCommandList"
160+
command: "readAttribute"
161+
attribute: "AcceptedCommandList"
162+
PICS: ( !OO.S.F02 )
163+
response:
164+
constraints:
165+
type: list
166+
contains: [1, 2]
167+
168+
- label:
169+
"Step 6c: TH reads the feature dependent(OO.S.F02) commands in
170+
AcceptedCommandList"
171+
command: "readAttribute"
172+
attribute: "AcceptedCommandList"
173+
PICS: OO.S.F02
174+
response:
175+
constraints:
176+
type: list
177+
excludes: [1, 2]
119178

120179
- label:
121-
"Step 6b: TH reads the feature dependent(OO.S.F00) commands in
180+
"Step 6d: TH reads the feature dependent(OO.S.F00) commands in
122181
AcceptedCommandList"
123182
command: "readAttribute"
124183
attribute: "AcceptedCommandList"
@@ -128,6 +187,17 @@ tests:
128187
type: list
129188
contains: [64, 65, 66]
130189

190+
- label:
191+
"Step 6e: TH reads the feature dependent(OO.S.F00) commands in
192+
AcceptedCommandList"
193+
command: "readAttribute"
194+
attribute: "AcceptedCommandList"
195+
PICS: ( !OO.S.F00 )
196+
response:
197+
constraints:
198+
type: list
199+
excludes: [64, 65, 66]
200+
131201
- label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute."
132202
command: "readAttribute"
133203
attribute: "GeneratedCommandList"

0 commit comments

Comments
 (0)