Skip to contentSkip to conversation

Fix creating device object when connection fails

PATCH Superseded Luiz Augusto von Dentz 1 participant 2 messages Jan 31, 2011 Bluetooth drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 Fix creating device object when connection fails

From: Luiz Augusto von Dentz <[email protected]>

There is no need to create a new object since there is no connection and the device is not permanent/paired.

---
 src/event.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
src/event.c +3 -1
index ff768c0..166e401 100644
@@ -676,7 +676,9 @@ void btd_event_conn_failed(bdaddr_t *local, bdaddr_t *peer, uint8_t status)
 	struct btd_device *device;
 	DBusConnection *conn = get_dbus_connection();
 
-	if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
+	DBG("");
+
+	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
 		return;
 
 	if (device_is_temporary(device))
Signature · 1 line
1.7.1
author maintainer
#1 lore raw

PATCH 2/2 Fix creating device object when device disconnects

From: Luiz Augusto von Dentz <[email protected]>

If object doesn't exist the device is not permanent so there is no need to create a new object just to handle disconnect event.

---
 src/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/event.c +1 -1
index 166e401..5060e84 100644
@@ -692,7 +692,7 @@ void btd_event_disconn_complete(bdaddr_t *local, bdaddr_t *peer)
 
 	DBG("");
 
-	if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
+	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
 		return;
 
 	adapter_remove_connection(adapter, device);
Signature · 1 line
1.7.1