All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Iñaki Arenaza" <iarenaza@mondragon.edu>
To: linux-bluetooth@vger.kernel.org
Cc: "Iñaki Arenaza" <iarenaza@mondragon.edu>
Subject: [PATCH v2 1/1] device: Some devices send HSP UUIDs in the wrong order
Date: Sun, 19 Jul 2015 16:57:28 +0200	[thread overview]
Message-ID: <1437317848-29508-2-git-send-email-iarenaza@mondragon.edu> (raw)
In-Reply-To: <1436823169-32164-1-git-send-email-iarenaza@mondragon.edu>

Some devices behave contrary to what Erratum #3507 [1] says for the
v1.2 Headset Profile (HSP). They report HEADSET_HS_UUID as the first
value of the ServiceClassIDList attribute, and HSP_HS_UUID as the
second one. At leat one of those devices is the Energy Wireles BT 3
Ruby Red (from Energy Sistem).

[1] See section 6.15 of
https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=231555
---
 lib/uuid.h   |  1 +
 src/device.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/uuid.h b/lib/uuid.h
index 2dcfe9e..c2e12bb 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -35,6 +35,7 @@ extern "C" {
 
 #define HSP_HS_UUID		"00001108-0000-1000-8000-00805f9b34fb"
 #define HSP_AG_UUID		"00001112-0000-1000-8000-00805f9b34fb"
+#define HEADSET_HS_UUID		"00001131-0000-1000-8000-00805f9b34fb"
 
 #define HFP_HS_UUID		"0000111e-0000-1000-8000-00805f9b34fb"
 #define HFP_AG_UUID		"0000111f-0000-1000-8000-00805f9b34fb"
diff --git a/src/device.c b/src/device.c
index debe201..ced59e4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3880,6 +3880,18 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs)
 			continue;
 		}
 
+		/* Fix devices that report HEADSET_HS_UUID before HSP_HS_UUID,
+		 * contrary to what Erratum #3507 says.
+		 */
+		if ((bt_uuid_strcmp(profile_uuid, HEADSET_HS_UUID) == 0)) {
+			free(profile_uuid);
+			profile_uuid = g_strdup(HSP_HS_UUID);
+			if (!profile_uuid) {
+				sdp_list_free(svcclass, free);
+				continue;
+			}
+		}
+
 		if (bt_uuid_strcmp(profile_uuid, PNP_UUID) == 0) {
 			uint16_t source, vendor, product, version;
 			sdp_data_t *pdlist;
-- 
2.1.4


      parent reply	other threads:[~2015-07-19 14:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13 21:32 [PATCH 0/1] device: Some devices send HSP UUIDs in the wrong order Iñaki Arenaza
2015-07-13 21:32 ` [PATCH 1/1] " Iñaki Arenaza
2015-07-14 12:17   ` Luiz Augusto von Dentz
2015-07-14 12:28     ` Iñaki Arenaza
2015-07-19 14:55 ` [PATCH v2 0/1] " Iñaki Arenaza
2015-07-19 14:57 ` Iñaki Arenaza [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437317848-29508-2-git-send-email-iarenaza@mondragon.edu \
    --to=iarenaza@mondragon.edu \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.