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

PIn Pairing

Hi Nordic guys,

I'm trying to create a pin pairing between an NRF52 DK and iPhone.

I've created this function to do that:

void generate_key(void){
  
  ret_code_t err_code;
  ble_opt_t passkey;

  uint8_t new_passkey[] = "123456";


  NRF_LOG_INFO("Setting new passkey: %s", nrf_log_push(new_passkey));

  passkey.gap_opt.passkey.p_passkey = new_passkey;

  err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &passkey);
  APP_ERROR_CHECK(err_code);

}

I've added that function in the ble_peripherical template code, in the void gap_params_init(void) function.

Any idea why the NRF doesn't ask me about the pairing key?

Best regards,

Jorge.

Parents Reply
  • Hi Amanda,

    I hope that your summer holydays have been enjoyed. I'm back again too. I was taking a look to the post, but I didn't be able to solve the problem.

    Could you send me a tested code to get that the nRF ask me about a pin??

    Also, I'm working in a custom PCB, and I'll like to use the nRF9160 for NB-IoT and LTE-M communications, do you know if it comes with the AT commands firmware from factory, or I've to upload it by the SWD pins?

    Best regards,

    Jorge,

Children
  • Hi Jorge, 

    I have added your code into SDK 17 ble_app_template as ble_app_template_253154.zip. When you bond with the device from nRF Connect, the device will ask to give pin code as "123456". As I mentioned in the previous reply, I only test on the Android phone because I don't have an iOS phone. 

     

    decastro_25 said:
    Also, I'm working in a custom PCB, and I'll like to use the nRF9160 for NB-IoT and LTE-M communications, do you know if it comes with the AT commands firmware from factory, or I've to upload it by the SWD pins?

    You have to upload it by the SWD pin. Please see nRF9160 DK Getting Started. If you have further questions regarding nRF9160, please create a new support case. It will be easy for you and us to manage the issue. It will also benefit other users to search for solutions. This is far away from the original post. 

    -Amanda H.

Related