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

Immediate disconnect during bonding attempt with BLE4.2 with deprecated bond information

Hello,

 

we face the following issues when trying to connect to our peripheral with Android 7 and 8 phones each with BLE4.2.

 

Precondition:

Phone was connected and bonded to the peripheral.

Bond information was stored by Peer Manager module.

The bond information was deleted on the peripheral and is no longer available in the peer manager module.

The bond information persists on the phone.

Connection settings:

#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 92
#define NRF_SDH_BLE_GAP_DATA_LENGTH 32
#define NRF_SDH_BLE_GAP_EVENT_LENGTH 10

#define MIN_CONN_INTERVAL                   MSEC_TO_UNITS(45, UNIT_1_25_MS)         /**< Minimum acceptable connection interval. */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(60, UNIT_1_25_MS) /**< Maximum acceptable connection interval. */
#define SLAVE_LATENCY 15 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(6000, UNIT_10_MS) /**< Connection supervisory time-out. */

#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(500) /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (10 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(1000) /**< Time between each call to sd_ble_gap_conn_param_update after the first call. */
#define MAX_CONN_PARAMS_UPDATE_COUNT 3 /**< Number of attempts before giving up the connection parameter negotiation. */

Observed behavior:

Phone connects to the peripheral, does not bond but disconnects right away.

On the peripheral the disconnect reason 19 (BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION) is reported.

On the phone the disconnect reason Reason: TERMINATE LOCAL HOST is reported after we get the ConnectionObserver.onDeviceConnected() event from the Nordic Android library. After this the Service discovery occurs automatically.

 

 

Expected behavior:

Phone connects and bonds to the peripheral without problems as it does with BLE5 and other Android versions.

 

 

Is there something we have to consider in the implementation on the peripheral that will lead to the expected behavior on all phones?

 

Thanks in advance for your help and best regards.

Parents
  • Hi, in addition to the information posted, probably some more settings are also important:

    #define BONDING_TIMEOUT_DELAY               APP_TIMER_TICKS(BONDING_TIMEOUT_SEC * 1000)
    #define BONDING_TIMEOUT_SEC 60

    #define MAX_BONDED_PEERS 5

    #define SEC_PARAM_BOND 1 /**< Perform bonding. */
    #define SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */
    #define SEC_PARAM_LESC 0 /**< LE Secure Connections enabled. */
    #define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
    #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */
    #define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
    #define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
    #define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
Reply
  • Hi, in addition to the information posted, probably some more settings are also important:

    #define BONDING_TIMEOUT_DELAY               APP_TIMER_TICKS(BONDING_TIMEOUT_SEC * 1000)
    #define BONDING_TIMEOUT_SEC 60

    #define MAX_BONDED_PEERS 5

    #define SEC_PARAM_BOND 1 /**< Perform bonding. */
    #define SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */
    #define SEC_PARAM_LESC 0 /**< LE Secure Connections enabled. */
    #define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
    #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */
    #define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
    #define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
    #define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
Children
No Data
Related