This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is there an API that can get the authentication method?

Hello.
I am developing using nrf52832 (S132 v7.0.1, SDK v17.0.0) as a peripheral device.

I want to know the authentication method of the central device when the connection is established.
Is there an API that can get the authentication method?

Also, when BLE_GAP_EVT_CONNECTED of ble_evt_handler is called, you can see the security parameters by checking "p_ble_evt-> evt-> gap_evt-> params-> sec_params_request-> peer_params".
Is it possible to know the authentication method of the central device by comparing it with the value on the following site and checking the authentication method?

Best regards.

Parents
  • Hi,

    You can get the getting the security status of a connection using pm_conn_sec_status_get()

    You also have the BLE_GAP_EVT_AUTH_STATUS event (Authentication procedure completed event)

             case BLE_GAP_EVT_AUTH_STATUS:
                 NRF_LOG_INFO("BLE_GAP_EVT_AUTH_STATUS: status=0x%x bond=0x%x lv4: %d kdist_own:0x%x kdist_peer:0x%x",
                              p_ble_evt->evt.gap_evt.params.auth_status.auth_status,
                              p_ble_evt->evt.gap_evt.params.auth_status.bonded,
                              p_ble_evt->evt.gap_evt.params.auth_status.sm1_levels.lv4,
                              *((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status.kdist_own),
                              *((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status.kdist_peer));

Reply
  • Hi,

    You can get the getting the security status of a connection using pm_conn_sec_status_get()

    You also have the BLE_GAP_EVT_AUTH_STATUS event (Authentication procedure completed event)

             case BLE_GAP_EVT_AUTH_STATUS:
                 NRF_LOG_INFO("BLE_GAP_EVT_AUTH_STATUS: status=0x%x bond=0x%x lv4: %d kdist_own:0x%x kdist_peer:0x%x",
                              p_ble_evt->evt.gap_evt.params.auth_status.auth_status,
                              p_ble_evt->evt.gap_evt.params.auth_status.bonded,
                              p_ble_evt->evt.gap_evt.params.auth_status.sm1_levels.lv4,
                              *((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status.kdist_own),
                              *((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status.kdist_peer));

Children
Related