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

BLE connection with pin code

Hi,

I'm using NRF52840 in order to connect to a mobile device, with PIN code.

Connection to Android is ok. The issue is with IOS.

IOS can't send the PIN code to my device, I understand that NRF device should transmit it's services so IOS will read it before sending the PIN code. Am I right?

Thanks!

Parents Reply
  • Hi,

    The "insufficient authentication" error will be sent automatically by the Softdevice if the peer tries to read/write a characteristic that is configured to require a higher security level. So you need to configure the security level for the characteristic you want to " protect" by requiring pairing and entering a pin.

    From the heart rate example:

        // Here the sec level for the Heart Rate Service can be changed/increased.
        hrs_init.hrm_cccd_wr_sec = SEC_JUST_WORKS;
        hrs_init.bsl_rd_sec      = SEC_JUST_WORKS;
    
        err_code = ble_hrs_init(&m_hrs, &hrs_init);
        APP_ERROR_CHECK(err_code);

    Notice that the required security level is just works in this case. You should probably require SEC_MITM since you are using a PIN.

Children
Related