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

SDK15.2 ANCS phone unable to bind after forgot device

Example:nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_ancs_c\pca10040e\s112\arm4

I tested ancs on the board,connected ancs with the iphone, chose to forget the device in Bluetooth, clicked on the device again, and showed pairing unsuccessful. I don't know how to delete pairing in the examples. I think after iphone forget the device,click on the device again to  pairing;
Parents Reply Children
  • I modified the following places. After the pairing is successful, I forgot the device in the Bluetooth settings of the iphone. After the new pairing is successful, I will turn off the Bluetooth of the iphone, and then open the Bluetooth of the iphone. The ancs of the iphone cannot be reconnected automatically. How to solve this problem?

  • I forgot my device and re-paired it. After I quit the bluetooth page of my phone, the connection was automatically disconnected

  • Hi,

    m_whitelist_peer_cnt should not be incremented if you get BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE so the code should have been something like this instead:

                // Note: You should check on what kind of white list policy your application should use.
                if (     p_evt->params.peer_data_update_succeeded.flash_changed
                     && (p_evt->params.peer_data_update_succeeded.data_id == PM_PEER_DATA_ID_BONDING))
                {
                    NRF_LOG_DEBUG("New Bond, add the peer to the whitelist if possible");
                    NRF_LOG_DEBUG("\tm_whitelist_peer_cnt %d, MAX_PEERS_WLIST %d",
                                   m_whitelist_peer_cnt + 1,
                                   BLE_GAP_WHITELIST_ADDR_MAX_COUNT);
    
                    if (m_whitelist_peer_cnt < BLE_GAP_WHITELIST_ADDR_MAX_COUNT)
                    {
                        // Bonded to a new peer, add it to the whitelist.
                        m_whitelist_peers[m_whitelist_peer_cnt++] = p_evt->peer_id;
    
                        // The whitelist has been modified, update it in the Peer Manager.
                        ret = pm_device_identities_list_set(m_whitelist_peers, m_whitelist_peer_cnt);
                        if (ret == BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE)
                        {
                            m_whitelist_peers[--m_whitelist_peer_cnt] = PM_PEER_ID_INVALID;
                        }
                        else if (ret != NRF_ERROR_NOT_SUPPORTED)
                        {
                            APP_ERROR_CHECK(ret);
                        }
    
                        ret = pm_whitelist_set(m_whitelist_peers, m_whitelist_peer_cnt);
                        APP_ERROR_CHECK(ret);
    
                        NRF_LOG_HEXDUMP_INFO(m_whitelist_peers, sizeof(m_whitelist_peers));
                    }

    Regarding the re-connect issue, I see the same here. After bond refresh I need to manually re-connect to the ANCS. However, autoconnect seems to work fine after that. This might be an iOS limitation.  

  • After forgetting the device and pairing again, the first time the Bluetooth is turned off, it will not automatically connect. After manually clicking the connection, the Bluetooth automatic connection is no problem. What is the problem after the first switch of Bluetooth is not reconnected?
  • I use 52810 development board, 15.2 SDK, S112 project, has been changed according to the requirements. After forgetting the device on the iphone, I paired it in Bluetooth. After successfully exiting the Bluetooth interface, ANCs automatically disconnected.

Related