adafruit / Adafruit_CircuitPython_BLE

Bluetooth Low Energy (BLE) library for CircuitPython
MIT License
127 stars 58 forks source link

Allow access to Service Changed Characteristic #180

Open djbutler opened 1 year ago

djbutler commented 1 year ago

Use case: Changing a device between BLE HID mode and some other mode where HID is disabled.

It's not so clear from the documentation if this is possible. I tried to implement my own Generic Attribute Service (UUID 0x1801) with Service Changed Characteristic (UUID 0x2A05) using adafruit_ble.services, but this produced an error (presumably because a service with UUID 0x1801 was already created by CircuitPython earlier in the BLE lifecycle).

The Adafruit Bluetooth Arduino libraries seem to allow the user to enable the Service Changed Characteristic via AdafruitBluefruit::configServiceChanged (https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/adafruitbluefruit). Is something similar possible here?

Thank you!

tannewt commented 1 year ago

I believe the nRF softdevice manages the service changed characteristic for us. We use it to announce new servers but have no way of removing them atm unfortunately.