From d7dde9bf69e5d4abfebbd12f3a87e1fd5575fc50 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 9 Apr 2024 16:19:37 -0400 Subject: [PATCH 1/4] Stop pre-composing log strings in MTRASyncWorkQueue. (#32915) Just log the data we want directly instead of building up a string and logging it. --- src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm index 4a717e5daa24aa..eff85b1b0cb503 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm @@ -225,18 +225,11 @@ - (instancetype)initWithContext:(id)context return self; } -- (NSString *)_lockedSelfDescription:(const ContextSnapshot &)context -{ - os_unfair_lock_assert_owner(&_lock); - - return [NSString stringWithFormat:@"%@, items count: %tu", context.description, _items.count]; -} - - (NSString *)description { ContextSnapshot context(self); std::lock_guard lock(_lock); - return [NSString stringWithFormat:@"<%@ context: %@>", self.class, [self _lockedSelfDescription:context]]; + return [NSString stringWithFormat:@"<%@ context: %@, items count: %tu>", self.class, context.description, _items.count]; } - (void)enqueueWorkItem:(MTRAsyncWorkItem *)item @@ -268,9 +261,9 @@ - (void)enqueueWorkItem:(MTRAsyncWorkItem *)item // Logging the description once is enough because other log messages // related to the work item (execution, completion etc) can easily be // correlated using the unique id. - MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> enqueued work item [%llu]: %@", [self _lockedSelfDescription:context], item.uniqueID, description); + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> enqueued work item [%llu]: %@", context.description, _items.count, item.uniqueID, description); } else { - MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> enqueued work item [%llu]", [self _lockedSelfDescription:context], item.uniqueID); + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> enqueued work item [%llu]", context.description, _items.count, item.uniqueID); } [self _callNextReadyWorkItemWithContext:context]; @@ -304,7 +297,7 @@ - (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem } else { [workItem markComplete]; [_items removeObjectAtIndex:0]; - MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> completed work item [%llu]", [self _lockedSelfDescription:context], workItem.uniqueID); + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> completed work item [%llu]", context.description, _items.count, workItem.uniqueID); } // when "concurrency width" is implemented this will be decremented instead From 935c79336e528922af324c1608d7623abf59ceb1 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:22:01 +1200 Subject: [PATCH 2/4] Darwin: Refactor stack startup logic when creating a controller (#32845) * Darwin: Don't stop/start the stack when creating a controller * Keep refactorings in place but retain current behavior for now * Darwin: Enable CHIP_CONFIG_GLOBALS_NO_DESTRUCT=1 This was missed in #32745 when adding -fno-c++-static-destructors, since that flag does not carry through to lazily initialized chip::Global instances. --- .../Framework/CHIP/MTRDeviceController.mm | 16 ++------- .../CHIP/MTRDeviceControllerFactory.mm | 34 +++++++++++++++---- .../Matter.xcodeproj/project.pbxproj | 2 ++ 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 22d52cd5b4a684..961b6f87694536 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -139,25 +139,15 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete { if (![parameters isKindOfClass:MTRDeviceControllerParameters.class]) { MTR_LOG_ERROR("Unsupported type of MTRDeviceControllerAbstractParameters: %@", parameters); - if (error) { *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; } return nil; } + auto * controllerParameters = static_cast(parameters); - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - if (!factory.isRunning) { - auto * params = [[MTRDeviceControllerFactoryParams alloc] initWithoutStorage]; - - if (![factory startControllerFactory:params error:error]) { - return nil; - } - } - - auto * parametersForFactory = static_cast(parameters); - - return [factory initializeController:self withParameters:parametersForFactory error:error]; + // MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary + return [MTRDeviceControllerFactory.sharedInstance initializeController:self withParameters:controllerParameters error:error]; } - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 5941a799b5b514..b31003c238bea5 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -417,7 +417,14 @@ - (CHIP_ERROR)_initFabricTable:(FabricTable &)fabricTable return [NSArray arrayWithArray:fabricList]; } -- (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams error:(NSError * __autoreleasing *)error; +- (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams error:(NSError * __autoreleasing *)error +{ + return [self _startControllerFactory:startupParams startingController:NO error:error]; +} + +- (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams + startingController:(BOOL)startingController + error:(NSError * __autoreleasing *)error { [self _assertCurrentQueueIsNotMatterQueue]; @@ -535,6 +542,7 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams // state is brought up live on factory init, and not when it comes time // to actually start a controller, and does not actually clean itself up // until its refcount (which starts as 0) goes to 0. + // TODO: Don't cause a stack shutdown and restart if startingController _controllerFactory->RetainSystemState(); _controllerFactory->ReleaseSystemState(); @@ -597,11 +605,6 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController * { [self _assertCurrentQueueIsNotMatterQueue]; - if (![self checkIsRunning:error]) { - MTR_LOG_ERROR("Trying to start controller while Matter controller factory is not running"); - return nil; - } - id _Nullable storageDelegate; dispatch_queue_t _Nullable storageDelegateQueue; NSUUID * uniqueIdentifier; @@ -623,9 +626,28 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController * otaProviderDelegateQueue = nil; } else { MTR_LOG_ERROR("Unknown kind of startup params: %@", startupParams); + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; + } return nil; } + if (![self isRunning]) { + if (storageDelegate != nil) { + MTR_LOG_DEFAULT("Auto-starting Matter controller factory in per-controller storage mode"); + auto * params = [[MTRDeviceControllerFactoryParams alloc] initWithoutStorage]; + if (![self _startControllerFactory:params startingController:YES error:error]) { + return nil; + } + } else { + MTR_LOG_ERROR("Trying to start controller while Matter controller factory is not running"); + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + return nil; + } + } + if (_usingPerControllerStorage && storageDelegate == nil) { MTR_LOG_ERROR("Must have a controller storage delegate when we do not have storage for the controller factory"); if (error != nil) { diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 1e540620fe2632..80c451c937e2de 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -2256,6 +2256,7 @@ OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "-fno-c++-static-destructors", + "-DCHIP_CONFIG_GLOBALS_NO_DESTRUCT=1", ); OTHER_LDFLAGS = ""; "OTHER_LDFLAGS[sdk=*]" = ( @@ -2421,6 +2422,7 @@ OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "-fno-c++-static-destructors", + "-DCHIP_CONFIG_GLOBALS_NO_DESTRUCT=1", ); OTHER_LDFLAGS = ""; "OTHER_LDFLAGS[sdk=*]" = ( From 845ce9b4736042f52f431004e258606452e0bd0e Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:13:38 -0400 Subject: [PATCH 3/4] [ICD] Add TestEventTrigger support to the ICDManager (#32898) * Add TestEventTrigger to the ICDManager * Update copyright year * Update init / shutdown to not modify them * Remove unnecessary import * Fix nxp build * remove unnused import * add test event trigger to the app layer * Remove TestEventTrigger from known problems linter * fix typo * fix merge conflicts * update TestICDManager inits * Fix TestCommissionManager * move enum to the impl anonymous namespace --- .github/workflows/lint.yml | 52 ++++++++++----- .github/workflows/tests.yaml | 1 + examples/lighting-app/nxp/k32w/k32w0/BUILD.gn | 1 + src/app/BUILD.gn | 4 ++ src/app/icd/server/BUILD.gn | 1 + src/app/icd/server/ICDManager.cpp | 29 +++++++++ src/app/icd/server/ICDManager.h | 29 ++++++--- src/app/icd/server/ICDNotifier.h | 11 ++-- src/app/server/BUILD.gn | 1 + src/app/server/Server.cpp | 6 ++ src/app/tests/TestCommissionManager.cpp | 3 + src/app/tests/TestICDManager.cpp | 30 +++++++++ src/platform/nxp/k32w/k32w0/BUILD.gn | 5 +- src/platform/nxp/k32w/k32w1/BUILD.gn | 5 +- src/python_testing/TC_ICDManagementCluster.py | 63 +++++++++++++++++++ 15 files changed, 210 insertions(+), 31 deletions(-) create mode 100644 src/python_testing/TC_ICDManagementCluster.py diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 89f25b2c163142..7601ec0d7495b9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,7 +23,10 @@ on: workflow_dispatch: concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + group: + ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == + 'pull_request' && github.event.number) || (github.event_name == + 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true jobs: @@ -43,7 +46,7 @@ jobs: - name: Checkout submodules & Bootstrap uses: ./.github/actions/checkout-submodules-and-bootstrap with: - platform: linux + platform: linux - name: Check for orphaned gn files if: always() @@ -103,7 +106,6 @@ jobs: --known-failure app/reporting/reporting.cpp \ --known-failure app/reporting/tests/MockReportScheduler.cpp \ --known-failure app/reporting/tests/MockReportScheduler.h \ - --known-failure app/TestEventTriggerDelegate.h \ --known-failure app/util/attribute-storage.cpp \ --known-failure app/util/attribute-storage.h \ --known-failure app/util/attribute-storage-detail.h \ @@ -174,7 +176,8 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of PRI*8, which are not supported on some libcs. + - name: + Check for use of PRI*8, which are not supported on some libcs. if: always() run: | git grep -I -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 @@ -182,7 +185,9 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of PRI*16, which are not supported on some libcs. + - name: + Check for use of PRI*16, which are not supported on some + libcs. if: always() run: | git grep -I -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 @@ -190,7 +195,9 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of PRI*64, which are not supported on some libcs. + - name: + Check for use of PRI*64, which are not supported on some + libcs. if: always() run: | # TODO: MessageDefHelper should ideally not be excluded here. @@ -230,7 +237,9 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of 0x%u and the like, which lead to misleading output. + - name: + Check for use of 0x%u and the like, which lead to misleading + output. if: always() run: | git grep -I -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 @@ -238,14 +247,18 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of '"0x" PRIu*' and the like, which lead to misleading output. + - name: + Check for use of '"0x" PRIu*' and the like, which lead to + misleading output. if: always() run: | git grep -I -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. - - name: Check for use of NSLog instead of Matter logging in Matter framework + - name: + Check for use of NSLog instead of Matter logging in Matter + framework if: always() run: | git grep -n 'NSLog(' -- src/darwin/Framework/CHIP && exit 1 || exit 0 @@ -254,7 +267,9 @@ jobs: # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself, as well as excluding the files # that implement the type-safe accessors - - name: Check for use of 'emberAfReadAttribute' instead of the type-safe getters + - name: + Check for use of 'emberAfReadAttribute' instead of the + type-safe getters if: always() run: | git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/attribute-table.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0 @@ -264,7 +279,9 @@ jobs: # to avoid our grep regexp matching itself, as well as excluding the files # that implement the type-safe accessors, attribute writing from the wire, and some # Pigweed RPC code that seems hard to update. - - name: Check for use of 'emberAfWriteAttribute' instead of the type-safe setters + - name: + Check for use of 'emberAfWriteAttribute' instead of the + type-safe setters if: always() run: | git grep -I -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0 @@ -278,7 +295,9 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should probably be "SuccessOrExit(err = CHIP_ERROR_*)" + - name: + Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should + probably be "SuccessOrExit(err = CHIP_ERROR_*)" if: always() run: | git grep -I -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 @@ -286,14 +305,19 @@ jobs: # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. - - name: Check for use of "SuccessOrExit(something-without-assignment(", which should probably be "SuccessOrExit(err = something(" + - name: + Check for use of + "SuccessOrExit(something-without-assignment(", which should + probably be "SuccessOrExit(err = something(" if: always() run: | git grep -I -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. - - name: Check for use of "using namespace" outside of a class/function in headers. + - name: + Check for use of "using namespace" outside of a class/function + in headers. if: always() run: | # Various platforms have `using namespace chip::Ble` in their BLEManager* headers; just exclude those for now. diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 73158ccb0557fd..d7639273132898 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -508,6 +508,7 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_FAN_3_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_FAN_3_5.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ICDM_2_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_ICDManagementCluster.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_IDM_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_IDM_1_4.py" --script-args "--hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_PWRTL_2_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' diff --git a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn index 43a9860b5da48a..322c728a063ba7 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn @@ -112,6 +112,7 @@ k32w0_executable("light_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/lighting-app/nxp/zap/", "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/app:test-event-trigger", "${chip_root}/src/lib", "${chip_root}/src/platform:syscalls_stub", "${chip_root}/third_party/mbedtls:mbedtls", diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 312fe005d88f0b..76bd115a851a21 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -146,6 +146,10 @@ source_set("constants") { ] } +source_set("test-event-trigger") { + sources = [ "TestEventTriggerDelegate.h" ] +} + # interaction-model is a static-library because it currently requires global functions (app/util/...) that are stubbed in different test files that depend on the app static_library # which in tern depens on the interaction-model. # Using source_set prevents the unit test to build correctly. diff --git a/src/app/icd/server/BUILD.gn b/src/app/icd/server/BUILD.gn index a6c5096dde7d0c..c100cc7d041e84 100644 --- a/src/app/icd/server/BUILD.gn +++ b/src/app/icd/server/BUILD.gn @@ -81,6 +81,7 @@ source_set("manager") { ":notifier", ":observer", "${chip_root}/src/app:subscription-info-provider", + "${chip_root}/src/app:test-event-trigger", "${chip_root}/src/credentials:credentials", "${chip_root}/src/messaging", ] diff --git a/src/app/icd/server/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp index f4442e85972ee2..479fb9a240bc30 100644 --- a/src/app/icd/server/ICDManager.cpp +++ b/src/app/icd/server/ICDManager.cpp @@ -28,6 +28,14 @@ #include #include +namespace { +enum class ICDTestEventTriggerEvent : uint64_t +{ + kAddActiveModeReq = 0x0046'0000'00000001, + kRemoveActiveModeReq = 0x0046'0000'00000002, +}; +} // namespace + namespace chip { namespace app { @@ -643,6 +651,27 @@ void ICDManager::ExtendActiveMode(Milliseconds16 extendDuration) } } +CHIP_ERROR ICDManager::HandleEventTrigger(uint64_t eventTrigger) +{ + ICDTestEventTriggerEvent trigger = static_cast(eventTrigger); + CHIP_ERROR err = CHIP_NO_ERROR; + + switch (trigger) + { + case ICDTestEventTriggerEvent::kAddActiveModeReq: + SetKeepActiveModeRequirements(KeepActiveFlag::kTestEventTriggerActiveMode, true); + break; + case ICDTestEventTriggerEvent::kRemoveActiveModeReq: + SetKeepActiveModeRequirements(KeepActiveFlag::kTestEventTriggerActiveMode, false); + break; + default: + err = CHIP_ERROR_INVALID_ARGUMENT; + break; + } + + return err; +} + ICDManager::ObserverPointer * ICDManager::RegisterObserver(ICDStateObserver * observer) { return mStateObserverPool.CreateObject(observer); diff --git a/src/app/icd/server/ICDManager.h b/src/app/icd/server/ICDManager.h index 058285802eb309..43a5386d4d7844 100644 --- a/src/app/icd/server/ICDManager.h +++ b/src/app/icd/server/ICDManager.h @@ -16,16 +16,11 @@ */ #pragma once -#include - #include -#if CHIP_CONFIG_ENABLE_ICD_CIP -#include // nogncheck -#include // nogncheck -#endif // CHIP_CONFIG_ENABLE_ICD_CIP - +#include #include +#include #include #include #include @@ -38,6 +33,11 @@ #include #include +#if CHIP_CONFIG_ENABLE_ICD_CIP +#include // nogncheck +#include // nogncheck +#endif // CHIP_CONFIG_ENABLE_ICD_CIP + namespace chip { namespace Crypto { using SymmetricKeystore = SessionKeystore; @@ -54,7 +54,7 @@ class TestICDManager; /** * @brief ICD Manager is responsible of processing the events and triggering the correct action for an ICD */ -class ICDManager : public ICDListener +class ICDManager : public ICDListener, public TestEventTriggerHandler { public: // This structure is used for the creation an ObjectPool of ICDStateObserver pointers @@ -129,6 +129,15 @@ class ICDManager : public ICDListener */ uint32_t StayActiveRequest(uint32_t stayActiveDuration); + /** + * @brief TestEventTriggerHandler for the ICD feature set + * + * @param eventTrigger Event trigger to handle. + * @return CHIP_ERROR CHIP_NO_ERROR - No erros during the processing + * CHIP_ERROR_INVALID_ARGUMENT - eventTrigger isn't a valid value + */ + CHIP_ERROR HandleEventTrigger(uint64_t eventTrigger) override; + #if CHIP_CONFIG_ENABLE_ICD_CIP void SendCheckInMsgs(); @@ -165,14 +174,14 @@ class ICDManager : public ICDListener void OnSubscriptionReport() override; protected: + friend class TestICDManager; + /** * @brief Hepler function that extends the Active Mode duration as well as the Active Mode Jitter timer for the transition to * iddle mode. */ void ExtendActiveMode(System::Clock::Milliseconds16 extendDuration); - friend class TestICDManager; - static void OnIdleModeDone(System::Layer * aLayer, void * appState); static void OnActiveModeDone(System::Layer * aLayer, void * appState); diff --git a/src/app/icd/server/ICDNotifier.h b/src/app/icd/server/ICDNotifier.h index 5db14503a296d7..785fd1e08c9879 100644 --- a/src/app/icd/server/ICDNotifier.h +++ b/src/app/icd/server/ICDNotifier.h @@ -39,11 +39,12 @@ class ICDListener public: enum class KeepActiveFlagsValues : uint8_t { - kCommissioningWindowOpen = 0x01, - kFailSafeArmed = 0x02, - kExchangeContextOpen = 0x04, - kCheckInInProgress = 0x08, - kInvalidFlag = 0x10, // Move up when adding more flags + kCommissioningWindowOpen = 0x01, + kFailSafeArmed = 0x02, + kExchangeContextOpen = 0x04, + kCheckInInProgress = 0x08, + kTestEventTriggerActiveMode = 0x10, + kInvalidFlag = 0x20, // Move up when adding more flags }; enum class ICDManagementEvents : uint8_t diff --git a/src/app/server/BUILD.gn b/src/app/server/BUILD.gn index 7c661464bbaea3..51a259c86d2552 100644 --- a/src/app/server/BUILD.gn +++ b/src/app/server/BUILD.gn @@ -52,6 +52,7 @@ static_library("server") { public_deps = [ "${chip_root}/src/app", + "${chip_root}/src/app:test-event-trigger", "${chip_root}/src/app/icd/server:icd-server-config", "${chip_root}/src/app/icd/server:observer", "${chip_root}/src/lib/address_resolve", diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index eff11222bfae7b..57abf8087f59ca 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -348,6 +348,10 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) mICDManager.Init(mDeviceStorage, &GetFabricTable(), mSessionKeystore, &mExchangeMgr, chip::app::InteractionModelEngine::GetInstance()); + + // Register Test Event Trigger Handler + mTestEventTriggerDelegate->AddHandler(&mICDManager); + #endif // CHIP_CONFIG_ENABLE_ICD_SERVER // This code is necessary to restart listening to existing groups after a reboot @@ -592,6 +596,8 @@ void Server::Shutdown() Access::ResetAccessControlToDefault(); Credentials::SetGroupDataProvider(nullptr); #if CHIP_CONFIG_ENABLE_ICD_SERVER + // Remove Test Event Trigger Handler + mTestEventTriggerDelegate->RemoveHandler(&mICDManager); mICDManager.Shutdown(); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER mAttributePersister.Shutdown(); diff --git a/src/app/tests/TestCommissionManager.cpp b/src/app/tests/TestCommissionManager.cpp index c88b459742de16..c314421d4e3a9a 100644 --- a/src/app/tests/TestCommissionManager.cpp +++ b/src/app/tests/TestCommissionManager.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include #include #include #include @@ -100,6 +101,8 @@ void InitializeChip(nlTestSuite * suite) static chip::app::DefaultTimerDelegate sTimerDelegate; static chip::app::reporting::ReportSchedulerImpl sReportScheduler(&sTimerDelegate); initParams.reportScheduler = &sReportScheduler; + static chip::SimpleTestEventTriggerDelegate sSimpleTestEventTriggerDelegate; + initParams.testEventTriggerDelegate = &sSimpleTestEventTriggerDelegate; (void) initParams.InitializeStaticResourcesBeforeServerInit(); err = chip::Server::GetInstance().Init(initParams); diff --git a/src/app/tests/TestICDManager.cpp b/src/app/tests/TestICDManager.cpp index ac8c220351fd86..fd93a146cf2755 100644 --- a/src/app/tests/TestICDManager.cpp +++ b/src/app/tests/TestICDManager.cpp @@ -17,6 +17,7 @@ */ #include #include +#include #include #include #include @@ -66,6 +67,13 @@ constexpr uint8_t kKeyBuffer2b[] = { 0xf2, 0xe2, 0xd2, 0xc2, 0xb2, 0xa2, 0x92, 0x82, 0x72, 0x62, 0x52, 0x42, 0x32, 0x22, 0x12, 0x02 }; +// Taken from the ICDManager Implementation +enum class ICDTestEventTriggerEvent : uint64_t +{ + kAddActiveModeReq = 0x0046'0000'00000001, + kRemoveActiveModeReq = 0x0046'0000'00000002, +}; + class TestICDStateObserver : public app::ICDStateObserver { public: @@ -115,6 +123,7 @@ class TestContext : public chip::Test::AppContext // Performs setup for each individual test in the test suite CHIP_ERROR SetUp() override { + ReturnErrorOnFailure(chip::Test::AppContext::SetUp()); mICDManager.Init(&testStorage, &GetFabricTable(), &mKeystore, &GetExchangeManager(), &mSubInfoProvider); mICDManager.RegisterObserver(&mICDStateObserver); @@ -692,6 +701,26 @@ class TestICDManager NL_TEST_ASSERT(aSuite, ctx->mICDManager.ShouldCheckInMsgsBeSentAtActiveModeFunction(kTestFabricIndex1, kClientNodeId11)); } #endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS + + static void TestHandleTestEventTriggerActiveModeReq(nlTestSuite * aSuite, void * aContext) + { + TestContext * ctx = static_cast(aContext); + + // Verify That ICDManager starts in Idle + NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); + + // Add ActiveMode req for the Test event trigger event + ctx->mICDManager.HandleEventTrigger(static_cast(ICDTestEventTriggerEvent::kAddActiveModeReq)); + NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); + + // Advance clock by the ActiveModeDuration and check that the device is still in ActiveMode + AdvanceClockAndRunEventLoop(ctx, ICDConfigurationData::GetInstance().GetActiveModeDuration() + 1_ms32); + NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); + + // Remove req and device should go to IdleMode + ctx->mICDManager.HandleEventTrigger(static_cast(ICDTestEventTriggerEvent::kRemoveActiveModeReq)); + NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); + } }; } // namespace app @@ -710,6 +739,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("TestICDCounter", TestICDManager::TestICDCounter), NL_TEST_DEF("TestICDStayActive", TestICDManager::TestICDMStayActive), NL_TEST_DEF("TestShouldCheckInMsgsBeSentAtActiveModeFunction", TestICDManager::TestShouldCheckInMsgsBeSentAtActiveModeFunction), + NL_TEST_DEF("TestHandleTestEventTriggerActiveModeReq", TestICDManager::TestHandleTestEventTriggerActiveModeReq), NL_TEST_SENTINEL(), }; diff --git a/src/platform/nxp/k32w/k32w0/BUILD.gn b/src/platform/nxp/k32w/k32w0/BUILD.gn index 9d1ef45db9fdb5..c8aea6ee945f22 100644 --- a/src/platform/nxp/k32w/k32w0/BUILD.gn +++ b/src/platform/nxp/k32w/k32w0/BUILD.gn @@ -108,7 +108,10 @@ static_library("nxp_platform") { deps = [ "${chip_root}/src/platform/logging:headers" ] - public_deps = [ "${chip_root}/src/platform:platform_base" ] + public_deps = [ + "${chip_root}/src/app:test-event-trigger", + "${chip_root}/src/platform:platform_base", + ] if (chip_crypto == "platform") { if (chip_crypto_flavor == "tinycrypt") { diff --git a/src/platform/nxp/k32w/k32w1/BUILD.gn b/src/platform/nxp/k32w/k32w1/BUILD.gn index 30352203eebaaa..34dc5ca1b4e38a 100644 --- a/src/platform/nxp/k32w/k32w1/BUILD.gn +++ b/src/platform/nxp/k32w/k32w1/BUILD.gn @@ -77,7 +77,10 @@ static_library("nxp_platform") { "${chip_root}/src/platform/nxp/k32w/k32w1/SMU2Manager.h", ] - public_deps = [ "${chip_root}/src/platform:platform_base" ] + public_deps = [ + "${chip_root}/src/app:test-event-trigger", + "${chip_root}/src/platform:platform_base", + ] if (chip_with_low_power != 0) { sources += [ "LowPowerHooks.cpp" ] diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py new file mode 100644 index 00000000000000..a5b769ba30272c --- /dev/null +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -0,0 +1,63 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + +# Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT +# that has that Enable Key +kTestEventTriggerKey = bytes([b for b in range(16)]) + +kAddActiveModeReq = 0x0046000000000001 +kRemoveActiveModeReq = 0x0046000000000002 + + +class TestICDManagementCluster(MatterBaseTest): + @async_test_body + async def test_active_mode_test_event_trigger(self): + dev_ctrl = self.default_controller + is_test_event_triggers_enabled = await self.read_single_attribute( + dev_ctrl, + self.dut_node_id, + endpoint=0, + attribute=Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled + ) + asserts.assert_true(is_test_event_triggers_enabled, + "This test expects Test Event Triggers are Enabled") + + # No response to command --> Success yields "None". + asserts.assert_is_none( + await dev_ctrl.SendCommand( + self.dut_node_id, + endpoint=0, + payload=Clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=kTestEventTriggerKey, + eventTrigger=kAddActiveModeReq) + ) + ) + + asserts.assert_is_none( + await dev_ctrl.SendCommand( + self.dut_node_id, + endpoint=0, + payload=Clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=kTestEventTriggerKey, + eventTrigger=kRemoveActiveModeReq) + ) + ) + + +if __name__ == "__main__": + default_matter_test_main() From 20a55def9443cd504969a0448e1f734c7da6c599 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:20:32 -0400 Subject: [PATCH 4/4] [Silabs] Reduce code size for the Lighting-app (#32876) * Reduce code size for the silabs Lighting-app * Fix Wifi breakage --- .../silabs/build_for_wifi_args.gni | 3 + .../data_model/lighting-thread-app.matter | 438 +-------- .../silabs/data_model/lighting-thread-app.zap | 851 ++++-------------- examples/lighting-app/silabs/openthread.gni | 3 + examples/platform/silabs/matter-platform.slcp | 18 +- .../silabs/ConfigurationManagerImpl.cpp | 2 + src/platform/silabs/SilabsConfig.cpp | 2 + third_party/silabs/matter_support | 2 +- 8 files changed, 189 insertions(+), 1130 deletions(-) diff --git a/examples/lighting-app/silabs/build_for_wifi_args.gni b/examples/lighting-app/silabs/build_for_wifi_args.gni index bbb57ae35a4343..7e33551c30a97c 100644 --- a/examples/lighting-app/silabs/build_for_wifi_args.gni +++ b/examples/lighting-app/silabs/build_for_wifi_args.gni @@ -18,6 +18,9 @@ silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false import("${chip_root}/src/platform/silabs/wifi_args.gni") +# Not needed for the Lighting-app +chip_enable_read_client = false + chip_enable_ota_requestor = true app_data_model = "${chip_root}/examples/lighting-app/silabs/data_model:silabs-lighting" diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 415281989cae5d..60b6480176d518 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -745,265 +745,6 @@ cluster TimeFormatLocalization = 44 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ -cluster PowerSource = 47 { - revision 1; // NOTE: Default/not specifically set - - enum BatApprovedChemistryEnum : enum16 { - kUnspecified = 0; - kAlkaline = 1; - kLithiumCarbonFluoride = 2; - kLithiumChromiumOxide = 3; - kLithiumCopperOxide = 4; - kLithiumIronDisulfide = 5; - kLithiumManganeseDioxide = 6; - kLithiumThionylChloride = 7; - kMagnesium = 8; - kMercuryOxide = 9; - kNickelOxyhydride = 10; - kSilverOxide = 11; - kZincAir = 12; - kZincCarbon = 13; - kZincChloride = 14; - kZincManganeseDioxide = 15; - kLeadAcid = 16; - kLithiumCobaltOxide = 17; - kLithiumIon = 18; - kLithiumIonPolymer = 19; - kLithiumIronPhosphate = 20; - kLithiumSulfur = 21; - kLithiumTitanate = 22; - kNickelCadmium = 23; - kNickelHydrogen = 24; - kNickelIron = 25; - kNickelMetalHydride = 26; - kNickelZinc = 27; - kSilverZinc = 28; - kSodiumIon = 29; - kSodiumSulfur = 30; - kZincBromide = 31; - kZincCerium = 32; - } - - enum BatChargeFaultEnum : enum8 { - kUnspecified = 0; - kAmbientTooHot = 1; - kAmbientTooCold = 2; - kBatteryTooHot = 3; - kBatteryTooCold = 4; - kBatteryAbsent = 5; - kBatteryOverVoltage = 6; - kBatteryUnderVoltage = 7; - kChargerOverVoltage = 8; - kChargerUnderVoltage = 9; - kSafetyTimeout = 10; - } - - enum BatChargeLevelEnum : enum8 { - kOK = 0; - kWarning = 1; - kCritical = 2; - } - - enum BatChargeStateEnum : enum8 { - kUnknown = 0; - kIsCharging = 1; - kIsAtFullCharge = 2; - kIsNotCharging = 3; - } - - enum BatCommonDesignationEnum : enum16 { - kUnspecified = 0; - kAAA = 1; - kAA = 2; - kC = 3; - kD = 4; - k4v5 = 5; - k6v0 = 6; - k9v0 = 7; - k12AA = 8; - kAAAA = 9; - kA = 10; - kB = 11; - kF = 12; - kN = 13; - kNo6 = 14; - kSubC = 15; - kA23 = 16; - kA27 = 17; - kBA5800 = 18; - kDuplex = 19; - k4SR44 = 20; - k523 = 21; - k531 = 22; - k15v0 = 23; - k22v5 = 24; - k30v0 = 25; - k45v0 = 26; - k67v5 = 27; - kJ = 28; - kCR123A = 29; - kCR2 = 30; - k2CR5 = 31; - kCRP2 = 32; - kCRV3 = 33; - kSR41 = 34; - kSR43 = 35; - kSR44 = 36; - kSR45 = 37; - kSR48 = 38; - kSR54 = 39; - kSR55 = 40; - kSR57 = 41; - kSR58 = 42; - kSR59 = 43; - kSR60 = 44; - kSR63 = 45; - kSR64 = 46; - kSR65 = 47; - kSR66 = 48; - kSR67 = 49; - kSR68 = 50; - kSR69 = 51; - kSR516 = 52; - kSR731 = 53; - kSR712 = 54; - kLR932 = 55; - kA5 = 56; - kA10 = 57; - kA13 = 58; - kA312 = 59; - kA675 = 60; - kAC41E = 61; - k10180 = 62; - k10280 = 63; - k10440 = 64; - k14250 = 65; - k14430 = 66; - k14500 = 67; - k14650 = 68; - k15270 = 69; - k16340 = 70; - kRCR123A = 71; - k17500 = 72; - k17670 = 73; - k18350 = 74; - k18500 = 75; - k18650 = 76; - k19670 = 77; - k25500 = 78; - k26650 = 79; - k32600 = 80; - } - - enum BatFaultEnum : enum8 { - kUnspecified = 0; - kOverTemp = 1; - kUnderTemp = 2; - } - - enum BatReplaceabilityEnum : enum8 { - kUnspecified = 0; - kNotReplaceable = 1; - kUserReplaceable = 2; - kFactoryReplaceable = 3; - } - - enum PowerSourceStatusEnum : enum8 { - kUnspecified = 0; - kActive = 1; - kStandby = 2; - kUnavailable = 3; - } - - enum WiredCurrentTypeEnum : enum8 { - kAC = 0; - kDC = 1; - } - - enum WiredFaultEnum : enum8 { - kUnspecified = 0; - kOverVoltage = 1; - kUnderVoltage = 2; - } - - bitmap Feature : bitmap32 { - kWired = 0x1; - kBattery = 0x2; - kRechargeable = 0x4; - kReplaceable = 0x8; - } - - struct BatChargeFaultChangeType { - BatChargeFaultEnum current[] = 0; - BatChargeFaultEnum previous[] = 1; - } - - struct BatFaultChangeType { - BatFaultEnum current[] = 0; - BatFaultEnum previous[] = 1; - } - - struct WiredFaultChangeType { - WiredFaultEnum current[] = 0; - WiredFaultEnum previous[] = 1; - } - - info event WiredFaultChange = 0 { - WiredFaultEnum current[] = 0; - WiredFaultEnum previous[] = 1; - } - - info event BatFaultChange = 1 { - BatFaultEnum current[] = 0; - BatFaultEnum previous[] = 1; - } - - info event BatChargeFaultChange = 2 { - BatChargeFaultEnum current[] = 0; - BatChargeFaultEnum previous[] = 1; - } - - readonly attribute PowerSourceStatusEnum status = 0; - readonly attribute int8u order = 1; - readonly attribute char_string<60> description = 2; - readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3; - readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4; - readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5; - readonly attribute optional nullable int32u wiredAssessedCurrent = 6; - readonly attribute optional int32u wiredNominalVoltage = 7; - readonly attribute optional int32u wiredMaximumCurrent = 8; - readonly attribute optional boolean wiredPresent = 9; - readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10; - readonly attribute optional nullable int32u batVoltage = 11; - readonly attribute optional nullable int8u batPercentRemaining = 12; - readonly attribute optional nullable int32u batTimeRemaining = 13; - readonly attribute optional BatChargeLevelEnum batChargeLevel = 14; - readonly attribute optional boolean batReplacementNeeded = 15; - readonly attribute optional BatReplaceabilityEnum batReplaceability = 16; - readonly attribute optional boolean batPresent = 17; - readonly attribute optional BatFaultEnum activeBatFaults[] = 18; - readonly attribute optional char_string<60> batReplacementDescription = 19; - readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20; - readonly attribute optional char_string<20> batANSIDesignation = 21; - readonly attribute optional char_string<20> batIECDesignation = 22; - readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23; - readonly attribute optional int32u batCapacity = 24; - readonly attribute optional int8u batQuantity = 25; - readonly attribute optional BatChargeStateEnum batChargeState = 26; - readonly attribute optional nullable int32u batTimeToFullCharge = 27; - readonly attribute optional boolean batFunctionalWhileCharging = 28; - readonly attribute optional nullable int32u batChargingCurrent = 29; - readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30; - readonly attribute endpoint_no endpointList[] = 31; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1253,53 +994,6 @@ cluster NetworkCommissioning = 49 { command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; } -/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ -cluster DiagnosticLogs = 50 { - revision 1; // NOTE: Default/not specifically set - - enum IntentEnum : enum8 { - kEndUserSupport = 0; - kNetworkDiag = 1; - kCrashLogs = 2; - } - - enum StatusEnum : enum8 { - kSuccess = 0; - kExhausted = 1; - kNoLogs = 2; - kBusy = 3; - kDenied = 4; - } - - enum TransferProtocolEnum : enum8 { - kResponsePayload = 0; - kBDX = 1; - } - - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct RetrieveLogsRequestRequest { - IntentEnum intent = 0; - TransferProtocolEnum requestedProtocol = 1; - optional char_string<32> transferFileDesignator = 2; - } - - response struct RetrieveLogsResponse = 1 { - StatusEnum status = 0; - long_octet_string logContent = 1; - optional epoch_us UTCTimeStamp = 2; - optional systime_us timeSinceBoot = 3; - } - - /** Retrieving diagnostic logs from a Node */ - command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; -} - /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ cluster GeneralDiagnostics = 51 { revision 2; @@ -1431,43 +1125,6 @@ cluster GeneralDiagnostics = 51 { command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; } -/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ -cluster SoftwareDiagnostics = 52 { - revision 1; // NOTE: Default/not specifically set - - bitmap Feature : bitmap32 { - kWatermarks = 0x1; - } - - struct ThreadMetricsStruct { - int64u id = 0; - optional char_string<8> name = 1; - optional int32u stackFreeCurrent = 2; - optional int32u stackFreeMinimum = 3; - optional int32u stackSize = 4; - } - - info event SoftwareFault = 0 { - int64u id = 0; - optional char_string name = 1; - optional octet_string faultRecording = 2; - } - - readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0; - readonly attribute optional int64u currentHeapFree = 1; - readonly attribute optional int64u currentHeapUsed = 2; - readonly attribute optional int64u currentHeapHighWatermark = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - /** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */ - command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; -} - /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ cluster ThreadNetworkDiagnostics = 53 { revision 2; @@ -1888,43 +1545,6 @@ cluster GroupKeyManagement = 63 { fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; } -/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only -labels. */ -cluster FixedLabel = 64 { - revision 1; // NOTE: Default/not specifically set - - struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; - } - - readonly attribute LabelStruct labelList[] = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ -cluster UserLabel = 65 { - revision 1; // NOTE: Default/not specifically set - - struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; - } - - attribute access(write: manage) LabelStruct labelList[] = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Attributes and commands for scene configuration and manipulation. */ provisional cluster ScenesManagement = 98 { revision 1; @@ -2515,13 +2135,6 @@ endpoint 0 { handle command ReorderNetwork; } - server cluster DiagnosticLogs { - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - - handle command RetrieveLogsRequest; - } - server cluster GeneralDiagnostics { emits event BootReason; callback attribute networkInterfaces; @@ -2541,18 +2154,6 @@ endpoint 0 { handle command TimeSnapshotResponse; } - server cluster SoftwareDiagnostics { - emits event SoftwareFault; - callback attribute threadMetrics; - callback attribute currentHeapFree; - callback attribute currentHeapUsed; - callback attribute currentHeapHighWatermark; - callback attribute featureMap; - ram attribute clusterRevision default = 1; - - handle command ResetWatermarks; - } - server cluster ThreadNetworkDiagnostics { callback attribute channel; callback attribute routingRole; @@ -2673,22 +2274,9 @@ endpoint 0 { handle command KeySetReadAllIndices; handle command KeySetReadAllIndicesResponse; } - - server cluster FixedLabel { - callback attribute labelList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster UserLabel { - callback attribute labelList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } } endpoint 1 { - device type ma_powersource = 17, version 1; - device type ma_dimmablelight = 257, version 1; + device type ma_extendedcolorlight = 269, version 1; server cluster Identify { @@ -2792,26 +2380,6 @@ endpoint 1 { callback attribute clusterRevision; } - server cluster PowerSource { - ram attribute status default = 0; - ram attribute order default = 0; - ram attribute description default = "USB"; - ram attribute wiredAssessedInputVoltage; - ram attribute wiredAssessedInputFrequency; - ram attribute wiredCurrentType default = 1; - ram attribute wiredAssessedCurrent; - ram attribute wiredNominalVoltage default = 5000; - ram attribute wiredMaximumCurrent default = 1000; - ram attribute wiredPresent default = 1; - callback attribute endpointList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 1; - ram attribute clusterRevision default = 2; - } - server cluster ScenesManagement { ram attribute lastConfiguredBy; ram attribute sceneTableSize default = 16; @@ -2860,6 +2428,10 @@ endpoint 1 { ram attribute colorTempPhysicalMaxMireds default = 0xFEFF; ram attribute coupleColorTempToLevelMinMireds; persist attribute startUpColorTemperatureMireds; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 6; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index b894a2f5a70c00..9e293bcd3032d1 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -17,6 +17,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../../../src/app/zap-templates/zcl/zcl.json", @@ -24,12 +30,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -1494,58 +1494,6 @@ } ] }, - { - "name": "Diagnostic Logs", - "code": 50, - "mfgCode": null, - "define": "DIAGNOSTIC_LOGS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "RetrieveLogsRequest", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "General Diagnostics", "code": 51, @@ -1767,131 +1715,6 @@ } ] }, - { - "name": "Software Diagnostics", - "code": 52, - "mfgCode": null, - "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ResetWatermarks", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "ThreadMetrics", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapFree", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapUsed", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentHeapHighWatermark", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ], - "events": [ - { - "name": "SoftwareFault", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1 - } - ] - }, { "name": "Thread Network Diagnostics", "code": 53, @@ -3451,229 +3274,105 @@ "reportableChange": 0 } ] - }, + } + ] + }, + { + "id": 2, + "name": "MA-dimmablelight", + "deviceTypeRef": { + "code": 269, + "profileId": 259, + "label": "MA-extendedcolorlight", + "name": "MA-extendedcolorlight" + }, + "deviceTypes": [ + { + "code": 269, + "profileId": 259, + "label": "MA-extendedcolorlight", + "name": "MA-extendedcolorlight" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 269 + ], + "deviceTypeName": "MA-extendedcolorlight", + "deviceTypeCode": 269, + "deviceTypeProfileId": 259, + "clusters": [ { - "name": "Fixed Label", - "code": 64, + "name": "Identify", + "code": 3, "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", + "define": "IDENTIFY_CLUSTER", "side": "server", "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], "attributes": [ { - "name": "LabelList", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", - "type": "array", + "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 }, { - "name": "FeatureMap", - "code": 65532, + "name": "IdentifyType", + "code": 1, "mfgCode": null, "side": "server", - "type": "bitmap32", + "type": "IdentifyTypeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", - "reportable": 1, + "defaultValue": "0x0", + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - } - ] - }, - { - "id": 2, - "name": "MA-dimmablelight", - "deviceTypeRef": { - "code": 257, - "profileId": 259, - "label": "MA-dimmablelight", - "name": "MA-dimmablelight" - }, - "deviceTypes": [ - { - "code": 257, - "profileId": 259, - "label": "MA-dimmablelight", - "name": "MA-dimmablelight" - }, - { - "code": 17, - "profileId": 259, - "label": "MA-powersource", - "name": "MA-powersource" - } - ], - "deviceVersions": [ - 1, - 1 - ], - "deviceIdentifiers": [ - 257, - 17 - ], - "deviceTypeName": "MA-dimmablelight", - "deviceTypeCode": 257, - "deviceTypeProfileId": 259, - "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "TriggerEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "IdentifyTime", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IdentifyType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "IdentifyTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3862,7 +3561,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4034,7 +3733,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4050,7 +3749,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x01", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4066,7 +3765,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0000", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4082,7 +3781,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0000", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4098,7 +3797,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0xFF", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4286,7 +3985,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x01", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4302,7 +4001,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0000", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4318,7 +4017,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x01", - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -4398,7 +4097,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4430,7 +4129,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0xFF", - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -4494,7 +4193,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "255", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4632,7 +4331,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -4648,7 +4347,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -4664,7 +4363,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -4767,288 +4466,6 @@ } ] }, - { - "name": "Power Source", - "code": 47, - "mfgCode": null, - "define": "POWER_SOURCE_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "Status", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "PowerSourceStatusEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Order", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Description", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "USB", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredAssessedInputVoltage", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredAssessedInputFrequency", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredCurrentType", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "WiredCurrentTypeEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredAssessedCurrent", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredNominalVoltage", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredMaximumCurrent", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "WiredPresent", - "code": 9, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EndpointList", - "code": 31, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Scenes Management", "code": 98, @@ -5515,7 +4932,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0000", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5531,7 +4948,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x616B", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5547,7 +4964,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x607D", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5563,7 +4980,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00FA", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5579,7 +4996,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x01", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5595,7 +5012,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5611,7 +5028,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5643,7 +5060,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x01", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5739,7 +5156,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x1F", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5755,7 +5172,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0000", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5771,7 +5188,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0xFEFF", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5787,7 +5204,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -5803,11 +5220,75 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, diff --git a/examples/lighting-app/silabs/openthread.gni b/examples/lighting-app/silabs/openthread.gni index 71fa3271ea5073..b39a1cb8e5878d 100644 --- a/examples/lighting-app/silabs/openthread.gni +++ b/examples/lighting-app/silabs/openthread.gni @@ -23,5 +23,8 @@ app_data_model = chip_enable_ota_requestor = true chip_enable_openthread = true +# Not needed for the Lighting-app +chip_enable_read_client = false + openthread_external_platform = "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/platform/silabs/matter-platform.slcp b/examples/platform/silabs/matter-platform.slcp index bc30556be60fe5..3e1c52a6ec66f5 100644 --- a/examples/platform/silabs/matter-platform.slcp +++ b/examples/platform/silabs/matter-platform.slcp @@ -31,22 +31,19 @@ sdk: {id: gecko_sdk, version: 4.3.1} toolchain_settings: [] component: -- {id: bluetooth_feature_nvm} +#bluetooth components +- {id: gatt_configuration} - {id: bluetooth_feature_gatt_server} -- {id: nvm3_lib} -- {id: bluetooth_feature_sm} -- {id: bluetooth_feature_gap} - {id: bluetooth_feature_legacy_advertiser} -- {id: gatt_configuration} -- {id: freertos} +- {id: bluetooth_feature_connection} +- {id: bluetooth_feature_system} - {id: bluetooth_stack} +# Other components +- {id: nvm3_lib} +- {id: freertos} - {id: brd4002a} - {id: rail_util_pti} -- {id: bluetooth_feature_gatt} -- {id: bluetooth_feature_connection} - {id: rail_lib_multiprotocol} -- {id: bluetooth_feature_system} -- {id: bluetooth_feature_scanner} - {id: rail_util_power_manager_init} - {id: psa_crypto} - {id: psa_crypto_aes} @@ -62,7 +59,6 @@ component: - {id: mbedtls_platform_dynamic_memory_allocation_config_init_runtime } - {id: mbedtls_base64} - {id: ot_psa_crypto} -- {id: bluetooth_crypto} - {id: iostream_rtt} # Necessary componenets for ot coap cert lib # - {id: mbedtls_dtls} # Requried by COAP lib diff --git a/src/platform/silabs/ConfigurationManagerImpl.cpp b/src/platform/silabs/ConfigurationManagerImpl.cpp index 8412075de3a914..5ebf349c15484b 100644 --- a/src/platform/silabs/ConfigurationManagerImpl.cpp +++ b/src/platform/silabs/ConfigurationManagerImpl.cpp @@ -255,7 +255,9 @@ CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueBin(Key key, const uint8_t void ConfigurationManagerImpl::RunConfigUnitTest(void) { +#if CONFIG_BUILD_FOR_HOST_UNIT_TEST SilabsConfig::RunConfigUnitTest(); +#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST } void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) diff --git a/src/platform/silabs/SilabsConfig.cpp b/src/platform/silabs/SilabsConfig.cpp index 6c362d41c2c330..356aa4c39b1703 100644 --- a/src/platform/silabs/SilabsConfig.cpp +++ b/src/platform/silabs/SilabsConfig.cpp @@ -552,11 +552,13 @@ bool SilabsConfig::ValidConfigKey(Key key) return false; } +#if CONFIG_BUILD_FOR_HOST_UNIT_TEST void SilabsConfig::RunConfigUnitTest() { // Run common unit test. ::chip::DeviceLayer::Internal::RunConfigUnitTest(); } +#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST void SilabsConfig::RepackNvm3Flash(void) { diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 53f098de9fdc7d..0dbd0dd89fa90d 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 53f098de9fdc7db248a72eabbe07d8ce4876daab +Subproject commit 0dbd0dd89fa90dc6e0d1d2636563ea980c010c19