diff options
author | Szymon Janc <ext.szymon.janc@tieto.com> | 2016-10-07 15:00:25 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-10-16 09:00:57 +0300 |
commit | f4c2bdeec4c0e4b86b4a6025796e88a708e06882 (patch) | |
tree | dd39ba61c127fc832dbd8d40ea954d1b9a922889 /net | |
parent | 0817b052031752db383ed2b18bfbe6a4ce62600b (diff) |
Bluetooth: SMP: Fix build without central role support
If BR/EDR is enabled Pairing Request can also be sent without support
for LE central role.
zephyr/net/bluetooth/smp.c:1326:12: warning: 'smp_br_send_pairing_req'
defined but not used [-Wunused-function]
static int smp_br_send_pairing_req(struct bt_conn *conn)
^
net/built-in.o: In function `hci_encrypt_change':
zephyr/net/bluetooth/hci_core.c:2006: undefined reference to
`bt_smp_send_pairing_req'
net/built-in.o: In function `bt_smp_br_connected':
zephyr/net/bluetooth/smp.c:738: undefined reference to
`bt_smp_send_pairing_req'
Change-Id: I1b68d2412b49f02f42aa146a327252ce107523ca
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 2 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 10 | ||||
-rw-r--r-- | net/bluetooth/smp.h | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 0d3cc2a04..c38eda7d6 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2003,7 +2003,7 @@ static void hci_encrypt_change(struct net_buf *buf) /* Start SMP over BR/EDR if we are pairing initiator */ if (atomic_test_bit(conn->flags, BT_CONN_BR_PAIRING_INITIATOR)) { - bt_smp_send_pairing_req(conn); + bt_smp_br_send_pairing_req(conn); } #endif /* CONFIG_BLUETOOTH_SMP */ diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 9297bbcdb..222b3c5c6 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -735,7 +735,7 @@ static void bt_smp_br_connected(struct bt_l2cap_chan *chan) * was connected */ if (atomic_test_bit(smp->flags, SMP_FLAG_BR_INITIATOR)) { - bt_smp_send_pairing_req(chan->conn); + bt_smp_br_send_pairing_req(chan->conn); } } @@ -1323,7 +1323,7 @@ static struct bt_smp_br *smp_br_chan_get(struct bt_conn *conn) return CONTAINER_OF(chan, struct bt_smp_br, chan); } -static int smp_br_send_pairing_req(struct bt_conn *conn) +int bt_smp_br_send_pairing_req(struct bt_conn *conn) { struct bt_smp_pairing *req; struct net_buf *req_buf; @@ -2396,12 +2396,6 @@ int bt_smp_send_pairing_req(struct bt_conn *conn) BT_DBG(""); -#if defined(CONFIG_BLUETOOTH_BREDR) - if (conn->type == BT_CONN_TYPE_BR) { - return smp_br_send_pairing_req(conn); - } -#endif - smp = smp_chan_get(conn); if (!smp) { return -ENOTCONN; diff --git a/net/bluetooth/smp.h b/net/bluetooth/smp.h index ff0dbfefd..00ff553f3 100644 --- a/net/bluetooth/smp.h +++ b/net/bluetooth/smp.h @@ -137,6 +137,8 @@ int bt_smp_send_security_req(struct bt_conn *conn); void bt_smp_update_keys(struct bt_conn *conn); bool bt_smp_get_tk(struct bt_conn *conn, uint8_t *tk); +int bt_smp_br_send_pairing_req(struct bt_conn *conn); + int bt_smp_init(void); int bt_smp_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey); |