All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/4] btmon: Add proper decoding to Service Data UUID
@ 2022-04-26 23:03 Luiz Augusto von Dentz
  2022-04-26 23:03 ` [PATCH BlueZ 2/4] btmon: Add support for decoding Broadcast Audio Annoucements Luiz Augusto von Dentz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2022-04-26 23:03 UTC (permalink / raw)
  To: linux-bluetooth

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

This adds proper decoding for Service Data UUID:

        Service Data: Apple, Inc. (0xfd6f)
          Data: e6b07e19815e902100b8b2f4a55255fd18f0c6be
---
 monitor/packet.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index 6ef2fba3b..471b0dd4d 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -3301,6 +3301,14 @@ static void print_uuid128_list(const char *label, const void *data,
 	}
 }
 
+static void print_service_data(const uint8_t *data, uint8_t data_len)
+{
+	uint16_t uuid = get_le16(&data[0]);
+
+	print_field("Service Data: %s (0x%4.4x)", bt_uuid16_to_str(uuid), uuid);
+	print_hex_field("  Data", &data[2], data_len - 2);
+}
+
 static const struct bitfield_data eir_flags_table[] = {
 	{ 0, "LE Limited Discoverable Mode"		},
 	{ 1, "LE General Discoverable Mode"		},
@@ -3703,9 +3711,7 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le)
 		case BT_EIR_SERVICE_DATA:
 			if (data_len < 2)
 				break;
-			sprintf(label, "Service Data (UUID 0x%4.4x)",
-							get_le16(&data[0]));
-			print_hex_field(label, &data[2], data_len - 2);
+			print_service_data(data, data_len);
 			break;
 
 		case BT_EIR_RANDOM_ADDRESS:
-- 
2.35.1


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

end of thread, other threads:[~2022-04-28 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26 23:03 [PATCH BlueZ 1/4] btmon: Add proper decoding to Service Data UUID Luiz Augusto von Dentz
2022-04-26 23:03 ` [PATCH BlueZ 2/4] btmon: Add support for decoding Broadcast Audio Annoucements Luiz Augusto von Dentz
2022-04-26 23:03 ` [PATCH BlueZ 3/4] btmon: Add support for decoding Basic " Luiz Augusto von Dentz
2022-04-26 23:03 ` [PATCH BlueZ 4/4] btmon: Fix not decoding LC3 id Luiz Augusto von Dentz
2022-04-27  2:18 ` [BlueZ,1/4] btmon: Add proper decoding to Service Data UUID bluez.test.bot
2022-04-28 22:30 ` [PATCH BlueZ 1/4] " patchwork-bot+bluetooth

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.