From: Francois Beaufort <beaufort.francois@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] Recognize Eddystone Configuration Service UUIDs
Date: Wed, 20 Apr 2016 15:04:19 +0200	[thread overview]
Message-ID: <1461157459-26309-2-git-send-email-beaufort.francois@gmail.com> (raw)
In-Reply-To: <1461157459-26309-1-git-send-email-beaufort.francois@gmail.com>
---
 monitor/uuid.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/monitor/uuid.c b/monitor/uuid.c
index 54adb0d..deaf14f 100644
--- a/monitor/uuid.c
+++ b/monitor/uuid.c
@@ -31,7 +31,7 @@
 
 #include "uuid.h"
 
-static struct {
+static const struct {
 	uint16_t uuid;
 	const char *str;
 } uuid16_table[] = {
@@ -540,6 +540,26 @@ static struct {
 	{ }
 };
 
+static const struct {
+	const char *uuid;
+	const char *str;
+} uuid128_table[] = {
+	{ "a3c87500-8ed3-4bdf-8a39-a01bebede295", "Eddystone Configuration Service"	},
+	{ "a3c87501-8ed3-4bdf-8a39-a01bebede295", "Capabilities"			},
+	{ "a3c87502-8ed3-4bdf-8a39-a01bebede295", "Active Slot"				},
+	{ "a3c87503-8ed3-4bdf-8a39-a01bebede295", "Advertising Interval"		},
+	{ "a3c87504-8ed3-4bdf-8a39-a01bebede295", "Radio Tx Power"			},
+	{ "a3c87505-8ed3-4bdf-8a39-a01bebede295", "(Advanced) Advertised Tx Power"	},
+	{ "a3c87506-8ed3-4bdf-8a39-a01bebede295", "Lock State"				},
+	{ "a3c87507-8ed3-4bdf-8a39-a01bebede295", "Unlock"				},
+	{ "a3c87508-8ed3-4bdf-8a39-a01bebede295", "Public ECDH Key"			},
+	{ "a3c87509-8ed3-4bdf-8a39-a01bebede295", "EID Identity Key"			},
+	{ "a3c8750a-8ed3-4bdf-8a39-a01bebede295", "ADV Slot Data"			},
+	{ "a3c8750b-8ed3-4bdf-8a39-a01bebede295", "(Advanced) Factory reset"		},
+	{ "a3c8750c-8ed3-4bdf-8a39-a01bebede295", "(Advanced) Remain Connectable"	},
+	{ }
+};
+
 const char *uuid16_to_str(uint16_t uuid)
 {
 	int i;
@@ -568,6 +588,7 @@ const char *uuid128_to_str(const unsigned char *uuid)
 const char *uuidstr_to_str(const char *uuid)
 {
 	uint32_t val;
+	int i;
 
 	if (!uuid)
 		return NULL;
@@ -575,6 +596,11 @@ const char *uuidstr_to_str(const char *uuid)
 	if (strlen(uuid) != 36)
 		return NULL;
 
+	for (i = 0; uuid128_table[i].str; i++) {
+		if (strcasecmp(uuid128_table[i].uuid, uuid) == 0)
+			return uuid128_table[i].str;
+	}
+
 	if (strncasecmp(uuid + 8, "-0000-1000-8000-00805f9b34fb", 28))
 		return "Vendor specific";
 
-- 
2.7.0
next prev parent reply	other threads:[~2016-04-20 13:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 13:04 [PATCH BlueZ] Recognize Eddystone Configuration Service UUIDs Francois Beaufort
2016-04-20 13:04 ` Francois Beaufort [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-26  8:30 [PATCH BlueZ] FIx select-attribute behaviour Francois Beaufort
2016-04-26  8:30 ` [PATCH BlueZ] Recognize Eddystone Configuration Service UUIDs Francois Beaufort
2016-04-22 14:20 Francois Beaufort
2016-04-22 14:20 ` Francois Beaufort
2016-04-25  9:03   ` Luiz Augusto von Dentz
2016-04-20  9:16 [PATCH BlueZ] Add Eddystone GATT Config Service to known UUIDs Francois Beaufort
2016-04-20  9:16 ` [PATCH BlueZ] Recognize Eddystone Configuration Service UUIDs Francois Beaufort
2016-04-20 12:45   ` Marcel Holtmann
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=1461157459-26309-2-git-send-email-beaufort.francois@gmail.com \
    --to=beaufort.francois@gmail.com \
    --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 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).