ESP32 supports BLE and classic Bluetooth.
In this topic we can find several examples of BLE: BLE ESP32. Bluetooth. Send. Receive. Arduino IDE.
Here ESP32 and classic Bluetooth: Wemos D1 R32 ESP32. Bluetooth. App Inventor. Enciende/apaga LED12/LED13. Obtiene el estado de los pulsadores. Envía un mensaje a LCD.
Now we are going to see several examples of classic Bluetooth, but using a Callback.
In these examples I will use an ESP32 CAM card, but we can use any other card with ESP32.
I got the idea for these examples from: ESP32CAM | BLUETOOTH CLASSIC | FLUTTER - TWO-WAY Serial BT Communication (ft. uint8_t* buffer)🖼️ - YouTube
Bluetooth library used in these examples:
https://github.com/espressif/arduino-esp32/tree/master/libraries/BluetoothSerial