Skip to content

Commit b1c3091

Browse files
authored
[bouffalo lab] Advertise commissionable on last fabric removal is disabled by default (#37531)
* [bouffalo lab] Make it possible for application to implement its own fabric delegate * Advertise commissionable on last fabric removal is disabled by default
1 parent 003f84c commit b1c3091

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_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL
27+
#define CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL 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_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL
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
{
@@ -295,8 +297,10 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void)
295297

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

300+
#if CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL
298301
static AppFabricTableDelegate sAppFabricDelegate;
299302
chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&sAppFabricDelegate);
303+
#endif
300304

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

0 commit comments

Comments
 (0)