You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/BluetoothSerial/examples/SerialToSerialBT_SSP/SerialToSerialBT_SSP.ino
+40-14Lines changed: 40 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,26 @@
5
5
// and also demonstrate that SerialBT have the same functionalities of a normal Serial
6
6
// SSP - Simple Secure Pairing - The device (ESP32) will display random number and the user is responsible of comparing it to the number
7
7
// displayed on the other device (for example phone).
8
-
// If the numbers match the user authenticates the pairing.
8
+
// If the numbers match the user authenticates the pairing on both devices - on phone simply press "Pair" and in terminal for the sketch send 'Y' or 'y' to confirm.
9
+
// Alternatively uncomment AUTO_PAIR to skip the terminal confirmation.
9
10
10
11
#include"BluetoothSerial.h"
11
12
13
+
//#define AUTO_PAIR // Uncomment to skip the terminal confirmation.
SerialBT.begin(deviceName); //Bluetooth device name
52
-
Serial.printf("The device started with name \"%s\", now you can pair it with Bluetooth!\n", deviceName);
78
+
#ifndef AUTO_PAIR
79
+
Serial.printf("The device started with name \"%s\", now you can pair it with Bluetooth!\nIf the numbers in terminal and on the other device match, press \"Pair\" in phone/computer and write \'Y\' or \'y\' in terminal\n", deviceName);
80
+
#else
81
+
Serial.printf("The device started with name \"%s\", now you can pair it with Bluetooth!\nIf the numbers in terminal and on the other device match, press \"Pair\" in phone/computer.\n", deviceName);
0 commit comments