Problem with implementing nfc pairing along with regular bluetooth pairing (passkey)

Hi! I'm trying to add second option of pairing to my nrf52840DK. I already have pairing using passkey, however I would like to also provide an option of pairing using NFC. Is it even possible, if so could someone explain me how to do it? Already looked up at nfc examples and couldn't work anything out.
I was also wondering if regular advertising and direct advertising would not "cancel" each other, because when I (poorly) tried to implement nfc pairing to my DK(which was working fine), it stopped showing up when I was scanning for it, so I suppose it did not do regular advertise.
Cheers and thanks in advance :)

Parents
  • Hi Waatff, 

    A device can support both passkey and NFC. It depends on the peer device, if the peer device also support NFC then NFC will be used. If it doesn't support NFC and only passkey supported then passkey will be used. 

    Could you give us more information about the SDK you are using ?
    Which example did you test with ? 

    If you are using nRF Connect SDK you should try \nrf\samples\bluetooth\peripheral_nfc_pairing
    If you are using NRF5 SDK you should try \examples\ble_peripheral\experimental\ble_app_hrs_nfc_pairing

    Note that normally you only do directed advertising for a very short period of time 1.25ms and have to switch back to normal advertising (to avoid congestion). So usually you don't do directed advertising at the same time as normal advertising. 

  • I'm using nRF Connect SDK v2.2.0 and tried the peripherial_nfc_pairing sample, however I failed at implementing it at my project. Thanks for the "advertising part" of your answer, I may missed it so I will try again having this in my mind :)

  • Hi again, 

    Which issue do you have with implementing it in your application ? 


    I would assume you have tested with the sample and it worked out of the box ? 

  • My issue was the fact that I couldn't establish the ble connection when using nfc pairing. I will try and rewrite that code so it should work, if it won't then I will get back to you.

    And yeah the sample worked right out of the box.

  • Hi again, this problem with nfc pairing is already gone, however I got different question. Is it possible to disable passkey authorization for nfc pairing while still requesting passkey for regular connections?

  • Hi Waatff, 

    If both devices have OOB (NFC) support, they will use OOB as the authentication method and passkey will not be used. 

    If you want to have different mode that you either only support NFC or only support passkey, you can reinitialize the authentication handlers by calling bt_conn_auth_cb_register(NULL) 
    Then you call bt_conn_auth_cb_register() again with the correct callbacks (adding or removing passkey_display or oob_data_request)

    By not having passkey_display or passkey_entry in the callback the device will not request passkey (don't support display or keyboard)

Reply
  • Hi Waatff, 

    If both devices have OOB (NFC) support, they will use OOB as the authentication method and passkey will not be used. 

    If you want to have different mode that you either only support NFC or only support passkey, you can reinitialize the authentication handlers by calling bt_conn_auth_cb_register(NULL) 
    Then you call bt_conn_auth_cb_register() again with the correct callbacks (adding or removing passkey_display or oob_data_request)

    By not having passkey_display or passkey_entry in the callback the device will not request passkey (don't support display or keyboard)

Children
No Data
Related