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)
diff --git a/monitor/packet.c b/monitor/packet.c
index c8796cf..f5d6f96 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -3393,16 +3393,18 @@
{
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);
}
}