This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ANCS Bonding Without an App

I have the RedBear BLE shield running on an Arduino Leonardo. I am using the ANCS Library from here: github.com/.../avr_nrf_ancs_library and have updated it to run the latest Nordic BLE library.

I have everything up and running and it is able to receive notifications. However, in order to pair/bond I have to use the LightBlue App on the iPhone in order to scan for Bluetooth LE.

I want to be able to use the iOS Bluetooth Settings instead to pair/bond with the shield instead of having to use an App.

Using nRFGo Studio I have update services.h to solicit for ANCS services. I did this by clicking on the GAP Settings tab and then selecting the ANCS Service UUID under Remote Services to Solicit for. I also turned on Service Solicitation on Broadcast Advertisements and Scans.

Now the BLE Shield shows up on the iOS Bluetooth settings panel. When I click on it, it only pairs with the shield, it does not bond.

Is there something I have to do with my Arduino Sketch or the Pipes in nRFGo Studio in order to have them bond?

It would be great to be able to natively bond with the shield without needing another app.

  • You might be confused a bit about apple's terminology. The pairing dialog that comes up in iOS is actually bonding in BTLE terms. If your app is"paired" in iOS, it is indeed paired. If ANCS is working, it should be sending notifications to the peripheral without the need for an app.

  • Good point! I am not getting the pairing dialog when I try to connect through the iOS Bluetooth Setting pane. I do see the Shield there and when I click on the I get the "wait circle" and then it says "Connected". However there is the Information Circle button next to it and the Pairing dialog doesn't come up. When I turn Bluetooth off & on on the iOS side, the connection is forgotten. What do I have to do on the Arduino / BLE Shield side to make the Pairing Dialog come up without an App? Are there any good examples?

  • I looked through the SDK docs and it looks like it should be possible to have a Service Solicitation start the bonding process. I am only advertising under the Bonding tab of the GAP server, but it still doesn't result in a Pairing dialog popping up.

  • I figured it out... you need to request the security once the connection has been made. iOS doesn't try to read any of the attributes by itself, so the security doesn't upgrade on its own.

    Add this into the pipe_status event handler:

    if (lib_aci_is_discovery_finished(&aci_state) && (ACI_BOND_STATUS_SUCCESS != aci_state.bonded)) {
                    debug_println(F("Upgrading security!"));
                    lib_aci_bond_request();
                }
    
Related