From 905f8f2991ffbcb994e42ac3f85dd2683e5e4199 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 28 Mar 2022 05:43:10 -0300 Subject: [PATCH] Warns about SSP only available for ESP32 (#6455) --- .../examples/SerialToSerialBT/SerialToSerialBT.ino | 4 ++++ .../examples/SerialToSerialBTM/SerialToSerialBTM.ino | 4 ++++ .../SerialToSerialBT_SSP_pairing.ino | 4 ++++ .../bt_classic_device_discovery.ino | 4 ++++ .../bt_remove_paired_devices/bt_remove_paired_devices.ino | 4 ++++ libraries/README.md | 4 +++- 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino b/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino index d779c6d3..86cbe168 100644 --- a/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino +++ b/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino @@ -10,6 +10,10 @@ #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif +#if !defined(CONFIG_BT_SPP_ENABLED) +#error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip. +#endif + BluetoothSerial SerialBT; void setup() { diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino b/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino index 3d17fb90..fc650059 100644 --- a/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino +++ b/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino @@ -8,6 +8,10 @@ #include "BluetoothSerial.h" +#if !defined(CONFIG_BT_SPP_ENABLED) +#error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip. +#endif + BluetoothSerial SerialBT; String MACadd = "AA:BB:CC:11:22:33"; diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/SerialToSerialBT_SSP_pairing.ino b/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/SerialToSerialBT_SSP_pairing.ino index 8791b6c7..c440545f 100644 --- a/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/SerialToSerialBT_SSP_pairing.ino +++ b/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP_pairing/SerialToSerialBT_SSP_pairing.ino @@ -10,6 +10,10 @@ #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif +#if !defined(CONFIG_BT_SPP_ENABLED) +#error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip. +#endif + BluetoothSerial SerialBT; boolean confirmRequestPending = true; diff --git a/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino b/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino index b3ec78cc..8d44f262 100644 --- a/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino +++ b/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino @@ -4,6 +4,10 @@ #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif +#if !defined(CONFIG_BT_SPP_ENABLED) +#error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip. +#endif + BluetoothSerial SerialBT; diff --git a/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino b/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino index c316a73b..0d49fe46 100755 --- a/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino +++ b/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino @@ -15,6 +15,10 @@ #include"esp_gap_bt_api.h" #include "esp_err.h" +#if !defined(CONFIG_BT_SPP_ENABLED) +#error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip. +#endif + #define REMOVE_BONDED_DEVICES 0 // <- Set to 0 to view all bonded devices addresses, set to 1 to remove #define PAIR_MAX_DEVICES 20 diff --git a/libraries/README.md b/libraries/README.md index e7c77efb..5edeebba 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -12,7 +12,9 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec Bluetooth Low Energy v4.2 client/server framework ### BluetoothSerial - Serial to Bluetooth redirection server + Serial to Bluetooth redirection server\ + Note: This library depends on Bluetooth Classic which is only available for ESP32\ + (Bluetoothserial is **not available** for ESP32-S2, ESP32-C3, ESP32-S3). ### DNSServer A basic UDP DNS daemon (includes captive portal demo)