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

Disable notification/permission to pair in NRF52

Hi,

In-app when you scan for device and after it is found you press the connect and then the notification/permission to pair pops out. Our app developers are saying that we must disable this notification in our firmware, but I can't find any similar settings in nRF SDK. If I connect to the device from nRF connect I don't see any notification/permission to pair. 

Can we disable notification/permission to pair in firmware or not? 

Thanks for help

Blaz

Parents
  • Hi, 

    Unfortunately, the BLE stack automatically pops up an alert view to prompt the user to confirm or cancel the pairing process. This is something that is happening on the OS BLE stack, so you won´t be able to prevent it from appearing from the application unless you don't use encrypted characteristics. The bonding process is triggered when you try to read an encrypted characteristic. 

    -Amanda H.

  • Dear Amanda,

    Thank you for your support. 

    Our application was developed from ble_app_bms example. Our BLE security settings were set to pair/no bonding. From your answers, I assume that we must set up BLE connection no pair no bonding?

    Form the instructions form your site it is written No pairing/bonding: NULL (or do not call pm_sec_params_set)

    I have disabled the pm_sec_params_set function and the app is still working. When I connect to the device after a few seconds I get time out message and disconnection of the BLE connection: BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.

    I find timeouts with disconnection in ble_evt_handler:

    case BLE_GATTC_EVT_TIMEOUT:
    // Disconnect on GATT Client timeout event.
    NRF_LOG_DEBUG("GATT Client Timeout.");
    err_code = sd_ble_gap_disconnect(p_ble_evt->evt.gattc_evt.conn_handle,
    BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
    APP_ERROR_CHECK(err_code);
    break;

    case BLE_GATTS_EVT_TIMEOUT:
    // Disconnect on GATT Server timeout event.
    NRF_LOG_DEBUG("GATT Server Timeout.");
    err_code = sd_ble_gap_disconnect(p_ble_evt->evt.gatts_evt.conn_handle,
    BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
    APP_ERROR_CHECK(err_code)

    But they are not the reason of diconnect.

    Can you please help me out where I can disable this timeout. 

    Regards, 

    Blaz 

Reply
  • Dear Amanda,

    Thank you for your support. 

    Our application was developed from ble_app_bms example. Our BLE security settings were set to pair/no bonding. From your answers, I assume that we must set up BLE connection no pair no bonding?

    Form the instructions form your site it is written No pairing/bonding: NULL (or do not call pm_sec_params_set)

    I have disabled the pm_sec_params_set function and the app is still working. When I connect to the device after a few seconds I get time out message and disconnection of the BLE connection: BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.

    I find timeouts with disconnection in ble_evt_handler:

    case BLE_GATTC_EVT_TIMEOUT:
    // Disconnect on GATT Client timeout event.
    NRF_LOG_DEBUG("GATT Client Timeout.");
    err_code = sd_ble_gap_disconnect(p_ble_evt->evt.gattc_evt.conn_handle,
    BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
    APP_ERROR_CHECK(err_code);
    break;

    case BLE_GATTS_EVT_TIMEOUT:
    // Disconnect on GATT Server timeout event.
    NRF_LOG_DEBUG("GATT Server Timeout.");
    err_code = sd_ble_gap_disconnect(p_ble_evt->evt.gatts_evt.conn_handle,
    BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
    APP_ERROR_CHECK(err_code)

    But they are not the reason of diconnect.

    Can you please help me out where I can disable this timeout. 

    Regards, 

    Blaz 

Children
  • Hi, 

    Bselekar said:
    Our application was developed from ble_app_bms example. Our BLE security settings were set to pair/no bonding. From your answers, I assume that we must set up BLE connection no pair no bonding?

    The Bond Management Application is an example that demonstrates how to use the Bond Management Service. The example shows how to manage the storage of bond information and how to delete bonds after they have been established. Therefore, it should set to no bonding.

    You should another example and see the Peer Manager/Usage.

    If you have a new question, please create a new support case. 

    -Amanda H. 

  • Hi,

    Thank you for your replay. Which no paring no bonding example is best to check? 

    Regards, 

    Blaz

  • Hi, 

    You could try Heart Rate Application and do not call pm_sec_params_set for no pairing/bonding. 

    -Amanda H.

  • Hi, 

    From log TX report I see that problem is in pm_conn_secure():

    <debug> peer_manager_handler: Connected, securing connection. conn_handle: 0
    <info> app: Connected
    <error> peer_manager_handler: Asserting. pm_conn_secure() returned NRF_ERROR_NOT_FOUND on conn_handle 0.
    <error> app: Fatal error
    <warning> app: System reset
    <info> app: Device turned on
    <info> app: m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8
    <debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
    <info> app: Fast advertising.

    I don't know how to disable   Peer Manager event handler. Even if the function is empty the _conn_secure function starts in the background. 

    But if I don't initialize the peer_manager_init() then device won't start:

    <info> app: Device turned on
    <error> app: Fatal error
    <warning> app: System reset

    I see in Blinky example that the  peer_manager_init()  is not used and no paring no bonding is working fine. I don't understand why the device has: <error> app: Fatal error if the  peer_manager_init() is not initialized.

    This request to change come from the customer yesterday and we must start the mass production on Monday.  We are under enormous time pressure so please help me out. 

    Thank you for help,

    Regards, 

    Blaz 

  • If you don't use bond and pair, you do not need to use peer_manager. Blinky example is a good example without that. If you want to modify a bond example to no-bond, HRS example might help you know that. 

    What is your development purpose? 

    -Amanda H

Related