Bluetooth LE OOB Pairing

Hello everyone, 

I am developing a project where I need to perform bluetooth OOB pairing using an NFC reader. I have a couple questions about this.

The first is, what options do I need to enable in proj.conf to enbale LE Secure Connections OOB pairing? I know for this method, according to Bluetooth Spec and NDEF forum the mandatory fields should be: Role, Address, Confirmation and Random values (16-byte). I have checked some options like: "BT_SMP_SC_ONLY", "BT_SMP_SC_PAIR_ONLY" and  "BT_OOB_DATA_FIXED", but I am confused about which should I set.

Then, I am getting the Address, Random and Confirm values from this function:

 bt_le_oob oob_data;
 rc = bt_le_oob_get_local(0, &oob_data);

Where, the oob_data structure has a structure with the address and type, as well as a bt_le_oob_sc_data structure with the 2 16-byte arrays (R and C). Is this correct or should I use some elyptic curve function to generate these values?

Finnaly, I have set the board to advertise and have set these connection and pairing callbacks:

 conn_callbacks = { 
        .connected = BluetoothConnected, 
        .disconnected = BluetoothDisconnected, 
        .security_changed = SecurityChanged 
    };

    bt_conn_auth_info = { 
        .pairing_complete = BluetoothPairingCompleted, 
        .pairing_failed = BluetoothPairingFailed 
    };

    auth_cb_display = {
        .passkey_display = AuthPasskeyDisplay,
        .passkey_confirm = AuthPasskeyConfirm,
        .cancel = AuthCancel
    };


Is this correct or do I need anything else?

Best regards.

Related