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

static Passkey add central ble_app_uart_c

Hello everyone,

I trying to communicate nrf52832 SDK 15.0 ble_app_uart(peripheral)  to ble_app_uart_c (central) with secured purpose adding static passkey but i don't get perfect examples on central side adding passkey and peer manager.  please share some example code for adding passkey in central side for better communication.

I added peer manager concept using ble_app_gls example but my code doesn't come in this case BLE_GAP_EVT_AUTH_KEY_REQUEST. i using whitelist in peripheral side it's also need central side...???

  please refer any working code.

Parents
  • Take a look at this case, where I have attached code for respectively the central and the peripheral (SDK 15.0) on how to bond using a static passkey.

    Best regards,

    Simon

  • Thanks for replay Simon,

    I trying central this example code using SDK 15.2 Its get many errors as below


    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol asm (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_conn_secure (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_handler_disconnect_on_sec_failure (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_handler_flash_clean (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_handler_on_pm_evt (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_init (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_register (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol pm_sec_params_set (referred from main.o).

    Which example code suitable for adding this library.

    This example not suitable SDK 15.0....???

  • hello simon,

    I test this example code in SDK 15.2 same passkey enter both side but connection doesn't make central to peripheral error show continuously as below


     0> <info> app: ATT MTU exchange completed.
     0> <info> app: Ble NUS max data length set to 0xF4(244)
     0> <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
     0> <warning> peer_manager_handler: Disconnecting conn_handle 0.
     0> <info> app: Disconnected.
     0> <info> app: Disconnected. conn_handle: 0x0, reason: 0x16

    please guide me any step or function i missing in this example code...???

  • I am sorry for the long delay, I am currently looking into your issue and will try to provide an answer as soon as possible.

    Best regards,

    Simon

  • I have used delete bonding concept in central side, Now Its working very well Thanks for your support Simon.

  • Hello simon,

    central some time makes this kind of error show

     0> <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
     0> <warning> peer_manager_handler: Disconnecting conn_handle 0.
     0> <info> app: Disconnected.
     0> <info> app: Erase bonds
     0> <info> app: Disconnected. conn_handle: 0x0, reason: 0x16
     0> <error> peer_manager_handler: Peer deleted successfully: peer_id: 0
     0> <info> peer_manager_handler: All peers deleted.

  • My suspicion is that the LTK is lost on the peripheral side. Could you try to do the following:

    • Erase the content of both chips
    • Build and flash ble_app_uart(with bondingl)  and ble_app_uart_c (with bonding) onto your two nRF52832's
    • Run both the examples and establish a bond
    • Erase the content from the peripheral device and reprogram it with ble_app_uart(with bondingl)
    • Try to establish a bond once again and see if the error appears

    Best regards,

    Simon

Reply
  • My suspicion is that the LTK is lost on the peripheral side. Could you try to do the following:

    • Erase the content of both chips
    • Build and flash ble_app_uart(with bondingl)  and ble_app_uart_c (with bonding) onto your two nRF52832's
    • Run both the examples and establish a bond
    • Erase the content from the peripheral device and reprogram it with ble_app_uart(with bondingl)
    • Try to establish a bond once again and see if the error appears

    Best regards,

    Simon

Children
Related