Diff between 6ae0891b96df3c3d075c4055e28f2aa2a691dce1 and add3e20aceeffc19819a455a7c1af2d7e41138f4

Changed Files

File Additions Deletions Status
monitor/packet.c +22 -1 modified

Full Patch

diff --git a/monitor/packet.c b/monitor/packet.c
index d9681fe..473ab8d 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -1943,13 +1943,34 @@ static void print_name(const uint8_t *name)
 
 static void print_channel_map(const uint8_t *map)
 {
+	unsigned int count = 0, start = 0;
 	char str[21];
-	int i;
+	int i, n;
 
 	for (i = 0; i < 10; i++)
 		sprintf(str + (i * 2), "%2.2x", map[i]);
 
 	print_field("Channel map: 0x%s", str);
+
+	for (i = 0; i < 10; i++) {
+		for (n = 0; n < 8; n++) {
+			if (map[i] & (1 << n)) {
+				if (count == 0)
+					start = (i * 8) + n;
+				count++;
+				continue;
+			}
+
+			if (count > 1) {
+				print_field("  Channel %u-%u",
+						start, start + count - 1 );
+				count = 0;
+			} else if (count > 0) {
+				print_field("  Channel %u", start);
+				count = 0;
+			}
+		}
+	}
 }
 
 static void print_flush_timeout(uint16_t timeout)