Skip to content
Permalink
Browse files

Bluetooth: smp: adding LE SC OOB support for peripheral side

Added support for the LE SC pairing with the OOB data. The peripheral
side is only supported for now.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
  • Loading branch information...
kapi-no authored and carlescufi committed Mar 12, 2019
1 parent edea2f0 commit e4409d5d7dc57e38f481050cf988994a79c401dd
Showing with 304 additions and 25 deletions.
  1. +9 −0 subsys/bluetooth/host/Kconfig
  2. +26 −2 subsys/bluetooth/host/hci_core.c
  3. +260 −23 subsys/bluetooth/host/smp.c
  4. +9 −0 subsys/bluetooth/host/smp.h
@@ -311,6 +311,15 @@ config BT_BONDABLE
Bonding flag in AuthReq of SMP Pairing Request/Response will be set
indicating the support for this mode.

config BT_OOB_DATA_FIXED
bool "Use a fixed random number for LESC OOB pairing"
depends on BT_TESTING
help
With this option enabled, the application will be able to perform LESC
pairing with OOB data that consists of fixed random number and confirm
value. This option should only be enabled for debugging and should
never be used in production.

endif # BT_SMP

config BT_L2CAP_DYNAMIC_CHANNEL
@@ -5944,13 +5944,13 @@ int bt_br_oob_get_local(struct bt_br_oob *oob)

int bt_le_oob_get_local(u8_t id, struct bt_le_oob *oob)
{
int err;

if (id >= CONFIG_BT_ID_MAX) {
return -EINVAL;
}

if (IS_ENABLED(CONFIG_BT_PRIVACY)) {
int err;

/* Invalidate RPA so a new one is generated */
atomic_clear_bit(bt_dev.flags, BT_DEV_RPA_VALID);

@@ -5964,5 +5964,29 @@ int bt_le_oob_get_local(u8_t id, struct bt_le_oob *oob)
bt_addr_le_copy(&oob->addr, &bt_dev.id_addr[id]);
}


if (IS_ENABLED(CONFIG_BT_SMP)) {
err = bt_smp_le_oob_generate_sc_data(&oob->le_sc_data);
if (err) {
return err;
}
}

return 0;
}

#if defined(CONFIG_BT_SMP)
int bt_le_oob_set_sc_data(struct bt_conn *conn,
const struct bt_le_oob_sc_data *oobd_local,
const struct bt_le_oob_sc_data *oobd_remote)
{
return bt_smp_le_oob_set_sc_data(conn, oobd_local, oobd_remote);
}

int bt_le_oob_get_sc_data(struct bt_conn *conn,
const struct bt_le_oob_sc_data **oobd_local,
const struct bt_le_oob_sc_data **oobd_remote)
{
return bt_smp_le_oob_get_sc_data(conn, oobd_local, oobd_remote);
}
#endif

0 comments on commit e4409d5

Please sign in to comment.
You can’t perform that action at this time.