Skip to content

Commit 837e910

Browse files
committed
[bouffalo lab] Advertise commissionable on last fabric removal is disabled by default (project-chip#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 517d968 commit 837e910

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
@@ -177,6 +177,7 @@ void UnlockOpenThreadTask(void)
177177
}
178178
#endif
179179

180+
#if CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL
180181
class AppFabricTableDelegate : public FabricTable::Delegate
181182
{
182183
void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex)
@@ -205,6 +206,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate
205206
}
206207
}
207208
};
209+
#endif
208210

209211
CHIP_ERROR PlatformManagerImpl::PlatformInit(void)
210212
{
@@ -293,8 +295,10 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void)
293295

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

298+
#if CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL
296299
static AppFabricTableDelegate sAppFabricDelegate;
297300
chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&sAppFabricDelegate);
301+
#endif
298302

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

0 commit comments

Comments
 (0)