summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-08-24 14:23:25 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-08-24 14:30:27 -0700
commit73b301372b21d56a6c8902659fbfd1c352ad55de (patch)
tree059529d2e75d702a3e78ab1903e176161c669af3 /src/device.c
parent4760ada065f22604795295d1377e6a50a2d5efac (diff)
downloadbluez-73b301372b21d56a6c8902659fbfd1c352ad55de.tar.gz
device: Fix not setting initiator
This fixes not setting initiator flag properly when MGMT connect event has not been processed yet but ATT is already connected or is in progress.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 698c668b5..44b903335 100644
--- a/src/device.c
+++ b/src/device.c
@@ -301,7 +301,7 @@ static bool get_initiator(struct btd_device *dev)
if (dev->bredr_state.connected)
return dev->bredr_state.initiator;
- return false;
+ return dev->att_io ? true : false;
}
static GSList *find_service_with_profile(GSList *list, struct btd_profile *p)
@@ -5368,6 +5368,9 @@ static void att_connect_cb(GIOChannel *io, GError *gerr, gpointer user_data)
goto done;
}
+ /* Update connected state */
+ device->le_state.connected = true;
+
if (!device_attach_att(device, io))
goto done;