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

BLE_GAP_EVT_SEC_REQUEST event missing?

Hello everyone, 

1st of all, thank you for taking your time to have a look over my "problem".

I have a device that I am working on, that acts as aperipheral, it is a non NRF one.

I also have a NRF52DK that I am using to develop the central device for my peripheral.

In the central (NRF52DK), for connection, I am scanning for Local Name (shortened local name never works for me).

Immediately after a connection is estabilished, from peripheral I issue a BLE_GAP_EVT_SEC_REQUEST, that is visible on the sniffer log, but I seem to get no event in the central device at ble_evt_handler level.

Probably I am completely missing something, but please, can anyone help me out finding out what am I missing?

Thank you in advance, 

Victor 

Parents
  • Changing #define NRF_LOG_DEFAULT_LEVEL 4 in sdk_config.h file and using unchanged main.c file you attached.

    changing the name and adding authenticate in blinky peripheral example at the connected event as below

            case BLE_GAP_EVT_CONNECTED:
                NRF_LOG_INFO("Connected");
                bsp_board_led_on(CONNECTED_LED);
                bsp_board_led_off(ADVERTISING_LED);
                m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
                err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle);
                APP_ERROR_CHECK(err_code);
                err_code = app_button_enable();
                APP_ERROR_CHECK(err_code);
    
                sd_ble_gap_authenticate(m_conn_handle, &sec_params );
                break;

    I get the event you said is missing in your end.

    <debug> nrf_ble_gq: Registering connection handle: 0x0000
    <debug> ble_db_disc: Starting discovery of service with UUID 0x1523 on connection handle 0x0.
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Primary Services Discovery Request
    <debug> nrf_ble_gq: SD GATT procedure (2) succeeded on connection handle: 0.
    <debug> app: security requested
    <debug> ble_db_disc: Found service UUID 0x1523.
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Characteristic Discovery Request
    <debug> nrf_ble_gq: SD GATT procedure (3) succeeded on connection handle: 0.
    <debug> nrf_ble_gq: Processing the request queue...
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Characteristic Discovery Request
    <debug> nrf_ble_gq: SD GATT procedure (3) succeeded on connection handle: 0.
    <debug> nrf_ble_gq: Processing the request queue...
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Characteristic Discovery Request
    <debug> nrf_ble_gq: SD GATT procedure (3) succeeded on connection handle: 0.
    <debug> nrf_ble_gq: Processing the request queue...
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Characteristic Descriptor Request
    <debug> nrf_ble_gq: SD GATT procedure (4) succeeded on connection handle: 0.
    <debug> nrf_ble_gq: Processing the request queue...
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Characteristic Descriptor Request
    <debug> nrf_ble_gq: SD GATT procedure (4) succeeded on connection handle: 0.
    <debug> nrf_ble_gq: Processing the request queue...
    <debug> ble_db_disc: Discovery of service with UUID 0x1523 completed with success on connection handle 0x0.
    <debug> ble_lbs_c: LED Button Service discovered at peer.
    <info> app: LED Button service discovered on conn_handle 0x0.
    <debug> ble_lbs_c: Configuring CCCD. CCCD Handle = 14, Connection Handle = 0
    <debug> nrf_ble_gq: Adding item to the request queue
    <debug> nrf_ble_gq: GATTC Write Request
    <debug> nrf_ble_gq: SD GATT procedure (1) succeeded on connection handle: 0.
    <debug> nrf_ble_gq: Processing the request queue...
    <debug> nrf_ble_gq: Processing the request queue...

  • one more thing, in order to get an automatic response to that security request, do I have to enable PM?

  • yes, enabling PM will handle that request automatically for you.

Reply Children
No Data
Related