From 3aa056ca200dddc725d9e8ca5666ba229025d5aa Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 15 Sep 2016 15:50:48 +0300 Subject: [PATCH] monitor: Print friendly name of UUID 128 bits This makes btmon print friendly names for UUID 128 bits if they exists: > HCI Event: LE Meta Event (0x3e) plen 33 LE Advertising Report (0x02) Num reports: 1 Event type: Connectable undirected - ADV_IND (0x00) Address type: Public (0x00) Address: 00:1B:DC:07:31:88 (Vencer Co., Ltd.) Data length: 21 Flags: 0x06 LE General Discoverable Mode BR/EDR Not Supported 128-bit Service UUIDs (complete): 1 entry Eddystone Configuration Service (a3c87500-8ed3-4bdf-8a39-a01bebede295) RSSI: -30 dBm (0xe2) --- monitor/packet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index c8796cf0f..f5d6f9645 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3393,16 +3393,18 @@ 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); - print_field(" %8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", + 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)", uuidstr_to_str(uuidstr), uuidstr); } } -- 2.47.3