Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/7] android: Use 16-bit UUID for SDP search
@ 2014-02-11 18:32 Anderson Lizardo
  2014-02-11 18:32 ` [PATCH BlueZ 2/7] android/tester: Update SDP PDU after UUID change Anderson Lizardo
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Anderson Lizardo @ 2014-02-11 18:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

These UUIDs are assigned by BT-SIG and therefore there is no need to
use full 128-bit UUIDs. This also avoids unnecessary conversion from
string representation.
---
 android/handsfree.c |    3 +--
 android/hidhost.c   |    7 +++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/android/handsfree.c b/android/handsfree.c
index 9482b2e..a869d58 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -34,7 +34,6 @@
 #include "lib/bluetooth.h"
 #include "lib/sdp.h"
 #include "lib/sdp_lib.h"
-#include "lib/uuid.h"
 #include "src/sdp-client.h"
 #include "src/uuid-helper.h"
 #include "src/shared/hfp.h"
@@ -294,7 +293,7 @@ static void handle_connect(const void *buf, uint16_t len)
 
 	device_init(&bdaddr);
 
-	bt_string2uuid(&uuid, HFP_HS_UUID);
+	sdp_uuid16_create(&uuid, HANDSFREE_SVCLASS_ID);
 	if (bt_search_service(&adapter_addr, &device.bdaddr, &uuid,
 					sdp_search_cb, NULL, NULL, 0) < 0) {
 		error("handsfree: SDP search failed");
diff --git a/android/hidhost.c b/android/hidhost.c
index 8bd3455..45fe14f 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -37,7 +37,6 @@
 #include "lib/bluetooth.h"
 #include "lib/sdp.h"
 #include "lib/sdp_lib.h"
-#include "lib/uuid.h"
 #include "src/shared/mgmt.h"
 #include "src/sdp-client.h"
 #include "src/uuid-helper.h"
@@ -751,7 +750,7 @@ static void hid_sdp_did_search_cb(sdp_list_t *recs, int err, gpointer data)
 			dev->version = data->val.uint16;
 	}
 
-	bt_string2uuid(&uuid, HID_UUID);
+	sdp_uuid16_create(&uuid, HID_SVCLASS_ID);
 	if (bt_search_service(&adapter_addr, &dev->dst, &uuid,
 				hid_sdp_search_cb, dev, NULL, 0) < 0) {
 		error("failed to search sdp details");
@@ -792,7 +791,7 @@ static void bt_hid_connect(const void *buf, uint16_t len)
 	ba2str(&dev->dst, addr);
 	DBG("connecting to %s", addr);
 
-	bt_string2uuid(&uuid, PNP_UUID);
+	sdp_uuid16_create(&uuid, PNP_INFO_SVCLASS_ID);
 	if (bt_search_service(&adapter_addr, &dev->dst, &uuid,
 					hid_sdp_did_search_cb, dev, NULL, 0) < 0) {
 		error("Failed to search DeviceID SDP details");
@@ -1293,7 +1292,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
 		dev->ctrl_io = g_io_channel_ref(chan);
 		dev->uhid_fd = -1;
 
-		bt_string2uuid(&uuid, PNP_UUID);
+		sdp_uuid16_create(&uuid, PNP_INFO_SVCLASS_ID);
 		if (bt_search_service(&src, &dev->dst, &uuid,
 					hid_sdp_did_search_cb, dev, NULL, 0) < 0) {
 			error("failed to search did sdp details");
-- 
1.7.9.5


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

end of thread, other threads:[~2014-02-12 12:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 18:32 [PATCH BlueZ 1/7] android: Use 16-bit UUID for SDP search Anderson Lizardo
2014-02-11 18:32 ` [PATCH BlueZ 2/7] android/tester: Update SDP PDU after UUID change Anderson Lizardo
2014-02-11 18:32 ` [PATCH BlueZ 3/7] android/hidhost: Trivial coding style fix Anderson Lizardo
2014-02-11 18:32 ` [PATCH BlueZ 4/7] android/client: Fix set_info command Anderson Lizardo
2014-02-11 18:32 ` [PATCH BlueZ 5/7] android/test-ipc: Fix crash due to invalid ipc_register() parameter Anderson Lizardo
2014-02-11 18:32 ` [PATCH BlueZ 6/7] android: Add assertion for ID parameter in ipc_register/ipc_unregister Anderson Lizardo
2014-02-11 18:32 ` [PATCH BlueZ 7/7] android: Add test-ipc to "make check" Anderson Lizardo
2014-02-12  9:58 ` [PATCH BlueZ 1/7] android: Use 16-bit UUID for SDP search Luiz Augusto von Dentz
2014-02-12 10:59   ` Szymon Janc
2014-02-12 11:28     ` Anderson Lizardo
2014-02-12 12:17       ` Szymon Janc
2014-02-12 11:29     ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox