Skip to content

Commit 709e864

Browse files
port test event trigger changes to 917 build.gn
1 parent 512633f commit 709e864

File tree

6 files changed

+62
-27
lines changed

6 files changed

+62
-27
lines changed

examples/platform/silabs/MatterConfig.cpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys
5555
#endif
5656

5757
#include "SilabsDeviceDataProvider.h"
58-
#include "SilabsTestEventTriggerDelegate.h"
5958
#include <app/InteractionModelEngine.h>
6059
#include <app/TimerDelegates.h>
6160

61+
#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
62+
#include "SilabsTestEventTriggerDelegate.h"
63+
#endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
64+
6265
#if CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED
6366
#include <app/reporting/SynchronizedReportSchedulerImpl.h>
6467
#else
@@ -216,12 +219,6 @@ void SilabsMatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event
216219
}
217220
}
218221

219-
#if SILABS_TEST_EVENT_TRIGGER_ENABLED
220-
static uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
221-
0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
222-
0xcc, 0xdd, 0xee, 0xff };
223-
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED
224-
225222
CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
226223
{
227224
CHIP_ERROR err;
@@ -281,10 +278,9 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
281278
initParams.reportScheduler = &sReportScheduler;
282279

283280
#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
284-
// TODO(#31723): Show to customers that they can do `Server::GetInstance().GetTestEventTriggerDelegate().AddHandler()`
285281
static SilabsTestEventTriggerDelegate sTestEventTriggerDelegate;
286282
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
287-
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED
283+
#endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
288284

289285
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_SI91X_MCU_INTERFACE))
290286
// When building with EFR32 crypto, use the opaque key store

examples/platform/silabs/SiWx917/BUILD.gn

+33-9
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ declare_args() {
4141
chip_default_wifi_psk = ""
4242

4343
# Enable TestEventTrigger in GeneralDiagnostics cluster
44-
silabs_test_event_trigger_enabled = false
44+
sl_enable_test_event_trigger = false
4545

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

5151
# Sanity check
@@ -77,6 +77,28 @@ config("chip_examples_project_config") {
7777
]
7878
}
7979

80+
config("test-event-trigger-config") {
81+
defines = [
82+
"SL_MATTER_TEST_EVENT_TRIGGER_ENABLED",
83+
"SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${sl_test_event_trigger_enable_key}\"",
84+
]
85+
}
86+
87+
source_set("test-event-trigger") {
88+
sources = [
89+
"${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.cpp",
90+
"${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.h",
91+
]
92+
93+
public_configs = [ ":test-event-trigger-config" ]
94+
95+
public_deps = [
96+
":silabs-factory-data-provider",
97+
"${chip_root}/src/lib/core",
98+
"${chip_root}/src/lib/support",
99+
]
100+
}
101+
80102
source_set("siwx917-matter-shell") {
81103
if (chip_build_libshell) {
82104
defines = [ "ENABLE_CHIP_SHELL" ]
@@ -126,6 +148,10 @@ source_set("silabs-factory-data-provider") {
126148
]
127149

128150
public_configs = [ ":siwx917-common-config" ]
151+
152+
if (sl_enable_test_event_trigger) {
153+
public_configs += [ ":test-event-trigger-config" ]
154+
}
129155
}
130156

131157
config("siwx917-common-config") {
@@ -267,18 +293,16 @@ source_set("siwx917-common") {
267293
public_deps += [ ":silabs-factory-data-provider" ]
268294
}
269295

270-
if (silabs_test_event_trigger_enabled) {
271-
sources +=
272-
[ "${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.cpp" ]
273-
defines += [ "SILABS_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${silabs_test_event_trigger_enable_key}\"" ]
274-
}
275-
276296
public_deps += [
277297
"${chip_root}/examples/providers:device_info_provider",
278298
"${chip_root}/src/lib",
279299
"${chip_root}/src/setup_payload",
280300
]
281301

302+
if (sl_enable_test_event_trigger) {
303+
public_deps += [ ":test-event-trigger" ]
304+
}
305+
282306
if (app_data_model != "") {
283307
public_deps += [ app_data_model ]
284308
}

examples/platform/silabs/efr32/BUILD.gn

+6-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ config("chip_examples_project_config") {
9595
}
9696

9797
config("test-event-trigger-config") {
98-
defines = [ "SL_MATTER_TEST_EVENT_TRIGGER_ENABLED" ]
99-
100-
if (sl_test_event_trigger_enable_key != "") {
101-
defines += [ "SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${sl_test_event_trigger_enable_key}\"" ]
102-
}
98+
defines = [
99+
"SL_MATTER_TEST_EVENT_TRIGGER_ENABLED",
100+
"SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${sl_test_event_trigger_enable_key}\"",
101+
]
103102
}
104103

105104
source_set("test-event-trigger") {
@@ -233,13 +232,15 @@ config("silabs-wifi-config") {
233232
if (sl_wfx_config_softap) {
234233
defines += [ "SL_WFX_CONFIG_SOFTAP" ]
235234
}
235+
236236
if (sl_wfx_config_scan) {
237237
defines += [ "SL_WFX_CONFIG_SCAN" ]
238238
}
239239

240240
if (chip_enable_wifi_ipv4) {
241241
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
242242
}
243+
243244
if (rs91x_wpa3_transition) {
244245
# TODO: Change this macro once WF200 support is provided
245246
defines += [ "WIFI_ENABLE_SECURITY_WPA3_TRANSITION=1" ]

examples/smoke-co-alarm-app/silabs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ features can easily be toggled on or off. Here is a short list of options :
384384

385385
### Enabling test event trigger
386386

387-
`silabs_test_event_trigger_enabled, silabs_test_event_trigger_enable_key`
387+
`sl_enable_test_event_trigger`
388388

389389
```
390-
The value of silabs_test_event_trigger_enable_key is specific to each device manufacturer
390+
The enable the test event trigger, `sl_enable_test_event_trigger` must be true.
391391

392-
$ ./scripts/examples/gn_silabs_example.sh ./examples/smoke-co-alarm-app/silabs ./out/smoke-co-alarm-app BRD4164A silabs_test_event_trigger_enabled=true silabs_test_event_trigger_enable_key=\"00112233445566778899aabbccddeeff\"
392+
$ ./scripts/examples/gn_silabs_example.sh ./examples/smoke-co-alarm-app/silabs ./out/smoke-co-alarm-app BRD4164A sl_enable_test_event_trigger=true
393393
```

examples/smoke-co-alarm-app/silabs/build_for_wifi_args.gni

+14
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@ import("${chip_root}/src/platform/silabs/wifi_args.gni")
2121
chip_enable_ota_requestor = true
2222
app_data_model =
2323
"${chip_root}/examples/smoke-co-alarm-app/smoke-co-alarm-common"
24+
25+
sl_enable_test_event_trigger = true
26+
27+
# ICD Default configurations
28+
chip_enable_icd_server = true
29+
chip_subscription_timeout_resumption = false
30+
sl_use_subscription_synching = true
31+
icd_enforce_sit_slow_poll_limit = true
32+
chip_enable_icd_lit = true
33+
34+
# ICD Matter Configuration flags
35+
sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration
36+
sl_active_mode_duration_ms = 0 # 0 Active Mode Duration
37+
sl_active_mode_threshold_ms = 30000 # 30s Active Mode Threshold

examples/smoke-co-alarm-app/silabs/openthread.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ check_system_includes = true
2323
default_args = {
2424
target_cpu = "arm"
2525
target_os = "freertos"
26-
chip_openthread_ftd = false
26+
chip_openthread_ftd = true
2727

2828
import("//openthread.gni")
2929
}

0 commit comments

Comments
 (0)