diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 07910e283f3a0a..67ed0ab5715709 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -3131,8 +3131,21 @@ endpoint 0 { callback attribute idleModeDuration; callback attribute activeModeDuration; callback attribute activeModeThreshold; - ram attribute featureMap default = 0x0000; + callback attribute registeredClients; + callback attribute ICDCounter; + callback attribute clientsSupportedPerFabric; + ram attribute userActiveModeTriggerHint default = 0x1115; + ram attribute userActiveModeTriggerInstruction default = "Power Cycle"; + ram attribute operatingMode default = 0; + callback attribute maximumCheckInBackOff; + ram attribute featureMap default = 15; ram attribute clusterRevision default = 3; + + handle command RegisterClient; + handle command RegisterClientResponse; + handle command UnregisterClient; + handle command StayActiveRequest; + handle command StayActiveResponse; } } endpoint 1 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 595b0d8f838a7d..bc81c51ff705c8 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -1,6 +1,6 @@ { "fileFormat": 2, - "featureLevel": 103, + "featureLevel": 104, "creator": "zap", "keyValuePairs": [ { @@ -41,14 +41,16 @@ "code": 22, "profileId": 259, "label": "MA-rootdevice", - "name": "MA-rootdevice" + "name": "MA-rootdevice", + "deviceTypeOrder": 0 }, "deviceTypes": [ { "code": 22, "profileId": 259, "label": "MA-rootdevice", - "name": "MA-rootdevice" + "name": "MA-rootdevice", + "deviceTypeOrder": 0 } ], "deviceVersions": [ @@ -4313,6 +4315,48 @@ "define": "ICD_MANAGEMENT_CLUSTER", "side": "server", "enabled": 1, + "commands": [ + { + "name": "RegisterClient", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RegisterClientResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UnregisterClient", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StayActiveRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StayActiveResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], "attributes": [ { "name": "IdleModeDuration", @@ -4362,6 +4406,118 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "RegisteredClients", + "code": 3, + "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": "ICDCounter", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientsSupportedPerFabric", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserActiveModeTriggerHint", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "UserActiveModeTriggerBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1115", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserActiveModeTriggerInstruction", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "Power Cycle", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperatingMode", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "OperatingModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaximumCheckInBackOff", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -4372,7 +4528,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "15", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4405,14 +4561,16 @@ "code": 259, "profileId": 259, "label": "MA-onofflightswitch", - "name": "MA-onofflightswitch" + "name": "MA-onofflightswitch", + "deviceTypeOrder": 0 }, "deviceTypes": [ { "code": 259, "profileId": 259, "label": "MA-onofflightswitch", - "name": "MA-onofflightswitch" + "name": "MA-onofflightswitch", + "deviceTypeOrder": 0 } ], "deviceVersions": [ @@ -5175,14 +5333,16 @@ "code": 15, "profileId": 259, "label": "MA-genericswitch", - "name": "MA-genericswitch" + "name": "MA-genericswitch", + "deviceTypeOrder": 0 }, "deviceTypes": [ { "code": 15, "profileId": 259, "label": "MA-genericswitch", - "name": "MA-genericswitch" + "name": "MA-genericswitch", + "deviceTypeOrder": 0 } ], "deviceVersions": [ diff --git a/examples/light-switch-app/silabs/openthread.gni b/examples/light-switch-app/silabs/openthread.gni index 8dd097480220b0..4ec1c04a927404 100644 --- a/examples/light-switch-app/silabs/openthread.gni +++ b/examples/light-switch-app/silabs/openthread.gni @@ -29,14 +29,17 @@ sl_enable_test_event_trigger = true # ICD Default configurations chip_enable_icd_server = true +chip_enable_icd_lit = true +chip_enable_icd_dsls = true + chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true # Openthread Configuration flags -sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals -sl_ot_active_interval_ms = 500 # 500ms Active Intervals +sl_ot_idle_interval_ms = 2100000 # 35 minutes Idle Intervals +sl_ot_active_interval_ms = 1000 # 1000ms Active Intervals # ICD Matter Configuration flags -sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration -sl_active_mode_duration_ms = 60000 # 60s Active Mode Duration -sl_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold +sl_idle_mode_duration_s = 1800 # 30min Idle Mode Duration +sl_active_mode_duration_ms = 0 # 0s Active Mode Duration +sl_active_mode_threshold_ms = 5000 # 5s Active Mode Threshold diff --git a/examples/lit-icd-app/silabs/build_for_wifi_args.gni b/examples/lit-icd-app/silabs/build_for_wifi_args.gni index 6ef009e9064d75..c8048dc71e3b4b 100644 --- a/examples/lit-icd-app/silabs/build_for_wifi_args.gni +++ b/examples/lit-icd-app/silabs/build_for_wifi_args.gni @@ -30,6 +30,7 @@ chip_enable_icd_server = true chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true chip_enable_icd_lit = true +chip_enable_icd_dsls = true # ICD Matter Configuration flags sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration diff --git a/examples/lit-icd-app/silabs/openthread.gni b/examples/lit-icd-app/silabs/openthread.gni index e84e7be8ed1292..c09176354a3d76 100644 --- a/examples/lit-icd-app/silabs/openthread.gni +++ b/examples/lit-icd-app/silabs/openthread.gni @@ -34,6 +34,7 @@ chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true chip_icd_report_on_active_mode = true chip_enable_icd_lit = true +chip_enable_icd_dsls = true # Openthread Configuration flags sl_ot_idle_interval_ms = 3600000 # 60mins Idle Polling Interval diff --git a/examples/lit-icd-app/silabs/src/ShellCommands.cpp b/examples/lit-icd-app/silabs/src/ShellCommands.cpp deleted file mode 100644 index 52f305eb275333..00000000000000 --- a/examples/lit-icd-app/silabs/src/ShellCommands.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * Copyright (c) 2023 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. - */ -#if defined(ENABLE_CHIP_SHELL) - -#include "ShellCommands.h" -#include -#include -#include - -using namespace chip; -using namespace chip::app; - -namespace LitICDCommands { - -using Shell::Engine; -using Shell::shell_command_t; -using Shell::streamer_get; -using Shell::streamer_printf; - -/** - * @brief configures lit icd matter shell - */ -void RegisterSwitchCommands() -{ - // Blank structure for now - static const shell_command_t sLitICDCommand = {}; - - Engine::Root().RegisterCommands(&sLitICDCommand, 1); -} - -} // namespace LitICDCommands - -#endif // ENABLE_CHIP_SHELL diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index b7ce3e9fed8bdf..5515708257aea4 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -37,9 +37,13 @@ #endif // QR_CODE_ENABLED #endif // DISPLAY_ENABLED -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER #include // nogncheck -#endif +#ifdef ENABLE_CHIP_SHELL +#include +#endif // ENABLE_CHIP_SHELL +#endif // defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER + #include #include #include @@ -180,7 +184,7 @@ void BaseApplicationDelegate::OnCommissioningSessionStopped() void BaseApplicationDelegate::OnCommissioningWindowClosed() { -#if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI917 +#if (defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) && SLI_SI917 if (!BaseApplication::GetProvisionStatus() && !isComissioningStarted) { int32_t status = wfx_power_save(RSI_SLEEP_MODE_8, STANDBY_POWER_SAVE_WITH_RAM_RETENTION); @@ -305,6 +309,14 @@ CHIP_ERROR BaseApplication::Init() sStatusLED.Init(SYSTEM_STATE_LED); #endif // ENABLE_WSTK_LEDS +#ifdef ENABLE_CHIP_SHELL + +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER + ICDCommands::RegisterCommands(); +#endif // defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER + +#endif // ENABLE_CHIP_SHELL + #ifdef PERFORMANCE_TEST_ENABLED RegisterPerfTestCommands(); #endif // PERFORMANCE_TEST_ENABLED @@ -342,7 +354,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent) { // The factory reset sequence was in motion. The cancellation window expired. // Factory Reset the device now. -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StopStatusLEDTimer(); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -551,7 +563,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) else { ChipLogProgress(AppServer, "Network is already provisioned, Ble advertisement not enabled"); -#if CHIP_CONFIG_ENABLE_ICD_SERVER +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER // Temporarily claim network activity, until we implement a "user trigger" reason for ICD wakeups. PlatformMgr().ScheduleWork([](intptr_t) { ICDNotifier::GetInstance().NotifyNetworkActivityNotification(); }); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -599,7 +611,7 @@ void BaseApplication::StartFactoryResetSequence() StartFunctionTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); sIsFactoryResetTriggered = true; -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StartStatusLEDTimer(); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -615,7 +627,7 @@ void BaseApplication::CancelFactoryResetSequence() { CancelFunctionTimer(); -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StopStatusLEDTimer(); #endif if (sIsFactoryResetTriggered) @@ -652,7 +664,7 @@ void BaseApplication::OnIdentifyStart(Identify * identify) { ChipLogProgress(Zcl, "onIdentifyStart"); -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StartStatusLEDTimer(); #endif } @@ -661,7 +673,7 @@ void BaseApplication::OnIdentifyStop(Identify * identify) { ChipLogProgress(Zcl, "onIdentifyStop"); -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StopStatusLEDTimer(); #endif } @@ -671,7 +683,7 @@ void BaseApplication::OnTriggerIdentifyEffectCompleted(chip::System::Layer * sys ChipLogProgress(Zcl, "Trigger Identify Complete"); sIdentifyEffect = Clusters::Identify::EffectIdentifierEnum::kStopEffect; -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StopStatusLEDTimer(); #endif } @@ -685,7 +697,7 @@ void BaseApplication::OnTriggerIdentifyEffect(Identify * identify) ChipLogDetail(AppServer, "Identify Effect Variant unsupported. Using default"); } -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER StartStatusLEDTimer(); #endif @@ -754,7 +766,7 @@ void BaseApplication::UpdateLCDStatusScreen(bool withChipStackLock) status.connected = enabled && attached; status.advertising = chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen(); status.nbFabric = chip::Server::GetInstance().GetFabricTable().FabricCount(); -#if CHIP_CONFIG_ENABLE_ICD_SERVER +#if defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER status.icdMode = (ICDConfigurationData::GetInstance().GetICDMode() == ICDConfigurationData::ICDMode::SIT) ? SilabsLCD::ICDMode_e::SIT : SilabsLCD::ICDMode_e::LIT; diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index cf7b7aedbf1cfa..b625d053b2be97 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -91,7 +91,7 @@ source_set("test-event-trigger") { ] } -source_set("siwx917-matter-shell") { +source_set("matter-shell") { if (chip_build_libshell) { defines = [ "ENABLE_CHIP_SHELL" ] @@ -226,7 +226,11 @@ source_set("siwx917-common") { } if (chip_build_libshell) { - deps += [ ":siwx917-matter-shell" ] + deps += [ ":matter-shell" ] + + if (chip_enable_icd_server) { + deps += [ "${chip_root}/examples/platform/silabs/icd:shell" ] + } } # DIC diff --git a/examples/platform/silabs/efr32/BUILD.gn b/examples/platform/silabs/efr32/BUILD.gn index f5c79a22524812..b4a4c9fdf457be 100644 --- a/examples/platform/silabs/efr32/BUILD.gn +++ b/examples/platform/silabs/efr32/BUILD.gn @@ -123,7 +123,7 @@ source_set("openthread_core_config_efr32_chip_examples") { } } -source_set("efr-matter-shell") { +source_set("matter-shell") { if (chip_build_libshell) { defines = [ "ENABLE_CHIP_SHELL" ] @@ -294,7 +294,11 @@ source_set("efr32-common") { } if (chip_build_libshell) { - deps += [ ":efr-matter-shell" ] + deps += [ ":matter-shell" ] + + if (chip_enable_icd_server) { + public_deps += [ "${silabs_common_plat_dir}/icd:shell" ] + } } public_deps += [ diff --git a/examples/platform/silabs/icd/BUILD.gn b/examples/platform/silabs/icd/BUILD.gn new file mode 100644 index 00000000000000..b734eea1f2870e --- /dev/null +++ b/examples/platform/silabs/icd/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("${chip_root}/src/app/icd/icd.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") + +# This is necessary since the BUILD.gn for both platforms are still split +shell_dependency_path = "${chip_root}/examples/platform/silabs/efr32" +if (use_SiWx917) { + shell_dependency_path = "${chip_root}/examples/platform/silabs/SiWx917" +} + +config("shell-config") { + include_dirs = [ "." ] +} + +source_set("shell") { + sources = [ + "ICDShellCommands.cpp", + "ICDShellCommands.h", + ] + + deps = [ + "${chip_root}/src/app/icd/server:icd-server-config", + "${shell_dependency_path}:matter-shell", + ] + + public_configs = [ ":shell-config" ] +} diff --git a/examples/platform/silabs/icd/ICDShellCommands.cpp b/examples/platform/silabs/icd/ICDShellCommands.cpp new file mode 100644 index 00000000000000..4bd3910634b6a1 --- /dev/null +++ b/examples/platform/silabs/icd/ICDShellCommands.cpp @@ -0,0 +1,119 @@ +/* + * + * Copyright (c) 2023 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. + */ +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using Shell::Engine; +using Shell::shell_command_t; +using Shell::streamer_get; +using Shell::streamer_printf; + +namespace { + +Engine sShellICDSubCommands; + +#if defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS +Engine sShellDynamicSitLitSubCommands; +#endif // defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS + +CHIP_ERROR HelpHandler(int argc, char ** argv) +{ + sShellICDSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return HelpHandler(argc, argv); + } + + return sShellICDSubCommands.ExecCommand(argc, argv); +} + +#if defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS +namespace DynamicSitLit { + +CHIP_ERROR HelpHandler(int argc, char ** argv) +{ + sShellDynamicSitLitSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return DynamicSitLit::HelpHandler(argc, argv); + } + + return sShellDynamicSitLitSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR SetSitModeReq(int argc, char ** argv) +{ + return chip::DeviceLayer::PlatformMgr().ScheduleWork( + [](intptr_t arg) { chip::app::ICDNotifier::GetInstance().NotifySITModeRequestNotification(); }, 0); +} + +CHIP_ERROR RemoveSitModeReq(int argc, char ** argv) +{ + return chip::DeviceLayer::PlatformMgr().ScheduleWork( + [](intptr_t arg) { chip::app::ICDNotifier::GetInstance().NotifySITModeRequestWithdrawal(); }, 0); +} + +} // namespace DynamicSitLit +#endif // defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS + +} // namespace + +namespace ICDCommands { + +/** + * @brief configures ICD matter shell + */ +void RegisterCommands() +{ + static const shell_command_t sLitICDSubCommands[] = { +#if defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS + { DynamicSitLit::CommandHandler, "dsls", "Dynamic Sit/Lit commands. Usage: dsls " }, +#endif // defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS + { &HelpHandler, "help", "Usage: icd " } + }; + sShellICDSubCommands.RegisterCommands(sLitICDSubCommands, ArraySize(sLitICDSubCommands)); + +#if defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS + static const shell_command_t sDynamicSitLitSubCommands[] = { + { &DynamicSitLit::SetSitModeReq, "add", "Add SIT mode requirement." }, + { &DynamicSitLit::RemoveSitModeReq, "remove", "Removes SIT mode requirement." }, + { &DynamicSitLit::HelpHandler, "help", "Usage : icd dsls ." } + }; + sShellDynamicSitLitSubCommands.RegisterCommands(sDynamicSitLitSubCommands, ArraySize(sDynamicSitLitSubCommands)); +#endif // defined(CHIP_CONFIG_ENABLE_ICD_DSLS) && CHIP_CONFIG_ENABLE_ICD_DSLS + + static const shell_command_t sICDCommand = { &CommandHandler, "icd", "ICD commands. Usage: icd " }; + Engine::Root().RegisterCommands(&sICDCommand, 1); +} + +} // namespace ICDCommands diff --git a/examples/lit-icd-app/silabs/include/ShellCommands.h b/examples/platform/silabs/icd/ICDShellCommands.h similarity index 82% rename from examples/lit-icd-app/silabs/include/ShellCommands.h rename to examples/platform/silabs/icd/ICDShellCommands.h index 8817c41bfbf3a6..9c276f0e0a2cc9 100644 --- a/examples/lit-icd-app/silabs/include/ShellCommands.h +++ b/examples/platform/silabs/icd/ICDShellCommands.h @@ -15,15 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #pragma once -#ifdef ENABLE_CHIP_SHELL - -namespace LitICDCommands { - -void RegisterLitICDCommands(); +namespace ICDCommands { -} // namespace LitICDCommands +void RegisterCommands(); -#endif // ENABLE_CHIP_SHELL +} // namespace ICDCommands diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 3ad401afb3e47a..0eba8fc692d6d8 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -290,7 +290,8 @@ "ActiveModeThreshold", "RegisteredClients", "ICDCounter", - "ClientsSupportedPerFabric" + "ClientsSupportedPerFabric", + "MaximumCheckInBackOff" ], "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], "Operational Credentials": [ diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c291fc651f6aa0..6907cfea0eb19f 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -284,7 +284,8 @@ "ActiveModeThreshold", "RegisteredClients", "ICDCounter", - "ClientsSupportedPerFabric" + "ClientsSupportedPerFabric", + "MaximumCheckInBackOff" ], "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], "Operational Credentials": [ diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 1fc16ed47f4d52..51fe90751ae219 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -102,7 +102,7 @@ source_set("efr32_test_main") { deps += [ "${chip_root}/third_party/openthread:openthread", "${chip_root}/third_party/openthread:openthread-platform", - "${examples_plat_dir}:efr-matter-shell", + "${examples_plat_dir}:matter-shell", ] }