Skip to content

Commit

Permalink
[ICD] Create ICDConfigurationData class with associated refactor (pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs authored Nov 28, 2023
1 parent 28c679c commit 6778d3e
Show file tree
Hide file tree
Showing 26 changed files with 578 additions and 391 deletions.
10 changes: 10 additions & 0 deletions examples/lock-app/silabs/build_for_wifi_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ import("${chip_root}/src/platform/silabs/wifi_args.gni")

chip_enable_ota_requestor = true
app_data_model = "${chip_root}/examples/lock-app/lock-common"

# ICD Default configurations
chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true

# ICD Matter Configuration flags
sl_idle_mode_interval_s = 600 # 10min Idle Mode Interval
sl_active_mode_interval_ms = 10000 # 10s Active Mode Interval
sl_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
4 changes: 2 additions & 2 deletions src/app/ReadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <app/reporting/Engine.h>

#if CHIP_CONFIG_ENABLE_ICD_SERVER
#include <app/icd/ICDManagementServer.h> // nogncheck
#include <app/icd/ICDConfigurationData.h> //nogncheck
#endif

namespace chip {
Expand All @@ -46,7 +46,7 @@ using Status = Protocols::InteractionModel::Status;
uint16_t ReadHandler::GetPublisherSelectedIntervalLimit()
{
#if CHIP_CONFIG_ENABLE_ICD_SERVER
return static_cast<uint16_t>(ICDManagementServer::GetInstance().GetIdleModeDurationSec());
return static_cast<uint16_t>(ICDConfigurationData::GetInstance().GetIdleModeDurationSec());
#else
return kSubscriptionMaxIntervalPublisherLimit;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/app/chip_data_model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function(chip_configure_data_model APP_TARGET)
${CHIP_APP_BASE_DIR}/util/attribute-table.cpp
${CHIP_APP_BASE_DIR}/util/binding-table.cpp
${CHIP_APP_BASE_DIR}/icd/ICDMonitoringTable.cpp
${CHIP_APP_BASE_DIR}/icd/ICDManagementServer.cpp
${CHIP_APP_BASE_DIR}/icd/ICDNotifier.cpp
${CHIP_APP_BASE_DIR}/icd/ICDConfigurationData.cpp
${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp
${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp
${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp
Expand Down
10 changes: 7 additions & 3 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ template("chip_data_model") {
"${_app_root}/clusters/color-control-server/color-control-server.h",
"${_app_root}/clusters/door-lock-server/door-lock-server.h",
"${_app_root}/clusters/groups-server/groups-server.h",
"${_app_root}/clusters/icd-management-server/icd-management-server.h",
"${_app_root}/clusters/identify-server/identify-server.h",
"${_app_root}/clusters/level-control/level-control.h",
"${_app_root}/clusters/on-off-server/on-off-server.h",
Expand Down Expand Up @@ -294,10 +293,15 @@ template("chip_data_model") {
"${_app_root}/clusters/${cluster}/dishwasher-alarm-delegate.h",
]
} else if (cluster == "icd-management-server") {
sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ]
sources += [
"${_app_root}/clusters/${cluster}/${cluster}.cpp",
"${_app_root}/clusters/${cluster}/${cluster}.h",
]
deps += [
"${chip_root}/src/app/icd:cluster",
"${chip_root}/src/app/icd:configuration-data",
"${chip_root}/src/app/icd:icd_config",
"${chip_root}/src/app/icd:monitoring-table",
"${chip_root}/src/app/icd:notifier",
]
} else if (cluster == "resource-monitoring-server") {
sources += [
Expand Down
Loading

0 comments on commit 6778d3e

Please sign in to comment.