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

LESC numeric comparison pairing PIN generation

Hello. I need to use LESC numeric comparison pairing. It seems that the PIN is automatically and ramdomly generated after the connection occurs. I would need to manage or generate by myself the PIN generation, because I need to know it with enoug time to display it prior to send it to the other peer. This is because the other peer (smartphone) has a little time out to ingress the numeric PIN, so I need to know it after the connection. Any ideas? Thanks in advance.

Parents
  • Hi Jemajuca,

    How did you test ? Have you tried with ble_app_multirole_lesc example ?

    It should give the phone at least 30 seconds. I'm not sure why you said "as a little time out to ingress the numeric PIN" how long was that ?

    Note that there is a bug in the example, if you test with S8 or other new phone that may support 2Mbps you need to add this handler in on_ble_evt:

       case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
            {
                NRF_LOG_DEBUG("PHY update request.");
                ble_gap_phys_t const phys =
                {
                    .rx_phys = BLE_GAP_PHY_AUTO,
                    .tx_phys = BLE_GAP_PHY_AUTO,
                };
                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
                APP_ERROR_CHECK(err_code);
            } break;
    
Reply
  • Hi Jemajuca,

    How did you test ? Have you tried with ble_app_multirole_lesc example ?

    It should give the phone at least 30 seconds. I'm not sure why you said "as a little time out to ingress the numeric PIN" how long was that ?

    Note that there is a bug in the example, if you test with S8 or other new phone that may support 2Mbps you need to add this handler in on_ble_evt:

       case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
            {
                NRF_LOG_DEBUG("PHY update request.");
                ble_gap_phys_t const phys =
                {
                    .rx_phys = BLE_GAP_PHY_AUTO,
                    .tx_phys = BLE_GAP_PHY_AUTO,
                };
                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
                APP_ERROR_CHECK(err_code);
            } break;
    
Children
Related