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

PASSKEY

 I’ve downloaded     nRF5_SDK_11.0.0_89a8197 and starting with examples from \examples\ble_peripheral\???\pca10040\s132\arm5_no_packs\

 I would like the other device to request a passkey (constant) at pairing (the passkey on my side is constant - no display needed)

After   gap_params_init();I’ve added the following code:

 

{

 static ble_opt_t optS;

   static uint8_t passw[]="123456";           

 optS.gap_opt.passkey.p_passkey=passw;

   err_code =sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &optS);

}

 

err_code returned :  0  

 

Still the module will pair and communicate without requesting a passkey.

I've tried to find an answer in Q&A . in some answers there was a reference to fields : io_caps,mitm. cant make out what does it mean. 

(these fields belong to structs relevant to services, not pairing)

 

Thanks for any help

   Yona

  • I tried to advertise manufacturer data. even coping a full function from Nordic help. for some reason- didn't work .

    the application(cellphone) guy didn't like the appearance because he would have to preform a READ to get that info.

    then I realized that the advertised Service isn't a real functional service. so advertising in is actually

    "for free".

    the app guy  didn't object so that's how we solved that.

    so now a new issue.hope you still have some more patience left for my questions.

    when trying to make the passkey work- you recommended to use ble_app_hrs example project .

    (I'm using nRF5_SDK_11.0.0_89a8197 packege).

    I've noticed but  didn't pay attention to it then:    the SW  RESETS every some time (~ 4 minutes) due to an error :   NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN returned by function sd_power_system_off   (called from sleep_mode_enter).

    if I remove this function all together then the SW will not reset- BUT the BLE goes dead after the same time (~4 minutes).

    meanwhile the SW is still running and the application timers are still on ( timers resulting from app_timer_create).

    coming out of this situation - by resetting the HW/SW .

    what would you say ?

    thanks again

    Yona

  • one more thing:

    I've tried  using  nRF5_SDK_15xxxxx package  with ble_app_hrs example project.

    its way too heavy . too many elements to remove (and than it gives some internal error).

    so I still need your help regarding the resets/BLE dying .

    I'd prefer not to call  sd_power_system_off if I can avoid it

    Thanks

    Yona

  • If you do not want the ble_app_hrs example to go to SYSTEM OFF, then simply comment out the sleep_mode_enter(); call under the BLE_ADV_EVT_IDLE case in on_adv_evt() and under the  BSP_EVENT_SLEEP case in bsp_event_handler().

    Best regards

    Bjørn 

  • me again, new issue 

    now that a peripheral BLE is working (including the passkey), I'm requested to develop a tester for that unit.

    For that I need A BLE central .

    so I started with nRF5_SDK_11.0.0_89a8197\examples\ble_central\ble_app_multilink_central .

    all is fine.the only issue is again: how to operate the passkey (as a central unit)

    thanks

    Yona

  • HI Yona, 

    you need to reply to the BLE_GAP_EVT_AUTH_KEY_REQUEST with sd_ble_gap_auth_key_reply with the passkey as a parameter, see the Bonding: Passkey Entry, User Inputs on Central or OOB MSC.

    You can also take a look at this post. 

    Best regards

    Bjørn

Related