Skip to content

Commit

Permalink
Merge branch 'master' into chef-nrf-contact-sensor-battery-324031858
Browse files Browse the repository at this point in the history
  • Loading branch information
stingchang authored Apr 11, 2024
2 parents bc5b6b9 + 15f2c49 commit 4f1cf38
Show file tree
Hide file tree
Showing 69 changed files with 948 additions and 1,039 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/kotlin-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ jobs:
uses: actions/checkout@v4

- name: "detekt"
uses: natiginfo/[email protected].5
uses: natiginfo/[email protected].6
# Detekt seems not to like circular symlinks, so we set up
# explicit paths below
#
# In particular, if symlinks exist and recurse, detekt tries to
# follow, so for example `examples/android/CHIPTest` as a path
# will never end (and eventually run out of HEAP) because
# `examples/android/CHIPTest/third_party/connectedhomeip` is
# circular
with:
args: --parallel --build-upon-default-config --config kotlin-detect-config.yaml --input examples/android/CHIPTest,examples/android/CHIPTool,examples/java-matter-controller/java,src/controller/java
args: --parallel --build-upon-default-config --config kotlin-detect-config.yaml --input examples/android/CHIPTest/app,examples/android/CHIPTool,examples/java-matter-controller/java,src/controller/java

ktlint:
name: "Format check"
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ openthread_external_platform =
# ICD Default configurations
chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
sl_use_subscription_syncing = true

# Openthread Configuration flags
sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ endpoint 1 {
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 6;
ram attribute clusterRevision default = 5;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4288,7 +4288,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "6",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
2 changes: 1 addition & 1 deletion examples/lit-icd-app/silabs/build_for_wifi_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ app_data_model = "${chip_root}/examples/lit-icd-app/lit-icd-common"
# ICD Default configurations
chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
sl_use_subscription_syncing = true
icd_enforce_sit_slow_poll_limit = true
chip_enable_icd_lit = true

Expand Down
2 changes: 1 addition & 1 deletion examples/lit-icd-app/silabs/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ openthread_external_platform =
# ICD Default configurations
chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
sl_use_subscription_syncing = true
icd_enforce_sit_slow_poll_limit = true
chip_icd_report_on_active_mode = true
chip_enable_icd_lit = true
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/silabs/build_for_wifi_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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
sl_use_subscription_syncing = true

# ICD Matter Configuration flags
sl_idle_mode_duration_s = 600 # 10min Idle Mode Duration
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/silabs/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ openthread_external_platform =
# ICD Default configurations
chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
sl_use_subscription_syncing = true

# Openthread Configuration flags
sl_ot_idle_interval_ms = 5000 # 5s Idle Intervals
Expand Down
32 changes: 7 additions & 25 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys
#endif

#include "SilabsDeviceDataProvider.h"
#include "SilabsTestEventTriggerDelegate.h"
#include <app/InteractionModelEngine.h>
#include <app/TimerDelegates.h>

#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
#include "SilabsTestEventTriggerDelegate.h" // nogncheck
#endif

#if CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED
#include <app/reporting/SynchronizedReportSchedulerImpl.h>
#else
Expand Down Expand Up @@ -219,12 +222,6 @@ void SilabsMatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event
}
}

#if SILABS_TEST_EVENT_TRIGGER_ENABLED
static uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
0xcc, 0xdd, 0xee, 0xff };
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED

CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
{
CHIP_ERROR err;
Expand Down Expand Up @@ -283,18 +280,10 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)

initParams.reportScheduler = &sReportScheduler;

#if SILABS_TEST_EVENT_TRIGGER_ENABLED
if (Encoding::HexToBytes(SILABS_TEST_EVENT_TRIGGER_ENABLE_KEY, strlen(SILABS_TEST_EVENT_TRIGGER_ENABLE_KEY),
sTestEventTriggerEnableKey,
TestEventTriggerDelegate::kEnableKeyLength) != TestEventTriggerDelegate::kEnableKeyLength)
{
SILABS_LOG("Failed to convert the EnableKey string to octstr type value");
memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey));
}
// TODO(#31723): Show to customers that they can do `Server::GetInstance().GetTestEventTriggerDelegate().AddHandler()`
static SilabsTestEventTriggerDelegate sTestEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) };
#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
static SilabsTestEventTriggerDelegate sTestEventTriggerDelegate;
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED
#endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED

#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_SI91X_MCU_INTERFACE))
// When building with EFR32 crypto, use the opaque key store
Expand All @@ -303,13 +292,6 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
initParams.operationalKeystore = &gOperationalKeystore;
#endif

#ifdef PERFORMANCE_TEST_ENABLED
// Set up Test Event Trigger command of the General Diagnostics cluster. Used only in performance testing
// TODO(#31723): Show to customers that they can do `Server::GetInstance().GetTestEventTriggerDelegate().AddHandler()`
static SilabsTestEventTriggerDelegate sTestEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) };
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
#endif

// Initialize the remaining (not overridden) providers to the SDK example defaults
(void) initParams.InitializeStaticResourcesBeforeServerInit();

Expand Down
51 changes: 35 additions & 16 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,18 @@ declare_args() {
# Argument to force enable WPA3 security on rs91x
rs91x_wpa3_transition = true

# use commissionable data for SiWx917
siwx917_commissionable_data = false

#default WiFi SSID
chip_default_wifi_ssid = ""

#default Wifi Password
chip_default_wifi_psk = ""

# Enable TestEventTrigger in GeneralDiagnostics cluster
silabs_test_event_trigger_enabled = false
sl_enable_test_event_trigger = false

# The EnableKey in hex string format used by TestEventTrigger command in
# GeneralDiagnostics cluster. The length of the string should be 32.
silabs_test_event_trigger_enable_key = "00112233445566778899aabbccddeeff"
# GeneralDiagnostics cluster. The length of the string should be 16 bytes.
sl_test_event_trigger_enable_key = "00112233445566778899AABBCCDDEEFF"
}

# Sanity check
Expand Down Expand Up @@ -80,6 +77,30 @@ config("chip_examples_project_config") {
]
}

config("test-event-trigger-config") {
defines = [ "SL_MATTER_TEST_EVENT_TRIGGER_ENABLED" ]

if (is_debug) {
defines += [ "SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${sl_test_event_trigger_enable_key}\"" ]
}
}

source_set("test-event-trigger") {
sources = [
"${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.cpp",
"${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.h",
]

public_configs = [ ":test-event-trigger-config" ]

public_deps = [
":silabs-factory-data-provider",
"${chip_root}/src/app:test-event-trigger",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
]
}

source_set("siwx917-matter-shell") {
if (chip_build_libshell) {
defines = [ "ENABLE_CHIP_SHELL" ]
Expand Down Expand Up @@ -129,6 +150,10 @@ source_set("silabs-factory-data-provider") {
]

public_configs = [ ":siwx917-common-config" ]

if (sl_enable_test_event_trigger) {
public_configs += [ ":test-event-trigger-config" ]
}
}

config("siwx917-common-config") {
Expand All @@ -152,10 +177,6 @@ config("siwx917-common-config") {
defines += [ "HEAP_MONITORING" ]
}

if (siwx917_commissionable_data) {
defines += [ "SIWX917_USE_COMISSIONABLE_DATA=1" ]
}

ldflags = [ "-Wl,--no-warn-rwx-segment" ]
}

Expand Down Expand Up @@ -274,18 +295,16 @@ source_set("siwx917-common") {
public_deps += [ ":silabs-factory-data-provider" ]
}

if (silabs_test_event_trigger_enabled) {
sources +=
[ "${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.cpp" ]
defines += [ "SILABS_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${silabs_test_event_trigger_enable_key}\"" ]
}

public_deps += [
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]

if (sl_enable_test_event_trigger) {
public_deps += [ ":test-event-trigger" ]
}

if (app_data_model != "") {
public_deps += [ app_data_model ]
}
Expand Down
Loading

0 comments on commit 4f1cf38

Please sign in to comment.