Bluetooth: Refactor bt_conn_add() routine
Renames bt_conn_add() to bt_conn_add_le() to emphasize LE context. Initializes link type to LE in early stage of setting LE connection. Change-Id: Ica88764e1f3aba563ec7edc3b630e5e76ead249f Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
607f7c12cd
commit
96fc48edb3
3 changed files with 7 additions and 7 deletions
|
@ -492,7 +492,7 @@ static void conn_tx_fiber(int arg1, int arg2)
|
|||
bt_conn_unref(conn);
|
||||
}
|
||||
|
||||
struct bt_conn *bt_conn_add(const bt_addr_le_t *peer)
|
||||
struct bt_conn *bt_conn_add_le(const bt_addr_le_t *peer)
|
||||
{
|
||||
struct bt_conn *conn = NULL;
|
||||
int i;
|
||||
|
@ -516,6 +516,7 @@ struct bt_conn *bt_conn_add(const bt_addr_le_t *peer)
|
|||
conn->sec_level = BT_SECURITY_LOW;
|
||||
conn->required_sec_level = BT_SECURITY_LOW;
|
||||
#endif /* CONFIG_BLUETOOTH_SMP */
|
||||
conn->type = BT_CONN_TYPE_LE;
|
||||
|
||||
return conn;
|
||||
}
|
||||
|
@ -549,7 +550,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state)
|
|||
switch (old_state) {
|
||||
case BT_CONN_DISCONNECTED:
|
||||
/* Take a reference for the first state transition after
|
||||
* bt_conn_add() and keep it until reaching DISCONNECTED
|
||||
* bt_conn_add_le() and keep it until reaching DISCONNECTED
|
||||
* again.
|
||||
*/
|
||||
bt_conn_ref(conn);
|
||||
|
@ -796,7 +797,7 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer)
|
|||
}
|
||||
}
|
||||
|
||||
conn = bt_conn_add(peer);
|
||||
conn = bt_conn_add_le(peer);
|
||||
if (!conn) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue