Diff between f3d3c663201bd2ffc3f75d6cf57bc4ff3542b8ed and eabd380979b0c58540fddc59e3b6772ed1a40da3

Changed Files

File Additions Deletions Status
monitor/ll.c +2 -1 modified
monitor/packet.c +40 -4 modified
monitor/packet.h +2 -1 modified

Full Patch

diff --git a/monitor/ll.c b/monitor/ll.c
index b23de3c..e8b7a7a 100644
--- a/monitor/ll.c
+++ b/monitor/ll.c
@@ -448,7 +448,8 @@ static void version_ind(const void *data, uint8_t size)
 {
 	const struct bt_ll_version_ind *pdu = data;
 
-	packet_print_version("Version", pdu->version, btohs(pdu->subversion));
+	packet_print_version("Version", pdu->version,
+				"Subversion", btohs(pdu->subversion));
 	packet_print_company("Company", btohs(pdu->company));
 }
 
diff --git a/monitor/packet.c b/monitor/packet.c
index ddd3742..849b023 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -1495,19 +1495,55 @@ static void print_channel_map(const uint8_t *map)
 	print_field("Channel map: 0x%s", str);
 }
 
-void packet_print_version(const char *label, uint8_t version, uint16_t revision)
+void packet_print_version(const char *label, uint8_t version,
+				const char *sublabel, uint16_t subversion)
 {
-	print_field("%s: %d - 0x%4.4x", label, version, revision);
+	const char *str;
+
+	switch (version) {
+	case 0x00:
+		str = "Bluetooth 1.0b";
+		break;
+	case 0x01:
+		str = "Bluetooth 1.1";
+		break;
+	case 0x02:
+		str = "Bluetooth 1.2";
+		break;
+	case 0x03:
+		str = "Bluetooth 2.0";
+		break;
+	case 0x04:
+		str = "Bluetooth 2.1";
+		break;
+	case 0x05:
+		str = "Bluetooth 3.0";
+		break;
+	case 0x06:
+		str = "Bluetooth 4.0";
+		break;
+	case 0x07:
+		str = "Bluetooth 4.1";
+		break;
+	default:
+		str = "Reserved";
+		break;
+	}
+
+	print_field("%s: %s (0x%2.2x) - %s %d (0x%4.4x)", label, str, version,
+					sublabel, subversion, subversion);
 }
 
 static void print_hci_version(uint8_t hci_ver, uint16_t hci_rev)
 {
-	packet_print_version("HCI version", hci_ver, btohs(hci_rev));
+	packet_print_version("HCI version", hci_ver,
+				"Revision", btohs(hci_rev));
 }
 
 static void print_lmp_version(uint8_t lmp_ver, uint16_t lmp_subver)
 {
-	packet_print_version("LMP version", lmp_ver, btohs(lmp_subver));
+	packet_print_version("LMP version", lmp_ver,
+				"Subversion", btohs(lmp_subver));
 }
 
 void packet_print_company(const char *label, uint16_t company)
diff --git a/monitor/packet.h b/monitor/packet.h
index 411983a..07c1ec3 100644
--- a/monitor/packet.h
+++ b/monitor/packet.h
@@ -40,7 +40,8 @@ void packet_del_filter(unsigned long filter);
 void packet_select_index(uint16_t index);
 
 void packet_hexdump(const unsigned char *buf, uint16_t len);
-void packet_print_version(const char *label, uint8_t version, uint16_t revision);
+void packet_print_version(const char *label, uint8_t version,
+				const char *sublabel, uint16_t subversion);
 void packet_print_company(const char *label, uint16_t company);
 void packet_print_addr(const char *label, const void *data, bool random);
 void packet_print_ad(const void *data, uint8_t size);