Skip to content

Commit

Permalink
Remove Set/GetCHIPoBLEServiceMode. (#20621)
Browse files Browse the repository at this point in the history
They are unused.

Fixes #20221
  • Loading branch information
bzbarsky-apple authored Jul 12, 2022
1 parent 7cc78f1 commit 57cb679
Show file tree
Hide file tree
Showing 39 changed files with 0 additions and 440 deletions.
12 changes: 0 additions & 12 deletions src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ class ConnectivityManager

// CHIPoBLE service methods
Ble::BleLayer * GetBleLayer();
CHIPoBLEServiceMode GetCHIPoBLEServiceMode();
CHIP_ERROR SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool IsBLEAdvertisingEnabled();
/**
* Enable or disable BLE advertising.
Expand Down Expand Up @@ -532,16 +530,6 @@ inline Ble::BleLayer * ConnectivityManager::GetBleLayer()
return static_cast<ImplClass *>(this)->_GetBleLayer();
}

inline ConnectivityManager::CHIPoBLEServiceMode ConnectivityManager::GetCHIPoBLEServiceMode()
{
return static_cast<ImplClass *>(this)->_GetCHIPoBLEServiceMode();
}

inline CHIP_ERROR ConnectivityManager::SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
return static_cast<ImplClass *>(this)->_SetCHIPoBLEServiceMode(val);
}

inline bool ConnectivityManager::IsBLEAdvertisingEnabled()
{
return static_cast<ImplClass *>(this)->_IsBLEAdvertisingEnabled();
Expand Down
12 changes: 0 additions & 12 deletions src/include/platform/internal/BLEManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class BLEManager

CHIP_ERROR Init();
void Shutdown();
CHIPoBLEServiceMode GetCHIPoBLEServiceMode();
CHIP_ERROR SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool IsAdvertisingEnabled();
CHIP_ERROR SetAdvertisingEnabled(bool val);
bool IsAdvertising();
Expand Down Expand Up @@ -125,16 +123,6 @@ inline void BLEManager::Shutdown()
static_cast<ImplClass *>(this)->_Shutdown();
}

inline BLEManager::CHIPoBLEServiceMode BLEManager::GetCHIPoBLEServiceMode()
{
return static_cast<ImplClass *>(this)->_GetCHIPoBLEServiceMode();
}

inline CHIP_ERROR BLEManager::SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
return static_cast<ImplClass *>(this)->_SetCHIPoBLEServiceMode(val);
}

inline bool BLEManager::IsAdvertisingEnabled()
{
return static_cast<ImplClass *>(this)->_IsAdvertisingEnabled();
Expand Down
15 changes: 0 additions & 15 deletions src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class GenericConnectivityManagerImpl_BLE
// ===== Methods that implement the ConnectivityManager abstract interface.

Ble::BleLayer * _GetBleLayer();
ConnectivityManager::CHIPoBLEServiceMode _GetCHIPoBLEServiceMode();
CHIP_ERROR _SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val);
bool _IsBLEAdvertisingEnabled();
CHIP_ERROR _SetBLEAdvertisingEnabled(bool val);
bool _IsBLEAdvertising();
Expand All @@ -76,19 +74,6 @@ inline Ble::BleLayer * GenericConnectivityManagerImpl_BLE<ImplClass>::_GetBleLay
return BLEMgr().GetBleLayer();
}

template <class ImplClass>
inline ConnectivityManager::CHIPoBLEServiceMode GenericConnectivityManagerImpl_BLE<ImplClass>::_GetCHIPoBLEServiceMode()
{
return BLEMgr().GetCHIPoBLEServiceMode();
}

template <class ImplClass>
inline CHIP_ERROR
GenericConnectivityManagerImpl_BLE<ImplClass>::_SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val)
{
return BLEMgr().SetCHIPoBLEServiceMode(val);
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_BLE<ImplClass>::_IsBLEAdvertisingEnabled()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ namespace Internal {
*
* The members of this class are all inlined methods that do nothing, and return static return
* values. This allows the compiler to optimize away dead code without the use of \#ifdef's.
* For example:
*
* ```
* if (ConnectivityMgr().GetCHIPoBLEServiceMode() != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported)
* {
* // ... do something on devices that support CHIPoBLE ...
* }
* ```
*/
template <class ImplClass>
class GenericConnectivityManagerImpl_NoBLE
Expand All @@ -53,8 +45,6 @@ class GenericConnectivityManagerImpl_NoBLE
// ===== Methods that implement the ConnectivityManager abstract interface.

Ble::BleLayer * _GetBleLayer(void);
ConnectivityManager::CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void);
CHIP_ERROR _SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val);
bool _IsBLEAdvertisingEnabled(void);
CHIP_ERROR _SetBLEAdvertisingEnabled(bool val);
bool _IsBLEAdvertising(void);
Expand All @@ -74,19 +64,6 @@ inline Ble::BleLayer * GenericConnectivityManagerImpl_NoBLE<ImplClass>::_GetBleL
return nullptr;
}

template <class ImplClass>
inline ConnectivityManager::CHIPoBLEServiceMode GenericConnectivityManagerImpl_NoBLE<ImplClass>::_GetCHIPoBLEServiceMode(void)
{
return ConnectivityManager::kCHIPoBLEServiceMode_NotSupported;
}

template <class ImplClass>
inline CHIP_ERROR
GenericConnectivityManagerImpl_NoBLE<ImplClass>::_SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

template <class ImplClass>
inline bool GenericConnectivityManagerImpl_NoBLE<ImplClass>::_IsBLEAdvertisingEnabled(void)
{
Expand Down
17 changes: 0 additions & 17 deletions src/platform/Ameba/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,23 +352,6 @@ BLEManagerImpl::CHIPoBLEConState * BLEManagerImpl::GetConnectionState(uint8_t co
return NULL;
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (val != mServiceMode)
{
mServiceMode = val;
PlatformMgr().ScheduleWork(DriveBLEState, 0);
}

exit:
return err;
}

CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val)
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
7 changes: 0 additions & 7 deletions src/platform/Ameba/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla

CHIP_ERROR _Init(void);
void _Shutdown() {}
CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void);
CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool _IsAdvertisingEnabled(void);
CHIP_ERROR _SetAdvertisingEnabled(bool val);
bool _IsAdvertising(void);
Expand Down Expand Up @@ -200,11 +198,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer()
return this;
}

inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void)
{
return mServiceMode;
}

inline bool BLEManagerImpl::_IsAdvertisingEnabled(void)
{
return mFlags.Has(Flags::kAdvertisingEnabled);
Expand Down
17 changes: 0 additions & 17 deletions src/platform/CYW30739/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,6 @@ CHIP_ERROR BLEManagerImpl::_Init()
return err;
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (val != mServiceMode)
{
mServiceMode = val;
PlatformMgr().ScheduleWork(DriveBLEState, 0);
}

exit:
return err;
}

bool BLEManagerImpl::_IsAdvertisingEnabled(void)
{
return mFlags.Has(Flags::kFlag_AdvertisingEnabled);
Expand Down
2 changes: 0 additions & 2 deletions src/platform/CYW30739/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class BLEManagerImpl final : public BLEManager,

CHIP_ERROR _Init(void);
void _Shutdown() {}
CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void);
CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool _IsAdvertisingEnabled(void);
CHIP_ERROR _SetAdvertisingEnabled(bool val);
bool _IsFastAdvertisingEnabled(void);
Expand Down
12 changes: 0 additions & 12 deletions src/platform/Darwin/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@ CHIP_ERROR BLEManagerImpl::_Init()
return err;
}

ConnectivityManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void)
{
ChipLogDetail(DeviceLayer, "%s", __FUNCTION__);
return ConnectivityManager::kCHIPoBLEServiceMode_NotSupported;
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val)
{
ChipLogDetail(DeviceLayer, "%s", __FUNCTION__);
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

bool BLEManagerImpl::_IsAdvertisingEnabled(void)
{
ChipLogDetail(DeviceLayer, "%s", __FUNCTION__);
Expand Down
2 changes: 0 additions & 2 deletions src/platform/Darwin/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer

CHIP_ERROR _Init(void);
void _Shutdown() {}
CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void);
CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool _IsAdvertisingEnabled(void);
CHIP_ERROR _SetAdvertisingEnabled(bool val);
bool _IsAdvertising(void);
Expand Down
17 changes: 0 additions & 17 deletions src/platform/EFR32/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,23 +299,6 @@ void BLEManagerImpl::bluetoothStackEventHandler(void * p_arg)
}
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (val != mServiceMode)
{
mServiceMode = val;
PlatformMgr().ScheduleWork(DriveBLEState, 0);
}

exit:
return err;
}

CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val)
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
7 changes: 0 additions & 7 deletions src/platform/EFR32/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla

CHIP_ERROR _Init(void);
void _Shutdown() {}
CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void);
CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool _IsAdvertisingEnabled(void);
CHIP_ERROR _SetAdvertisingEnabled(bool val);
bool _IsAdvertising(void);
Expand Down Expand Up @@ -180,11 +178,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer()
return this;
}

inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void)
{
return mServiceMode;
}

inline bool BLEManagerImpl::_IsAdvertisingEnabled(void)
{
return mFlags.Has(Flags::kAdvertisingEnabled);
Expand Down
7 changes: 0 additions & 7 deletions src/platform/ESP32/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class BLEManagerImpl final : public BLEManager,

CHIP_ERROR _Init(void);
void _Shutdown() {}
CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void);
CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool _IsAdvertisingEnabled(void);
CHIP_ERROR _SetAdvertisingEnabled(bool val);
bool _IsAdvertising(void);
Expand Down Expand Up @@ -283,11 +281,6 @@ inline ::chip::Ble::BleLayer * BLEManagerImpl::_GetBleLayer()
return this;
}

inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void)
{
return mServiceMode;
}

inline bool BLEManagerImpl::_IsAdvertisingEnabled(void)
{
return mFlags.Has(Flags::kAdvertisingEnabled);
Expand Down
17 changes: 0 additions & 17 deletions src/platform/ESP32/bluedroid/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,6 @@ CHIP_ERROR BLEManagerImpl::_Init()
return err;
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (val != mServiceMode)
{
mServiceMode = val;
PlatformMgr().ScheduleWork(DriveBLEState, 0);
}

exit:
return err;
}

CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val)
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
17 changes: 0 additions & 17 deletions src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,6 @@ CHIP_ERROR BLEManagerImpl::_Init()
return err;
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (val != mServiceMode)
{
mServiceMode = val;
PlatformMgr().ScheduleWork(DriveBLEState, 0);
}

exit:
return err;
}

CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val)
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
17 changes: 0 additions & 17 deletions src/platform/Linux/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,6 @@ void BLEManagerImpl::_Shutdown()
mDeviceScanner.reset();
}

CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val)
{
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (val != mServiceMode)
{
mServiceMode = val;
PlatformMgr().ScheduleWork(DriveBLEState, 0);
}

exit:
return err;
}

CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val)
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
7 changes: 0 additions & 7 deletions src/platform/Linux/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ class BLEManagerImpl final : public BLEManager,

CHIP_ERROR _Init();
void _Shutdown();
CHIPoBLEServiceMode _GetCHIPoBLEServiceMode();
CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val);
bool _IsAdvertisingEnabled();
CHIP_ERROR _SetAdvertisingEnabled(bool val);
bool _IsAdvertising();
Expand Down Expand Up @@ -233,11 +231,6 @@ inline Ble::BleLayer * BLEManagerImpl::_GetBleLayer()
return this;
}

inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode()
{
return mServiceMode;
}

inline bool BLEManagerImpl::_IsAdvertisingEnabled()
{
return mFlags.Has(Flags::kAdvertisingEnabled);
Expand Down
Loading

0 comments on commit 57cb679

Please sign in to comment.