diff --git a/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp b/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp index 0c73b5506f0849..ff8b0b0166939e 100644 --- a/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp @@ -84,10 +84,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast(cb)); diff --git a/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp b/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp index 7b178060a6fff2..4ae50eaac1b2f6 100644 --- a/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp @@ -77,10 +77,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif // Register a function to receive events from the CHIP device layer. Note that calls to // this function will happen on the CHIP event loop thread, not the app_main thread. diff --git a/examples/all-clusters-minimal-app/ameba/main/CHIPDeviceManager.cpp b/examples/all-clusters-minimal-app/ameba/main/CHIPDeviceManager.cpp index ed88297b6bb515..6d83f6886182a6 100644 --- a/examples/all-clusters-minimal-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/all-clusters-minimal-app/ameba/main/CHIPDeviceManager.cpp @@ -61,10 +61,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif // Register a function to receive events from the CHIP device layer. Note that calls to // this function will happen on the CHIP event loop thread, not the app_main thread. diff --git a/examples/chef/ameba/main/CHIPDeviceManager.cpp b/examples/chef/ameba/main/CHIPDeviceManager.cpp index ed88297b6bb515..6d83f6886182a6 100644 --- a/examples/chef/ameba/main/CHIPDeviceManager.cpp +++ b/examples/chef/ameba/main/CHIPDeviceManager.cpp @@ -61,10 +61,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif // Register a function to receive events from the CHIP device layer. Note that calls to // this function will happen on the CHIP event loop thread, not the app_main thread. diff --git a/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp b/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp index 50e6d11db53c25..1a48d5dbfd2f27 100644 --- a/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp @@ -77,10 +77,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif // Register a function to receive events from the CHIP device layer. Note that calls to // this function will happen on the CHIP event loop thread, not the app_main thread. diff --git a/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp b/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp index c2d9d13d9a91a7..82a670e9648b40 100644 --- a/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp @@ -84,10 +84,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast(cb)); diff --git a/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp b/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp index 50e6d11db53c25..1a48d5dbfd2f27 100644 --- a/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp @@ -77,10 +77,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetDeviceInstanceInfoProvider(&mFactoryDataProvider); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif // Register a function to receive events from the CHIP device layer. Note that calls to // this function will happen on the CHIP event loop thread, not the app_main thread. diff --git a/examples/platform/asr/init_Matter.cpp b/examples/platform/asr/init_Matter.cpp index 130d01479de4f9..a80fea5b4ea1bc 100644 --- a/examples/platform/asr/init_Matter.cpp +++ b/examples/platform/asr/init_Matter.cpp @@ -85,10 +85,10 @@ CHIP_ERROR MatterInitializer::Init_Matter_Stack(const char * appName) chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(appName); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif + return CHIP_NO_ERROR; } diff --git a/examples/platform/beken/common/CHIPDeviceManager.cpp b/examples/platform/beken/common/CHIPDeviceManager.cpp index 5ee110ed372c7e..38cffaa5b1d9d4 100644 --- a/examples/platform/beken/common/CHIPDeviceManager.cpp +++ b/examples/platform/beken/common/CHIPDeviceManager.cpp @@ -60,10 +60,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) err = PlatformMgr().InitChipStack(); SuccessOrExit(err); - if (CONFIG_NETWORK_LAYER_BLE) - { - ConnectivityMgr().SetBLEAdvertisingEnabled(true); - } +#if CONFIG_NETWORK_LAYER_BLE + ConnectivityMgr().SetBLEAdvertisingEnabled(true); +#endif err = Platform::MemoryInit(); SuccessOrExit(err);