Skip to content

Commit a93bd93

Browse files
authored
[LocalizationConfig] Use default DeviceInfoProviders for Ameba (project-chip#19555)
1 parent 91e23df commit a93bd93

File tree

6 files changed

+21
-0
lines changed

6 files changed

+21
-0
lines changed

examples/all-clusters-app/ameba/chip_main.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ list(
141141
${chip_dir}/examples/all-clusters-app/ameba/main/Globals.cpp
142142
${chip_dir}/examples/all-clusters-app/ameba/main/LEDWidget.cpp
143143
${chip_dir}/examples/all-clusters-app/ameba/main/DsoHack.cpp
144+
145+
${chip_dir}/examples/providers/DeviceInfoProviderImpl.cpp
144146
)
145147

146148
add_library(
@@ -181,6 +183,7 @@ target_include_directories(
181183
${chip_dir}/examples/all-clusters-app/all-clusters-common/include
182184
${chip_dir}/examples/all-clusters-app/ameba/main/include
183185
${chip_dir}/examples/platform/ameba
186+
${chip_dir}/examples/providers
184187
${chip_dir_output}/gen/include
185188
${chip_dir}/src/include/
186189
${chip_dir}/src/lib/

examples/all-clusters-app/ameba/main/chipinterface.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "Globals.h"
2323
#include "LEDWidget.h"
2424
#include "chip_porting.h"
25+
#include <DeviceInfoProviderImpl.h>
2526
#include <lwip_netconf.h>
2627

2728
#include <app/clusters/identify-server/identify-server.h>
@@ -89,13 +90,16 @@ Identify gIdentify1 = {
8990
#endif
9091

9192
static DeviceCallbacks EchoCallbacks;
93+
chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
9294

9395
static void InitServer(intptr_t context)
9496
{
9597
// Init ZCL Data Model and CHIP App Server
9698
static chip::CommonCaseDeviceServerInitParams initParams;
9799
initParams.InitializeStaticResourcesBeforeServerInit();
98100
chip::Server::GetInstance().Init(initParams);
101+
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
102+
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
99103

100104
// Initialize device attestation config
101105
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());

examples/lighting-app/ameba/chip_main.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ list(
3737
${chip_dir}/examples/lighting-app/ameba/main/Globals.cpp
3838
${chip_dir}/examples/lighting-app/ameba/main/LEDWidget.cpp
3939
${chip_dir}/examples/lighting-app/ameba/main/DsoHack.cpp
40+
41+
${chip_dir}/examples/providers/DeviceInfoProviderImpl.cpp
4042
)
4143

4244
add_library(
@@ -61,6 +63,7 @@ target_include_directories(
6163
${chip_dir}/examples/lighting-app/lighting-common/include
6264
${chip_dir}/examples/lighting-app/ameba/main/include
6365
${chip_dir}/examples/platform/ameba
66+
${chip_dir}/examples/providers
6467
${chip_dir_output}/gen/include
6568
${chip_dir}/src/include/
6669
${chip_dir}/src/lib/

examples/lighting-app/ameba/main/chipinterface.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "Globals.h"
2323
#include "LEDWidget.h"
2424
#include "Server.h"
25+
#include <DeviceInfoProviderImpl.h>
2526

2627
#include "chip_porting.h"
2728
#include <credentials/DeviceAttestationCredsProvider.h>
@@ -74,6 +75,7 @@ void NetWorkCommissioningInstInit()
7475
#endif
7576

7677
static DeviceCallbacks EchoCallbacks;
78+
chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
7779

7880
void OnIdentifyStart(Identify *)
7981
{
@@ -117,6 +119,8 @@ static void InitServer(intptr_t context)
117119
static chip::CommonCaseDeviceServerInitParams initParams;
118120
(void) initParams.InitializeStaticResourcesBeforeServerInit();
119121
chip::Server::GetInstance().Init(initParams);
122+
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
123+
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
120124

121125
// Initialize device attestation config
122126
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());

examples/ota-requestor-app/ameba/chip_main.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ list(
2828
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp
2929
${chip_dir}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
3030
${chip_dir}/examples/platform/ameba/ota/OTAInitializer.cpp
31+
32+
${chip_dir}/examples/providers/DeviceInfoProviderImpl.cpp
3133
)
3234

3335
add_library(
@@ -62,6 +64,7 @@ target_include_directories(
6264
${chip_dir}/src/app/clusters/ota-requestor
6365
${chip_dir}/examples/ota-requestor-app/ameba/main/include
6466
${chip_dir}/examples/platform/ameba
67+
${chip_dir}/examples/providers
6568
${sdk_root}/component/soc/realtek/amebad/fwlib/include
6669
)
6770

examples/ota-requestor-app/ameba/main/chipinterface.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "CHIPDeviceManager.h"
2121
#include "DeviceCallbacks.h"
2222
#include "chip_porting.h"
23+
#include <DeviceInfoProviderImpl.h>
2324

2425
#include <app/clusters/network-commissioning/network-commissioning.h>
2526
#include <app/server/Server.h>
@@ -73,13 +74,16 @@ void NetWorkCommissioningInstInit()
7374
}
7475

7576
static DeviceCallbacks EchoCallbacks;
77+
chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
7678

7779
static void InitServer(intptr_t context)
7880
{
7981
// Init ZCL Data Model and CHIP App Server
8082
static chip::CommonCaseDeviceServerInitParams initParams;
8183
(void) initParams.InitializeStaticResourcesBeforeServerInit();
8284
chip::Server::GetInstance().Init(initParams);
85+
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
86+
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
8387

8488
// Initialize device attestation config
8589
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());

0 commit comments

Comments
 (0)