[PATCH 12/13] device: Add device_discover_services function

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

 



This will allow to query remote services from plugins for not yet
discovered devices.
---
 src/device.c | 17 +++++++++++++++++
 src/device.h |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/src/device.c b/src/device.c
index 4e952c5..847ffad 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3524,6 +3524,23 @@ static int device_browse_sdp(struct btd_device *device, DBusMessage *msg)
 	return err;
 }
 
+int device_discover_services(struct btd_device *device)
+{
+	int err;
+
+	if (device_is_bredr(device))
+		err = device_browse_sdp(device, NULL);
+	else
+		err = device_browse_primary(device, NULL);
+
+	if (err == 0 && device->discov_timer) {
+		g_source_remove(device->discov_timer);
+		device->discov_timer = 0;
+	}
+
+	return err;
+}
+
 struct btd_adapter *device_get_adapter(struct btd_device *device)
 {
 	if (!device)
diff --git a/src/device.h b/src/device.h
index a0d25fe..c3fea4a 100644
--- a/src/device.h
+++ b/src/device.h
@@ -131,5 +131,7 @@ bool device_remove_svc_complete_callback(struct btd_device *dev,
 struct btd_service *btd_device_get_service(struct btd_device *dev,
 						const char *remote_uuid);
 
+int device_discover_services(struct btd_device *device);
+
 void btd_device_init(void);
 void btd_device_cleanup(void);
-- 
1.8.4.4

--
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