Skip to main content
Visitor II
June 18, 2020
Solved

Out of Band Pairing

  • June 18, 2020
  • 12 replies
  • 4736 views

Hi,

I have a project where we use the STM32WB55 with the ST25R3911B as NFC module for OOB pairing.

I couldn't find any example for OOB pairing flow.

My start point is the p2p_server example and I can see there are:

  • BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data
  • BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present

which I assume are relevant for my cause.

After reading AN5289 I also can tell there are:

  • aci_gap_set_oob_data()
  • aci_gap_get_oob_data() - which in my case always return an array of '0' at the

But I can't figure how to connect the dots. is there any example for OOB?

when I am invoking get oob data as below I always get OOB_Data array of '0', why?

uint8_t Address_Type = 0;

uint8_t Address[6];

// initial value is just for seeing it gets override

uint8_t OOB_Data[16] = { 0x01, 0x02, 0x03 };

uint8_t OOB_Data_Len;

uint8_t getOobDataRes = aci_gap_get_oob_data(0x01, &Address_Type, Address, &OOB_Data_Len, OOB_Data);

If there is no example I would appreciate if you can answer my questions ( a reference to the relevant functions would be awsome! :(

  • when I invoke aci_gap_set_oob_data() what should be the content of OOB_Data argument? I can see it's 16 bytes (which I assume received from outside) but what are thay stand for? is there any standard for it?
  • What is the flow I need to conduct in order to pair a device once I recieved the NDEF via NFC?
  • After the pairing process, If I want them to bond what else is required?
  • After the bonding how can I implement white list such that only the bonded device would be able to connect?

Thanks

    This topic has been closed for replies.
    Best answer by Remi QUINTIN

    a) When I invoke aci_gap_set_oob_data() what should be the content of OOB_Data argument? I can see it's 16 bytes (which I assume received from outside) but what are thay stand for? is there any standard for it?

    The encryption key to send via OOB data is generated by the controller (low layers of the RF stack running on the M0+ core)

    You can get this 16-byte key with the aci_gap_get_oob_data() function. Once you get key, it is up to you to transmit it to the other device over an NFC link.

    On the other device, you should call the aci_gap_set_oob_data() function to set up the encryption key.

    There is also another way to create the key. You can also generate your own key using the EDCH algoritm and set it as OOB data on both sides of the link. In this case, you have to use aci_gap_set_oob_data() on the Central and on the peripheral device.

    See the slide set I joint to this answer.

        

    b) What is the flow I need to conduct in order to pair a device once I recieved the NDEF via NFC?

    Answer is above and in the slide set.

    c) After the pairing process, if I want them to bond what else is required?

    Bonding has to be set as a requirement using the aci_gap_set_auth_requirement() function before any connection is created. Set the bonding parameter to 1 so that the bonding happens with the pairing.

        

    d) After the bonding how can I implement white list such that only the bonded device would be able to connect?

    I do not an example of white list management right now

    For your implementation, I recommend you to have a look at application notes AN5270 and AN5289

    12 replies

    Graduate II
    April 4, 2022

    Hello,

    Yes, I do receive the HCI_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE_SUBEVT_CODE , and able to generate the key and print on terminal, but on the android side, advertising packet doesn't contain the flag for OOB pairing, but rather only Pin based pairing.

    Technical Moderator
    April 5, 2022

    Hello,

    Once you have OOB data, you need to write random and confirm data on NFC shield (like X-NUCLEO-NFC04A1 board). OOB pairing demonstration firmware is available here:

    https://www.st.com/en/embedded-software/stsw-st25dv004.html#overview

    And android application for this demonstration is available here:

    https://www.st.com/en/embedded-software/stsw-st25005.html

    Best Regards