diff --git a/examples/platform/bouffalolab/common/plat/plat.h b/examples/platform/bouffalolab/common/plat/plat.h index f0360ff19a70c5..6a9535a088cf3f 100644 --- a/examples/platform/bouffalolab/common/plat/plat.h +++ b/examples/platform/bouffalolab/common/plat/plat.h @@ -23,6 +23,10 @@ #define EXT_DISCOVERY_TIMEOUT_SECS 20 +#ifndef CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL +#define CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL 0 +#endif + typedef void (*app_pds_gpio_irq_handler_t)(void * arg); #ifdef __cplusplus diff --git a/examples/platform/bouffalolab/common/plat/platform.cpp b/examples/platform/bouffalolab/common/plat/platform.cpp index 09a495c6a7e97c..7e62e45515aff3 100644 --- a/examples/platform/bouffalolab/common/plat/platform.cpp +++ b/examples/platform/bouffalolab/common/plat/platform.cpp @@ -177,6 +177,7 @@ void UnlockOpenThreadTask(void) } #endif +#if CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL class AppFabricTableDelegate : public FabricTable::Delegate { void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex) @@ -205,6 +206,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate } } }; +#endif CHIP_ERROR PlatformManagerImpl::PlatformInit(void) { @@ -293,8 +295,10 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); +#if CONFIG_APP_ADVERTISE_COMMISSIONABLE_ON_LAST_FABRIC_REMOVAL static AppFabricTableDelegate sAppFabricDelegate; chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&sAppFabricDelegate); +#endif chip::DeviceLayer::PlatformMgr().UnlockChipStack();