Skip to content

Commit

Permalink
Merge branch 'master' into feature/enable_uart_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-silabs authored Feb 29, 2024
2 parents b2b5828 + bdde9cf commit f306475
Show file tree
Hide file tree
Showing 16 changed files with 309 additions and 49 deletions.
8 changes: 4 additions & 4 deletions build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -99,7 +99,7 @@ template("_chip_build_time_codegen") {
if (!defined(deps)) {
deps = []
}
deps += [ ":${_name}_codegen" ]
deps += [ ":${_name}_generate" ]
}
}

Expand Down Expand Up @@ -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!
Expand Down Expand Up @@ -211,7 +211,7 @@ template("_chip_build_time_zapgen") {
if (!defined(public_deps)) {
public_deps = []
}
public_deps += [ ":${_name}_zap" ]
public_deps += [ ":${_name}_generate" ]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6659,7 +6659,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -6895,7 +6895,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -23993,7 +23993,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Prevent multiple inclusion
#pragma once

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

// Prevent changing generated format
// clang-format off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Prevent multiple inclusion
#pragma once

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

// Prevent changing generated format
// clang-format off
Expand Down
1 change: 1 addition & 0 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
5 changes: 1 addition & 4 deletions src/app/CommandSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
93 changes: 93 additions & 0 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
"*",
Expand Down
3 changes: 3 additions & 0 deletions src/app/tests/suites/certification/PICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
90 changes: 80 additions & 10 deletions src/app/tests/suites/certification/Test_TC_OO_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Loading

0 comments on commit f306475

Please sign in to comment.