Bluetooth: Move L2CAP connection notification earlier

We need to notify and initialize internal code before going ahead and
notifying external code of a new connection. Also, in principle the
L2ACP APIs for a connection should only be used after L2CAP has been
told the connection exists.

Change-Id: I0c8386b39ca86290da03ed68ad01c007b1c41c10
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2015-06-30 10:23:41 +03:00 committed by Anas Nashif
commit 0fdf33c734

View file

@ -618,12 +618,13 @@ static void le_conn_complete(struct bt_buf *buf)
bt_conn_set_state(conn, BT_CONN_CONNECTED);
bt_l2cap_connected(conn);
if (evt->role == BT_HCI_ROLE_SLAVE) {
bt_l2cap_update_conn_param(conn);
}
bt_connected(conn);
bt_l2cap_connected(conn);
}
static void le_adv_report(struct bt_buf *buf)