Skip to content

Commit

Permalink
Add Devinfo init to lock-app
Browse files Browse the repository at this point in the history
  • Loading branch information
adabreuti committed Aug 27, 2022
1 parent 272fe50 commit 8c6e222
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ti_simplelink_executable("lock_app") {
"${project_dir}/main/BoltLockManager.cpp",
"${project_dir}/main/ZclCallbacks.cpp",
"${project_dir}/main/main.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
]

deps = [
Expand All @@ -96,6 +97,7 @@ ti_simplelink_executable("lock_app") {
include_dirs = [
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/providers/",
]

cflags = [
Expand Down
7 changes: 7 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>

#include <DeviceInfoProviderImpl.h>
#include <platform/CHIPDeviceLayer.h>

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Expand Down Expand Up @@ -63,6 +64,7 @@ static LED_Handle sAppRedHandle;
static LED_Handle sAppGreenHandle;
static Button_Handle sAppLeftHandle;
static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -166,6 +168,11 @@ int AppTask::Init()
PLAT_LOG("Initialize Server");
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();

// Initialize info provider
sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
SetDeviceInfoProvider(&sExampleDeviceInfoProvider);

chip::Server::GetInstance().Init(initParams);

// Initialize device attestation config
Expand Down

0 comments on commit 8c6e222

Please sign in to comment.