From 6bb75a53d12d3c7afd9dad628dfab40a2d79a089 Mon Sep 17 00:00:00 2001 From: Kamil Piszczek Date: Mon, 18 Feb 2019 09:03:33 +0100 Subject: [PATCH] Bluetooth: gatt: ccc changed cb after connection cb Changed the order of Bluetooth callbacks. Now the connected callback is received before CCC changed callbacks. Signed-off-by: Kamil Piszczek --- subsys/bluetooth/host/att.c | 2 -- subsys/bluetooth/host/conn.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 3246bce7d90..581541297e5 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -2080,8 +2080,6 @@ static void bt_att_connected(struct bt_l2cap_chan *chan) k_delayed_work_init(&att->timeout_work, att_timeout); sys_slist_init(&att->reqs); - - bt_gatt_connected(ch->chan.conn); } static void bt_att_disconnected(struct bt_l2cap_chan *chan) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 33613ee7bf7..5c878f27f58 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -33,6 +33,7 @@ #include "keys.h" #include "smp.h" #include "att_internal.h" +#include "gatt_internal.h" NET_BUF_POOL_DEFINE(acl_tx_pool, CONFIG_BT_L2CAP_TX_BUF_COUNT, BT_L2CAP_BUF_SIZE(CONFIG_BT_L2CAP_TX_MTU), @@ -136,6 +137,8 @@ static void notify_connected(struct bt_conn *conn) cb->connected(conn, conn->err); } } + + bt_gatt_connected(conn); } static void notify_disconnected(struct bt_conn *conn)