Skip to content

Commit b3738c2

Browse files
committed
[bouffalo lab] Make it possible for application to implement its own fabric delegate
1 parent e5a49c8 commit b3738c2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

examples/platform/bouffalolab/common/plat/plat.h

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
#define EXT_DISCOVERY_TIMEOUT_SECS 20
2525

26+
#ifndef CONFIG_APP_FABRIC_TABLE_DELEGATE
27+
#define CONFIG_APP_FABRIC_TABLE_DELEGATE 0
28+
#endif
29+
2630
typedef void (*app_pds_gpio_irq_handler_t)(void * arg);
2731

2832
#ifdef __cplusplus

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

+4
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ void UnlockOpenThreadTask(void)
178178
}
179179
#endif
180180

181+
#if CONFIG_APP_FABRIC_TABLE_DELEGATE == 0
181182
class AppFabricTableDelegate : public FabricTable::Delegate
182183
{
183184
void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex)
@@ -206,6 +207,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate
206207
}
207208
}
208209
};
210+
#endif
209211

210212
CHIP_ERROR PlatformManagerImpl::PlatformInit(void)
211213
{
@@ -294,8 +296,10 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void)
294296

295297
gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
296298

299+
#if CONFIG_APP_FABRIC_TABLE_DELEGATE == 0
297300
static AppFabricTableDelegate sAppFabricDelegate;
298301
chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&sAppFabricDelegate);
302+
#endif
299303

300304
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
301305

0 commit comments

Comments
 (0)