Skip to content

Commit

Permalink
Add DevinfoInit to Relevant CC13xx apps (#22184)
Browse files Browse the repository at this point in the history
* Add DevinfoInit to CC13xx all clusters

* Add Devinfo init to lock-app

* Update style
  • Loading branch information
adabreuti authored and pull[bot] committed Nov 7, 2023
1 parent 3c21ec1 commit 1584376
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ti_simplelink_executable("all-clusters-app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/ClusterManager.cpp",
"${project_dir}/main/Globals.cpp",
Expand All @@ -102,6 +103,7 @@ ti_simplelink_executable("all-clusters-app") {
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/examples/providers/",
]

cflags = [
Expand Down
7 changes: 7 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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 @@ -64,6 +65,7 @@ static QueueHandle_t sAppEventQueue;

static Button_Handle sAppLeftHandle;
static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -243,6 +245,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);

ConfigurationMgr().LogDeviceConfig();
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-minimal-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ti_simplelink_executable("all-clusters-minimal-app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/ClusterManager.cpp",
"${project_dir}/main/Globals.cpp",
Expand All @@ -102,6 +103,7 @@ ti_simplelink_executable("all-clusters-minimal-app") {
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/examples/providers/",
]

cflags = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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 @@ -64,6 +65,7 @@ static QueueHandle_t sAppEventQueue;

static Button_Handle sAppLeftHandle;
static Button_Handle sAppRightHandle;
static DeviceInfoProviderImpl sExampleDeviceInfoProvider;

AppTask AppTask::sAppTask;

Expand Down Expand Up @@ -243,6 +245,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);

ConfigurationMgr().LogDeviceConfig();
Expand Down
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 @@ -74,6 +74,7 @@ ti_simplelink_executable("lock_app") {
output_name = "chip-${ti_simplelink_board}-lock-example.out"

sources = [
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/BoltLockManager.cpp",
"${project_dir}/main/ZclCallbacks.cpp",
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 1584376

Please sign in to comment.