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

ANCS Sample doesn't work after rebooting iOS Device

I'm testing ble_app_ancs experimental sample.

It seems working first connection. But after rebooting iOS Device, or Turn Off/On bluetooth function on iOS Device, ANCS does't work.

After delete bonding both evaluation board and iOS Device, it works again. Is there any infomation about this issue?

Testing Environment

iOS Device iPod touch 5th Gen. iOS 7.0.3 iPhone 5 iOS 7.0.3

BLE Board nrf6310 Rev 1.4 nrf6350 Rev 2.0 PCA10004 Rev 2.1.0 Softdevice 6.0.0-5beta

Parents
  • i have a question here. i want present some cases. Case1: I have changed the following code in on_ble_evt from:

    case BLE_GAP_EVT_AUTH_STATUS: apple_notification_setup(); break;

    to:

    case BLE_GAP_EVT_CONN_PARAM_UPDATE: case BLE_GAP_EVT_AUTH_STATUS: apple_notification_setup(); break;

    i pair with my ancc device. It reconnects automatically on ble turn off, then ble on. it reconnects automatically on board turn off and on. But when i 'forget device' and then repair, client goes to connected state. But sever remains unconnected.

    Case2: I make no changes in on_ble_evt. it is as in the given example by nordic.

    i pair with my ancc device. It reconnects automatically on ble turn off, then ble on. it reconnects automatically on board turn off and on. But when i 'forget device' and then repair, client goes to connected state. But sever remains unconnected.

    Case 3: I dont store bonds. Instead i delete all bonds.

    instead of err_code = ble_bondmngr_bonded_centrals_store(); APP_ERROR_CHECK(err_code); i write err_code = ble_bondmngr_bonded_centrals_delete(); APP_ERROR_CHECK(err_code); Here I connect and pair to iOS device. I forget device, then repair everything is fine. I turn off ble, then on. Both client and server jumps back and forth from connected to unconnected. But when i tap on the device name i am able to reconnect. Same behavior exists on board turn off and on.

    What is a solution to handle all three cases:1. forget device and repair, 2. ble off/on, 3. board turn off/on?

Reply
  • i have a question here. i want present some cases. Case1: I have changed the following code in on_ble_evt from:

    case BLE_GAP_EVT_AUTH_STATUS: apple_notification_setup(); break;

    to:

    case BLE_GAP_EVT_CONN_PARAM_UPDATE: case BLE_GAP_EVT_AUTH_STATUS: apple_notification_setup(); break;

    i pair with my ancc device. It reconnects automatically on ble turn off, then ble on. it reconnects automatically on board turn off and on. But when i 'forget device' and then repair, client goes to connected state. But sever remains unconnected.

    Case2: I make no changes in on_ble_evt. it is as in the given example by nordic.

    i pair with my ancc device. It reconnects automatically on ble turn off, then ble on. it reconnects automatically on board turn off and on. But when i 'forget device' and then repair, client goes to connected state. But sever remains unconnected.

    Case 3: I dont store bonds. Instead i delete all bonds.

    instead of err_code = ble_bondmngr_bonded_centrals_store(); APP_ERROR_CHECK(err_code); i write err_code = ble_bondmngr_bonded_centrals_delete(); APP_ERROR_CHECK(err_code); Here I connect and pair to iOS device. I forget device, then repair everything is fine. I turn off ble, then on. Both client and server jumps back and forth from connected to unconnected. But when i tap on the device name i am able to reconnect. Same behavior exists on board turn off and on.

    What is a solution to handle all three cases:1. forget device and repair, 2. ble off/on, 3. board turn off/on?

Children
  • You have no way of knowing when the iOS device forgets the bonding information for your device. If the iOS device loses bond information and then reconnects, it will most likely be seen as a completely new device, since it switches addresses every 15 minutes or so. If the nRF51822 loses bond information, the iOS device will however most likely not work properly afterwards, without the user explicitly also deleting bond information on the phone. This is by design.

    In summary, you should just store information on whatever new device bonds with you, and when bonding storage is full, you should take a conscious choice on which device to delete. You should not normally delete all bond information, unless the user explicitly wants it, since this will cause problems for all previously bonded devices.

Related