[PATCH BlueZ] device: Fix doing sdp discovery for LE devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If ReverseServiceDiscovery is enabled and we are connected to a LE
device, we should do a Primary Service Discovery, not a SDP discovery
(which doesn't even make sense).
---

This patch assumes that it makes sense to reuse the ReverseServiceDiscovery
functionality for LE devices.


 src/device.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

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;

--
1.7.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux