@@ -3225,7 +3225,11 @@ uint8_t btd_device_get_bdaddr_type(struct btd_device *dev)
bool btd_device_is_connected(struct btd_device *dev)
{
- return dev->bredr_state.connected || dev->le_state.connected;
+ if (dev->bredr_state.connected || dev->le_state.connected)
+ return true;
+
+ return find_service_with_state(dev->services,
+ BTD_SERVICE_STATE_CONNECTED);
}
static void clear_temporary_timer(struct btd_device *dev)
@@ -3276,6 +3280,13 @@ static bool device_disappeared(gpointer user_data)
{
struct btd_device *dev = user_data;
+ if (btd_device_is_connected(dev)) {
+ char addr[18];
+ ba2str(&dev->bdaddr, addr);
+ DBG("Device %s is marked as connected", dev->path);
+ return TRUE;
+ }
+
/* If there are services connecting restart the timer to give more time
* for the service to either complete the connection or disconnect.
*/
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> This checks if there is any service connected on device_is_connected since some profiles maybe probed using advertising data which doesn't require a connection. --- src/device.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)