All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] shared/util: Add bt_uuid128_to_str
@ 2021-05-18 18:39 Luiz Augusto von Dentz
  2021-05-18 18:39 ` [PATCH BlueZ 2/3] shared/util: Decode BlueZ experimental UUIDs Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-05-18 18:39 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds bt_uuid128_to_str which can be used to convert UUID 128 bit
binary format into string.
---
 src/shared/util.c | 12 ++++++++++++
 src/shared/util.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/src/shared/util.c b/src/shared/util.c
index 9c2054211..7fb1c01dc 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1042,6 +1042,18 @@ const char *bt_uuid32_to_str(uint32_t uuid)
 	return "Unknown";
 }
 
+const char *bt_uuid128_to_str(const uint8_t uuid[16])
+{
+	char uuidstr[37];
+
+	sprintf(uuidstr, "%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x",
+				get_le32(&uuid[12]), get_le16(&uuid[10]),
+				get_le16(&uuid[8]), get_le16(&uuid[6]),
+				get_le32(&uuid[2]), get_le16(&uuid[0]));
+
+	return bt_uuidstr_to_str(uuidstr);
+}
+
 const char *bt_uuidstr_to_str(const char *uuid)
 {
 	uint32_t val;
diff --git a/src/shared/util.h b/src/shared/util.h
index d6de55885..9920b7f76 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -107,6 +107,7 @@ void util_clear_uid(unsigned int *bitmap, uint8_t id);
 
 const char *bt_uuid16_to_str(uint16_t uuid);
 const char *bt_uuid32_to_str(uint32_t uuid);
+const char *bt_uuid128_to_str(const uint8_t uuid[16]);
 const char *bt_uuidstr_to_str(const char *uuid);
 const char *bt_appear_to_str(uint16_t appearance);
 
-- 
2.30.2


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

* [PATCH BlueZ 2/3] shared/util: Decode BlueZ experimental UUIDs
  2021-05-18 18:39 [PATCH BlueZ 1/3] shared/util: Add bt_uuid128_to_str Luiz Augusto von Dentz
@ 2021-05-18 18:39 ` Luiz Augusto von Dentz
  2021-05-18 18:39 ` [PATCH BlueZ 3/3] btmon: Use bt_uuid128_to_str when printing UUIDs of 128 bits Luiz Augusto von Dentz
  2021-05-18 19:04 ` [BlueZ,1/3] shared/util: Add bt_uuid128_to_str bluez.test.bot
  2 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-05-18 18:39 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds BlueZ experimental UUIDs to uuid128_table so they are
decoded by the likes of btmon.
---
 src/shared/util.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/shared/util.c b/src/shared/util.c
index 7fb1c01dc..8c216f936 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1019,6 +1019,12 @@ static const struct {
 	{ "6e400001-b5a3-f393-e0a9-e50e24dcca9e", "Nordic UART Service" },
 	{ "6e400002-b5a3-f393-e0a9-e50e24dcca9e", "Nordic UART TX"	},
 	{ "6e400003-b5a3-f393-e0a9-e50e24dcca9e", "Nordic UART RX"	},
+	/* BlueZ Experimental Features */
+	{ "d4992530-b9ec-469f-ab01-6c481c47da1c", "BlueZ Experimental Debug" },
+	{ "671b10b5-42c0-4696-9227-eb28d1b049d6",
+		"BlueZ Experimental Simultaneous Central and Peripheral" },
+	{ "15c0a148-c273-11ea-b3de-0242ac130004",
+		"BlueZ Experimental LL privacy" },
 	{ }
 };
 
-- 
2.30.2


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

* [PATCH BlueZ 3/3] btmon: Use bt_uuid128_to_str when printing UUIDs of 128 bits
  2021-05-18 18:39 [PATCH BlueZ 1/3] shared/util: Add bt_uuid128_to_str Luiz Augusto von Dentz
  2021-05-18 18:39 ` [PATCH BlueZ 2/3] shared/util: Decode BlueZ experimental UUIDs Luiz Augusto von Dentz
@ 2021-05-18 18:39 ` Luiz Augusto von Dentz
  2021-05-18 19:04 ` [BlueZ,1/3] shared/util: Add bt_uuid128_to_str bluez.test.bot
  2 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-05-18 18:39 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This ensures that know UUIDs names are printed including those used by
experimental features.
---
 monitor/packet.c | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index d729a01cc..82513a63c 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -3282,18 +3282,13 @@ static void print_uuid128_list(const char *label, const void *data,
 {
 	uint8_t count = data_len / 16;
 	unsigned int i;
-	char uuidstr[MAX_LEN_UUID_STR];
 
 	print_field("%s: %u entr%s", label, count, count == 1 ? "y" : "ies");
 
 	for (i = 0; i < count; i++) {
 		const uint8_t *uuid = data + (i * 16);
 
-		sprintf(uuidstr, "%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x",
-				get_le32(&uuid[12]), get_le16(&uuid[10]),
-				get_le16(&uuid[8]), get_le16(&uuid[6]),
-				get_le32(&uuid[2]), get_le16(&uuid[0]));
-		print_field("  %s (%s)", bt_uuidstr_to_str(uuidstr), uuidstr);
+		print_field("  %s", bt_uuid128_to_str(uuid));
 	}
 }
 
@@ -12006,16 +12001,6 @@ static void mgmt_print_name(const void *data)
 	print_field("Short name: %s", (char *) (data + 249));
 }
 
-static void mgmt_print_uuid(const void *data)
-{
-	const uint8_t *uuid = data;
-
-	print_field("UUID: %8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x",
-				get_le32(&uuid[12]), get_le16(&uuid[10]),
-				get_le16(&uuid[8]), get_le16(&uuid[6]),
-				get_le32(&uuid[2]), get_le16(&uuid[0]));
-}
-
 static void mgmt_print_io_capability(uint8_t capability)
 {
 	const char *str;
@@ -12261,7 +12246,7 @@ static void mgmt_print_exp_feature(const void *data)
 	uint32_t flags = get_le32(data + 16);
 	uint32_t mask;
 
-	mgmt_print_uuid(data);
+	print_field("UUID: %s", bt_uuid128_to_str(data));
 	print_field("Flags: 0x%8.8x", flags);
 
 	mask = print_bitfield(2, flags, mgmt_exp_feature_flags_table);
@@ -12457,7 +12442,7 @@ static void mgmt_add_uuid_cmd(const void *data, uint16_t size)
 {
 	uint8_t service_class = get_u8(data + 16);
 
-	mgmt_print_uuid(data);
+	print_field("UUID: %s", bt_uuid128_to_str(data));
 	print_field("Service class: 0x%2.2x", service_class);
 }
 
@@ -12468,7 +12453,7 @@ static void mgmt_add_uuid_rsp(const void *data, uint16_t size)
 
 static void mgmt_remove_uuid_cmd(const void *data, uint16_t size)
 {
-	mgmt_print_uuid(data);
+	print_field("UUID: %s", bt_uuid128_to_str(data));
 }
 
 static void mgmt_remove_uuid_rsp(const void *data, uint16_t size)
@@ -13092,7 +13077,7 @@ static void mgmt_start_service_discovery_cmd(const void *data, uint16_t size)
 	}
 
 	for (i = 0; i < num_uuids; i++)
-		mgmt_print_uuid(data + 4 + (i * 16));
+		print_field("UUID: %s", bt_uuid128_to_str(data + 4 + (i * 16)));
 }
 
 static void mgmt_start_service_discovery_rsp(const void *data, uint16_t size)
@@ -13352,7 +13337,7 @@ static void mgmt_set_exp_feature_cmd(const void *data, uint16_t size)
 {
 	uint8_t enable = get_u8(data + 16);
 
-	mgmt_print_uuid(data);
+	print_field("UUID: %s", bt_uuid128_to_str(data));
 	print_enable("Action", enable);
 }
 
-- 
2.30.2


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

* RE: [BlueZ,1/3] shared/util: Add bt_uuid128_to_str
  2021-05-18 18:39 [PATCH BlueZ 1/3] shared/util: Add bt_uuid128_to_str Luiz Augusto von Dentz
  2021-05-18 18:39 ` [PATCH BlueZ 2/3] shared/util: Decode BlueZ experimental UUIDs Luiz Augusto von Dentz
  2021-05-18 18:39 ` [PATCH BlueZ 3/3] btmon: Use bt_uuid128_to_str when printing UUIDs of 128 bits Luiz Augusto von Dentz
@ 2021-05-18 19:04 ` bluez.test.bot
  2021-05-19 18:01   ` Luiz Augusto von Dentz
  2 siblings, 1 reply; 5+ messages in thread
From: bluez.test.bot @ 2021-05-18 19:04 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=484525

---Test result---

Test Summary:
CheckPatch                    PASS      1.16 seconds
GitLint                       PASS      0.40 seconds
Prep - Setup ELL              PASS      51.17 seconds
Build - Prep                  PASS      0.11 seconds
Build - Configure             PASS      9.04 seconds
Build - Make                  PASS      217.20 seconds
Make Check                    PASS      9.63 seconds
Make Distcheck                PASS      256.57 seconds
Build w/ext ELL - Configure   PASS      9.17 seconds
Build w/ext ELL - Make        PASS      204.36 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth


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

* Re: [BlueZ,1/3] shared/util: Add bt_uuid128_to_str
  2021-05-18 19:04 ` [BlueZ,1/3] shared/util: Add bt_uuid128_to_str bluez.test.bot
@ 2021-05-19 18:01   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-05-19 18:01 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

On Tue, May 18, 2021 at 12:04 PM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=484525
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      1.16 seconds
> GitLint                       PASS      0.40 seconds
> Prep - Setup ELL              PASS      51.17 seconds
> Build - Prep                  PASS      0.11 seconds
> Build - Configure             PASS      9.04 seconds
> Build - Make                  PASS      217.20 seconds
> Make Check                    PASS      9.63 seconds
> Make Distcheck                PASS      256.57 seconds
> Build w/ext ELL - Configure   PASS      9.17 seconds
> Build w/ext ELL - Make        PASS      204.36 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Distcheck - PASS
> Desc: Run distcheck to check the distribution
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Pushed.

-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2021-05-19 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 18:39 [PATCH BlueZ 1/3] shared/util: Add bt_uuid128_to_str Luiz Augusto von Dentz
2021-05-18 18:39 ` [PATCH BlueZ 2/3] shared/util: Decode BlueZ experimental UUIDs Luiz Augusto von Dentz
2021-05-18 18:39 ` [PATCH BlueZ 3/3] btmon: Use bt_uuid128_to_str when printing UUIDs of 128 bits Luiz Augusto von Dentz
2021-05-18 19:04 ` [BlueZ,1/3] shared/util: Add bt_uuid128_to_str bluez.test.bot
2021-05-19 18:01   ` Luiz Augusto von Dentz

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.