This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Cannot Re-pair nRF8001 in iOS

I have an application based on the ble_HID_keyboard_template (uses STM32F072 instead of Arduino). The first time I pair my iPhone 5 (iOS 8.1.1) with the nRF8001, everything is fine and it receives key presses. However, if I then instruct the phone to forget the nRF8001, and try to pair again, the phone no longer receives key presses (but says the nRF8001 is connected).

I don't get any error events from the nRF8001. When comparing the events I see between a working pairing and failed pairing, everything is the same except for one thing. The timing event:

Working: E7 :07, 89, 0C, 00, 04, 00, 2C, 01 ---Timing change received conn Interval: 0x0C

Not working: E7 :07, 89, 18, 00, 00, 00, 48, 00 ---Timing change received conn Interval: 0x18

It is always the case that if I get a timing of 0x18, no key presses come through. If I get 0x0C, keys work.

If I tell the phone to forget the nRF8001, and then toggle Bluetooth off/on, pairing works again (timing is 0x0C). But fails on a re-pair as usual.

I'm not sure if the timing is the root cause, or a symptom, but it's all I have to go on. I have tried setting timing explicitly with lib_aci_change_timing (instead of lib_aci_change_timing_GAP_PPCP), but no joy.

The phone works with a real bluetooth keyboard just fine. I haven't tried pairing my nRF8001 application to any other platforms yet, so I cannot isolate this to nRF8001 <-> iOS specifically, or just an issue with my application code.

Related