linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] device: Fix doing sdp discovery for LE devices
@ 2012-02-03 23:06 Vinicius Costa Gomes
  2012-02-03 23:17 ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Vinicius Costa Gomes @ 2012-02-03 23:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-04 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03 23:06 [PATCH BlueZ] device: Fix doing sdp discovery for LE devices Vinicius Costa Gomes
2012-02-03 23:17 ` Johan Hedberg
2012-02-04 12:14   ` Anderson Lizardo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).