Skip to content

Commit 3026947

Browse files
wy-hhpull[bot]
authored andcommitted
[Bouffalolab] Add Device Information provider support (#25838)
* add device info provider support * correct building for bl702 * Fix restyle
1 parent 3facccb commit 3026947

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

examples/lighting-app/bouffalolab/bl602/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ bouffalolab_executable("lighting_app") {
104104
}
105105

106106
sources += [
107+
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
107108
"${example_common_dir}/AppTask.cpp",
108109
"${example_common_dir}/ZclCallbacks.cpp",
109110
"${examples_plat_common_dir}/plat/LEDWidget.cpp",

examples/lighting-app/bouffalolab/bl702/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ bouffalolab_executable("lighting_app") {
137137
deps = [
138138
":sdk",
139139
"${chip_root}/examples/lighting-app/lighting-common",
140+
"${chip_root}/examples/providers:device_info_provider",
140141
"${chip_root}/src/lib",
141142
"${chip_root}/src/setup_payload",
142143
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",

examples/platform/bouffalolab/common/plat/platform.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
#include "Rpc.h"
5959
#endif
6060

61+
#include <DeviceInfoProviderImpl.h>
62+
6163
#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED
6264
#include "uart.h"
6365
#endif
@@ -77,6 +79,8 @@ chip::app::Clusters::NetworkCommissioning::Instance
7779
}
7880
#endif
7981

82+
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
83+
8084
void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg)
8185
{
8286
switch (event->Type)
@@ -201,11 +205,15 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void)
201205
chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(EXT_DISCOVERY_TIMEOUT_SECS);
202206
#endif
203207

208+
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
209+
204210
static CommonCaseDeviceServerInitParams initParams;
205211
(void) initParams.InitializeStaticResourcesBeforeServerInit();
206212

207213
ReturnLogErrorOnFailure(chip::Server::GetInstance().Init(initParams));
208214

215+
gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
216+
209217
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
210218

211219
#if CHIP_ENABLE_OPENTHREAD

0 commit comments

Comments
 (0)