19
19
20
20
#include " matter_config.h"
21
21
#include " AppTask.h"
22
+ #include " EventManagementTestEventTriggerHandler.h"
22
23
#ifdef BOARD_ENABLE_DISPLAY
23
24
#include " GUI.h"
24
25
#endif
44
45
#include < lib/support/CHIPPlatformMemory.h>
45
46
#include < mbedtls/platform.h>
46
47
#include < platform/DeviceInstanceInfoProvider.h>
47
- #include < platform/Infineon/CYW30739/FactoryDataProvider.h>
48
48
#include < platform/KeyValueStoreManager.h>
49
49
#include < protocols/secure_channel/PASESession.h>
50
- #ifdef BOARD_ENABLE_OPTIGA
51
- #include " wiced_optiga.h"
52
- #endif
53
50
#include < wiced_rtos.h>
54
51
52
+ #ifdef BOARD_USE_OPTIGA
53
+ #include " wiced_optiga.h"
54
+ #ifdef USE_PROVISIONED_OPTIGA
55
+ #include < platform/Infineon/CYW30739/OptigaFactoryDataProvider.h>
56
+ #else /* !USE_PROVISIONED_OPTIGA */
57
+ #include < platform/Infineon/CYW30739/UnprovisionedOptigaFactoryDataProvider.h>
58
+ #endif /* USE_PROVISIONED_OPTIGA */
59
+ #else /* !BOARD_USE_OPTIGA */
60
+ #include < platform/Infineon/CYW30739/FactoryDataProvider.h>
61
+ #endif /* BOARD_USE_OPTIGA */
62
+
55
63
using namespace ::chip;
56
64
using namespace ::chip::Inet;
57
65
using namespace ::chip::Credentials;
@@ -60,7 +68,15 @@ using namespace ::chip::Shell;
60
68
using namespace ::chip::app;
61
69
62
70
static DeviceInfoProviderImpl sExampleDeviceInfoProvider ;
71
+ #ifdef BOARD_USE_OPTIGA
72
+ #ifdef USE_PROVISIONED_OPTIGA
73
+ static OptigaFactoryDataProvider sFactoryDataProvider ;
74
+ #else /* !USE_PROVISIONED_OPTIGA */
75
+ static UnprovisionedOptigaFactoryDataProvider sFactoryDataProvider ;
76
+ #endif /* USE_PROVISIONED_OPTIGA */
77
+ #else /* !BOARD_USE_OPTIGA */
63
78
static FactoryDataProvider sFactoryDataProvider ;
79
+ #endif /* BOARD_USE_OPTIGA */
64
80
65
81
// NOTE! This key is for test/certification only and should not be available in production devices!
66
82
uint8_t sTestEventTriggerEnableKey [chip::TestEventTriggerDelegate::kEnableKeyLength ] = { 0x00 , 0x11 , 0x22 , 0x33 , 0x44 , 0x55 ,
@@ -135,7 +151,7 @@ void CYW30739MatterConfig::InitBoard(void)
135
151
#ifdef BOARD_ENABLE_DISPLAY
136
152
GUI_Init ();
137
153
#endif
138
- #ifdef BOARD_ENABLE_OPTIGA
154
+ #ifdef BOARD_USE_OPTIGA
139
155
wiced_optiga_init ();
140
156
#endif
141
157
}
@@ -186,13 +202,17 @@ void CYW30739MatterConfig::InitApp(void)
186
202
LogAppInit ();
187
203
ConfigurationMgr ().LogDeviceConfig ();
188
204
205
+ sFactoryDataProvider .Init ();
206
+
189
207
// Print QR Code URL
190
208
PrintOnboardingCodes (chip::RendezvousInformationFlag (chip::RendezvousInformationFlag::kBLE ));
191
209
/* Start CHIP datamodel server */
192
210
static chip::SimpleTestEventTriggerDelegate sTestEventTriggerDelegate {};
193
211
static chip::OTATestEventTriggerHandler sOtaTestEventTriggerHandler {};
212
+ static Infineon::CYW30739::EventManagementTestEventTriggerHandler sEventManagementTestEventTriggerHandler {};
194
213
VerifyOrDie (sTestEventTriggerDelegate .Init (chip::ByteSpan (sTestEventTriggerEnableKey )) == CHIP_NO_ERROR);
195
214
VerifyOrDie (sTestEventTriggerDelegate .AddHandler (&sOtaTestEventTriggerHandler ) == CHIP_NO_ERROR);
215
+ VerifyOrDie (sTestEventTriggerDelegate .AddHandler (&sEventManagementTestEventTriggerHandler ) == CHIP_NO_ERROR);
196
216
// Create initParams with SDK example defaults here
197
217
static chip::CommonCaseDeviceServerInitParams initParams;
198
218
(void ) initParams.InitializeStaticResourcesBeforeServerInit ();
0 commit comments