From 48a14ab697d4bcb6a4546911b735ec8c977d02c5 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 23 Sep 2014 22:16:03 +0200 Subject: [PATCH] Better mark different message parts in dump output. --- dump1090.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dump1090.c b/dump1090.c index 4160251..94bfc1e 100644 --- a/dump1090.c +++ b/dump1090.c @@ -490,10 +490,18 @@ void dumpMagnitudeBar(int index, int magnitude) { buf[div] = set[rem]; buf[div+1] = '\0'; - if (index >= 0) - printf("[%.3d] |%-66s %d\n", index, buf, magnitude); - else + if (index >= 0) { + int markchar = ']'; + + /* preamble peaks are marked with ">" */ + if (index == 0 || index == 2 || index == 7 || index == 9) + markchar = '>'; + /* Data peaks are marked to distinguish pairs of bits. */ + if (index >= 16) markchar = ((index-16)/2 & 1) ? '|' : ')'; + printf("[%.3d%c |%-66s %d\n", index, markchar, buf, magnitude); + } else { printf("[%.2d] |%-66s %d\n", index, buf, magnitude); + } } /* Display an ASCII-art alike graphical representation of the undecoded