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
  • Hi Ole,

    Thanks again for your help. I am now halfway there...

    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;
    

    This causes alerts to work after Bluetooth is turned off (on the iPhone) and back on again.

    However, alerts still do not work after the iPhone has been turned off and back on again!

    (although turning Bluetooth off (on the iPhone) and back on, will start it working again).

    I'm not sure why yet, but perhaps it is because after a reboot of the iPhone, there are no events for BLE_GATTC_EVT_CHAR_DISC_RSP or BLE_GATTC_EVT_DESC_DISC_RSP.

    I am using the following to check for events:

    
    extern uint16_t live_event;
    void ble_evt_dispatch(ble_evt_t * p_ble_evt)
    {
    live_event = p_ble_evt->header.evt_id;
    ...
    
    

    and

    
    uint16_t live_event = 0;
    int main(void)
    {
    ...
    ...
    ...
        while (true)
        {
            if (live_event != 0)
            {
                char text[20];
                sprintf(text, "%04x \r\n", live_event);
                simple_uart_putstring((const uint8_t *) text);	
                live_event = 0;
            }
    }
    
    

    How can I re-enable notifications after an iPhone has been turned off and back on?

Reply
  • Hi Ole,

    Thanks again for your help. I am now halfway there...

    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;
    

    This causes alerts to work after Bluetooth is turned off (on the iPhone) and back on again.

    However, alerts still do not work after the iPhone has been turned off and back on again!

    (although turning Bluetooth off (on the iPhone) and back on, will start it working again).

    I'm not sure why yet, but perhaps it is because after a reboot of the iPhone, there are no events for BLE_GATTC_EVT_CHAR_DISC_RSP or BLE_GATTC_EVT_DESC_DISC_RSP.

    I am using the following to check for events:

    
    extern uint16_t live_event;
    void ble_evt_dispatch(ble_evt_t * p_ble_evt)
    {
    live_event = p_ble_evt->header.evt_id;
    ...
    
    

    and

    
    uint16_t live_event = 0;
    int main(void)
    {
    ...
    ...
    ...
        while (true)
        {
            if (live_event != 0)
            {
                char text[20];
                sprintf(text, "%04x \r\n", live_event);
                simple_uart_putstring((const uint8_t *) text);	
                live_event = 0;
            }
    }
    
    

    How can I re-enable notifications after an iPhone has been turned off and back on?

Children
No Data
Related