Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ameba] Additional Ameba Implementation #29720

Merged
merged 7 commits into from
Oct 20, 2023
Prev Previous commit
Next Next commit
[Ameba] Added CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER macro
  • Loading branch information
pankore committed Oct 10, 2023
commit 66a87a4efc07f93edb791ea1843f2a8368b6d945
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