An easy-to-use BLE Serial library for Arduino ESP32. The class inherits the Arduino Stream class so all the familiar Serial functions are supported.
Add the files in the src folder to your project, or install using the Arduino library manager.
The following examples are provided:
The library can be set to toggle a pin when a device is connected or disconnected. This can be used for an LED indicator, for example. To enable this feature, pass the LED pin to the begin() function.
The library uses the Nordic BLE Serial profile by default. This can be changed by passing the service, RX and TX characteristic UUIDs to the begin() function. Make sure to not create multiple BLE serials with the same UUIDs.