Skip to content

Commit 5a8aa62

Browse files
authored
Do not use CONFIG_NETWORK_LAYER_BLE for runtime checks (#33003)
1 parent 9a81bed commit 5a8aa62

File tree

9 files changed

+28
-36
lines changed

9 files changed

+28
-36
lines changed

examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
8484
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
8585
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
8686

87-
if (CONFIG_NETWORK_LAYER_BLE)
88-
{
89-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
90-
}
87+
#if CONFIG_NETWORK_LAYER_BLE
88+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
89+
#endif
9190

9291
PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast<intptr_t>(cb));
9392

examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
7777
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
7878
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
7979

80-
if (CONFIG_NETWORK_LAYER_BLE)
81-
{
82-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
83-
}
80+
#if CONFIG_NETWORK_LAYER_BLE
81+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
82+
#endif
8483

8584
// Register a function to receive events from the CHIP device layer. Note that calls to
8685
// this function will happen on the CHIP event loop thread, not the app_main thread.

examples/all-clusters-minimal-app/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
6161
err = PlatformMgr().InitChipStack();
6262
SuccessOrExit(err);
6363

64-
if (CONFIG_NETWORK_LAYER_BLE)
65-
{
66-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
67-
}
64+
#if CONFIG_NETWORK_LAYER_BLE
65+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
66+
#endif
6867

6968
// Register a function to receive events from the CHIP device layer. Note that calls to
7069
// this function will happen on the CHIP event loop thread, not the app_main thread.

examples/chef/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
6161
err = PlatformMgr().InitChipStack();
6262
SuccessOrExit(err);
6363

64-
if (CONFIG_NETWORK_LAYER_BLE)
65-
{
66-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
67-
}
64+
#if CONFIG_NETWORK_LAYER_BLE
65+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
66+
#endif
6867

6968
// Register a function to receive events from the CHIP device layer. Note that calls to
7069
// this function will happen on the CHIP event loop thread, not the app_main thread.

examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
7777
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
7878
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
7979

80-
if (CONFIG_NETWORK_LAYER_BLE)
81-
{
82-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
83-
}
80+
#if CONFIG_NETWORK_LAYER_BLE
81+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
82+
#endif
8483

8584
// Register a function to receive events from the CHIP device layer. Note that calls to
8685
// this function will happen on the CHIP event loop thread, not the app_main thread.

examples/lighting-app/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
8484
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
8585
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
8686

87-
if (CONFIG_NETWORK_LAYER_BLE)
88-
{
89-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
90-
}
87+
#if CONFIG_NETWORK_LAYER_BLE
88+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
89+
#endif
9190

9291
PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast<intptr_t>(cb));
9392

examples/ota-requestor-app/ameba/main/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
7777
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
7878
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
7979

80-
if (CONFIG_NETWORK_LAYER_BLE)
81-
{
82-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
83-
}
80+
#if CONFIG_NETWORK_LAYER_BLE
81+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
82+
#endif
8483

8584
// Register a function to receive events from the CHIP device layer. Note that calls to
8685
// this function will happen on the CHIP event loop thread, not the app_main thread.

examples/platform/asr/init_Matter.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ CHIP_ERROR MatterInitializer::Init_Matter_Stack(const char * appName)
8585

8686
chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(appName);
8787

88-
if (CONFIG_NETWORK_LAYER_BLE)
89-
{
90-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
91-
}
88+
#if CONFIG_NETWORK_LAYER_BLE
89+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
90+
#endif
91+
9292
return CHIP_NO_ERROR;
9393
}
9494

examples/platform/beken/common/CHIPDeviceManager.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
6060
err = PlatformMgr().InitChipStack();
6161
SuccessOrExit(err);
6262

63-
if (CONFIG_NETWORK_LAYER_BLE)
64-
{
65-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
66-
}
63+
#if CONFIG_NETWORK_LAYER_BLE
64+
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
65+
#endif
6766

6867
err = Platform::MemoryInit();
6968
SuccessOrExit(err);

0 commit comments

Comments
 (0)