Circuitpython: nrf: implement bonding

Created on 6 Jan 2020  路  3Comments  路  Source: adafruit/circuitpython

Many thanks for everybody's work on HID support thus far. Prior to the refactor in https://github.com/adafruit/Adafruit_CircuitPython_BLE/commit/8291ee9b1bd2206cb384483183c30358be40e6c5, I was using code like (simplified):

from adafruit_ble.hid_server import HIDServer
ADVERTISED_NAME = 'Whatever'
hid = HIDServer(ADVERTISED_NAME)
if not hid.connected:
    hid.start_advertising()
    while not hid.connected:
        pass
# ... do something once connected ...

Once I'd paired my iOS device once, it would automatically connect and pair with the CircuitPython board as long as it was advertising (i.e. if I turned on Bluetooth in the iOS settings it would automatically pair with the board).

Using the new ble_hid_periph.py sample (with some code which works around adafruit/Adafruit_CircuitPython_BLE#46), the board always appears in the "other devices" section of the iOS Bluetooth settings (rather than "my devices"). Tapping on the device name starts a new connection from scratch, and shows a pairing request prompt every single time.

Is this something which is yet to be implemented after the refactor, or should my code be doing something to scan for previously bonded devices and connect to them?

nrf52

Most helpful comment

I am working on bonding right now (finished the coding over the weekend). I believe the issue you are seeing is because we are not temporarily remembering the pairing information right now. In any case, it's in process.

All 3 comments

I am working on bonding right now (finished the coding over the weekend). I believe the issue you are seeing is because we are not temporarily remembering the pairing information right now. In any case, it's in process.

Thanks so much for the quick response, and great to hear this is on the radar!

CC @sinabahram

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ladyada picture ladyada  路  51Comments

Vjmorrison picture Vjmorrison  路  28Comments

tannewt picture tannewt  路  41Comments

tannewt picture tannewt  路  31Comments

kattni picture kattni  路  49Comments