Skip to content

Commit 940a896

Browse files
committed
Deprecate BluetoothSerial
1 parent 4c3e6ba commit 940a896

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

libraries/BluetoothSerial/src/BTAddress.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* Every %BT device has a unique address which can be used to identify it and form connections.
2121
*/
22-
class BTAddress {
22+
class [[deprecated("BluetoothSerial/Bluedroid support will be removed in 4.0.0")]] BTAddress {
2323
public:
2424
BTAddress();
2525
BTAddress(esp_bd_addr_t address);

libraries/BluetoothSerial/src/BTAdvertisedDevice.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
#ifndef __BTADVERTISEDDEVICE_H__
99
#define __BTADVERTISEDDEVICE_H__
1010

11+
#include "sdkconfig.h"
12+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
13+
1114
#include "BTAddress.h"
1215
#include <string>
1316

14-
class BTAdvertisedDevice {
17+
class [[deprecated("BluetoothSerial/Bluedroid support will be removed in 4.0.0")]] BTAdvertisedDevice {
1518
public:
1619
virtual ~BTAdvertisedDevice() = default;
1720

@@ -27,7 +30,7 @@ class BTAdvertisedDevice {
2730
virtual std::string toString() = 0;
2831
};
2932

30-
class BTAdvertisedDeviceSet : public virtual BTAdvertisedDevice {
33+
class [[deprecated("BluetoothSerial/Bluedroid support will be removed in 4.0.0")]] BTAdvertisedDeviceSet : public virtual BTAdvertisedDevice {
3134
public:
3235
BTAdvertisedDeviceSet();
3336
//~BTAdvertisedDeviceSet() = default;
@@ -59,3 +62,4 @@ class BTAdvertisedDeviceSet : public virtual BTAdvertisedDevice {
5962
};
6063

6164
#endif
65+
#endif

libraries/BluetoothSerial/src/BTScan.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#ifndef __BTSCAN_H__
99
#define __BTSCAN_H__
1010

11+
#include "sdkconfig.h"
12+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
13+
1114
#include <map>
1215
#include <string>
1316
#include <Print.h>
@@ -17,7 +20,7 @@
1720
class BTAdvertisedDevice;
1821
class BTAdvertisedDeviceSet;
1922

20-
class BTScanResults {
23+
class [[deprecated("BluetoothSerial/Bluedroid support will be removed in 4.0.0")]] BTScanResults {
2124
public:
2225
virtual ~BTScanResults() = default;
2326

@@ -26,7 +29,7 @@ class BTScanResults {
2629
virtual BTAdvertisedDevice *getDevice(int i) = 0;
2730
};
2831

29-
class BTScanResultsSet : public BTScanResults {
32+
class [[deprecated("BluetoothSerial/Bluedroid support will be removed in 4.0.0")]] BTScanResultsSet : public BTScanResults {
3033
public:
3134
void dump(Print *print = nullptr);
3235
int getCount();
@@ -39,3 +42,4 @@ class BTScanResultsSet : public BTScanResults {
3942
};
4043

4144
#endif
45+
#endif

libraries/BluetoothSerial/src/BluetoothSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef std::function<void()> KeyRequestCb;
3434
typedef std::function<void(boolean success)> AuthCompleteCb;
3535
typedef std::function<void(BTAdvertisedDevice *pAdvertisedDevice)> BTAdvertisedDeviceCb;
3636

37-
class BluetoothSerial : public Stream {
37+
class [[deprecated("BluetoothSerial/Bluedroid support will be removed in 4.0.0")]] BluetoothSerial : public Stream {
3838
public:
3939
BluetoothSerial(void);
4040
~BluetoothSerial(void);

0 commit comments

Comments
 (0)