h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
670 stars 138 forks source link

Is implementing a BLE HID Keyboard and a BLE UART possible on one ESP32 simultaneously? #577

Closed ThomasAtBBTF closed 1 month ago

ThomasAtBBTF commented 11 months ago

I have two working sketches one with a keyboard and the other with a BLE UART. I also have a IOS application which can talk with the BLE UART.

Now I want to integrate the two servers into one BLEDevice. The code seems to work, and I can use the keyboard with no problems.

But I can not connect in my IOS app to the UART anymore. I think because of the device is immediately connected by IOS as a keyboard it does not show up anymore when I iterate through the devices in my IOS app.

Any suggestions if this is at all possible. Can I create two Servers in one device and start advertising the not connected device? How can I connect from a IOS app to the second service?

h2zero commented 10 months ago

You could just add the UART service to your keyboard app.