Diff between 2a5f534226961852c3c1d1479fc7e3a751fe715f and d2920be715974795b51f9cc3279947104da3647b

Changed Files

File Additions Deletions Status
src/device.c +7 -2 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index 46f26d1..c7c741c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1933,7 +1933,9 @@ int device_browse_primary(struct btd_device *device, DBusConnection *conn,
 		return -EIO;
 	}
 
-	req->conn = dbus_connection_ref(conn);
+	if (conn)
+		req->conn = dbus_connection_ref(conn);
+
 	device->browse = req;
 
 	if (msg) {
@@ -2118,7 +2120,10 @@ static gboolean start_discovery(gpointer user_data)
 {
 	struct btd_device *device = user_data;
 
-	device_browse_sdp(device, NULL, NULL, NULL, TRUE);
+	if (device_is_bredr(device))
+		device_browse_sdp(device, NULL, NULL, NULL, FALSE);
+	else
+		device_browse_primary(device, NULL, NULL, FALSE);
 
 	device->discov_timer = 0;