Skip to content

Commit

Permalink
[Ameba] Added CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pankore committed Oct 10, 2023
1 parent 76f6ed4 commit 66a87a4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <static-supported-temperature-levels.h>
#include <support/CHIPMem.h>
#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER
#include <test_event_trigger/AmebaTestEventTriggerDelegate.h>
#endif

#if CONFIG_ENABLE_PW_RPC
#include <Rpc.h>
Expand Down Expand Up @@ -127,18 +129,22 @@ Identify gIdentify1 = {
static DeviceCallbacks EchoCallbacks;
chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

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

static void InitServer(intptr_t context)
{
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
initParams.InitializeStaticResourcesBeforeServerInit();

#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER
static AmebaTestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) };
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.testEventTriggerDelegate = &testEventTriggerDelegate;
#endif

initParams.InitializeStaticResourcesBeforeServerInit();

chip::Server::GetInstance().Init(initParams);
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
Expand Down

0 comments on commit 66a87a4

Please sign in to comment.