Skip to content

Commit 9df79e5

Browse files
Fix build and remove test key when not in debug build
1 parent b2260b0 commit 9df79e5

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

examples/platform/silabs/MatterConfig.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys
5858
#include <app/InteractionModelEngine.h>
5959
#include <app/TimerDelegates.h>
6060

61-
#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
62-
#include "SilabsTestEventTriggerDelegate.h"
63-
#endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
61+
#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
62+
#include "SilabsTestEventTriggerDelegate.h" // nogncheck
63+
#endif
6464

6565
#if CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED
6666
#include <app/reporting/SynchronizedReportSchedulerImpl.h>
@@ -277,7 +277,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
277277

278278
initParams.reportScheduler = &sReportScheduler;
279279

280-
#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
280+
#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
281281
static SilabsTestEventTriggerDelegate sTestEventTriggerDelegate;
282282
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
283283
#endif // SL_MATTER_TEST_EVENT_TRIGGER_ENABLED

examples/platform/silabs/SiWx917/BUILD.gn

+5-4
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ config("chip_examples_project_config") {
7878
}
7979

8080
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-
]
81+
defines = [ "SL_MATTER_TEST_EVENT_TRIGGER_ENABLED" ]
82+
83+
if (is_debug) {
84+
defines += [ "SL_MATTER_TEST_EVENT_TRIGGER_ENABLE_KEY=\"${sl_test_event_trigger_enable_key}\"" ]
85+
}
8586
}
8687

8788
source_set("test-event-trigger") {

examples/platform/silabs/SilabsTestEventTriggerDelegate.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ namespace chip {
2525

2626
bool SilabsTestEventTriggerDelegate::DoesEnableKeyMatch(const ByteSpan & enableKey) const
2727
{
28-
uint8_t enableKey[TestEventTriggerDelegate::kEnableKeyLength];
29-
MutableByteSpan enableKeySpan(mEnableKey);
28+
uint8_t storedEnableKey[TestEventTriggerDelegate::kEnableKeyLength];
29+
MutableByteSpan enableKeySpan(storedEnableKey);
3030

3131
// Return false if we were not able to get the enableKey
3232
VerifyOrReturnValue(

examples/platform/silabs/efr32/BUILD.gn

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

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

104105
source_set("test-event-trigger") {

0 commit comments

Comments
 (0)