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

How to pair between central/peripheral in lesc mode?

Thanks in advanced. Both platforms are: nrf52832, sdk17.0.2. The peripheral is based on ble_app_gls and I set static passkey 123456, the central is based on ble_app_hrs_c, so both sides have peer manager mechanism, I set sec_param.lesc=1 on both sides. I've implemented nus on both sides, I can use cell phone to pair/bond with the peripheral. But with nrf52832 central, I get below traces:

0> <info> app_timer: RTC: initialized.
 0> <info> app: Heart Rate collector example started.
 0> <info> app: Starting scan.
 0> <info> app: Connecting to target F92A1B6369F4
 0> <info> app: Connected.
 0> <info> app: GATT ATT MTU on connection 0x0 changed to 247.
 0> <info> app: Data length for connection 0x0 updated to 251.
 0> <info> app: BLE_GAP_EVT_LESC_DHKEY_REQUEST
 0> <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0
 0> <info> app: Discovery complete.
 0> <info> app: Connected to device with Nordic UART Service.
 0> <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Bonding
 0> <info> app: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0 kdist_own:0x3 kdist_peer:0x2
 0> <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Bonding data, action: Update
 0> <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update
 0> <info> app: Disconnected.
 0> <info> app: Starting scan.
 0> <info> app: Disconnected, reason 0x13.
 0> <info> app: Starting scan.
 0> <info> app: Connecting to target F92A1B6369F4
 0> <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
 0> <info> app: Connected.
 0> <info> app: GATT ATT MTU on connection 0x0 changed to 247.
 0> <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4352
 0> <info> app: Disconnected.
 0> <info> app: Starting scan.
 0> <info> app: Disconnected, reason 0x13.
 0> <info> app: Starting scan.
 0> <info> app: Connecting to target F92A1B6369F4
 0> <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
 0> <info> app: Connected.
 0> <info> app: GATT ATT MTU on connection 0x0 changed to 247.
 0> <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4352
 0> <info> app: Disconnected.
 0> <info> app: Starting scan.
 0> <info> app: Disconnected, reason 0x13.
 

I don't know how to input passkey in central, the central only has display capability by RTT Viewer. Would anyone tell me how to input passkey and get authority passed?

Parents
  • Have you been able to use the static passkey that you set while using another central, such as nRF Connect for Desktop? Did the passkey work?

    Now, on your custom central, do you see any events when you try to bond? Do you initiate bonding? If not, please look at how ble_app_hrs_c does this. (It doesn't use a passkey, but look at what events you receive when you initiate bonding).

    Best regards,

    Edvin

  • Thanks for reply, I can 100% ensure that the peripheral static passkey works normally with other central devices. About my custom central, I see this event:

      0> <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0

    I think passkey should be input here, but I don't know how. And traces followed even show bonding pass without key......I even flash rom again and still get the result. 

    0> <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Bonding
    0> <info> app: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0 kdist_own:0x3 kdist_peer:0x2

    My peer manager params are same on peripheral and central:

    sec_param.bond = 1;
    sec_param.mitm = 1;
    sec_param.lesc = 1;
    sec_param.keypress = 0;
    sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY;
    sec_param.oob = 0;
    sec_param.min_key_size = 7;
    sec_param.max_key_size = 16;
    sec_param.kdist_own.enc = 1;
    sec_param.kdist_own.id = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id = 1;

Reply
  • Thanks for reply, I can 100% ensure that the peripheral static passkey works normally with other central devices. About my custom central, I see this event:

      0> <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0

    I think passkey should be input here, but I don't know how. And traces followed even show bonding pass without key......I even flash rom again and still get the result. 

    0> <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Bonding
    0> <info> app: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0 kdist_own:0x3 kdist_peer:0x2

    My peer manager params are same on peripheral and central:

    sec_param.bond = 1;
    sec_param.mitm = 1;
    sec_param.lesc = 1;
    sec_param.keypress = 0;
    sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY;
    sec_param.oob = 0;
    sec_param.min_key_size = 7;
    sec_param.max_key_size = 16;
    sec_param.kdist_own.enc = 1;
    sec_param.kdist_own.id = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id = 1;

Children
No Data
Related