From 20917615ac052d1e811066b648438daed00afb67 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Sun, 16 Oct 2016 18:25:30 +0200 Subject: [PATCH] show: print binary classes as well in protocol decoder details The output of `sigrok -P --show` omitted the binary classes, users could not learn which specs are available for the -B option. Add a "Binary classes:" section after the list of annotations. Signed-off-by: Gerhard Sittig --- show.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/show.c b/show.c index 54b367c..7d02326 100644 --- a/show.c +++ b/show.c @@ -682,7 +682,7 @@ void show_pd_detail(void) struct srd_decoder_annotation_row *r; GSList *l, *ll, *ol; int idx; - char **pdtokens, **pdtok, *optsep, **ann, *val, *doc; + char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc; pdtokens = g_strsplit(opt_pds, ",", -1); for (pdtok = pdtokens; *pdtok; pdtok++) { @@ -722,6 +722,15 @@ void show_pd_detail(void) } else { printf("None.\n"); } + printf("Binary classes:\n"); + if (dec->binary) { + for (l = dec->binary; l; l = l->next) { + bin = l->data; + printf("- %s: %s\n", bin[0], bin[1]); + } + } else { + printf("None.\n"); + } printf("Required channels:\n"); if (dec->channels) { for (l = dec->channels; l; l = l->next) { -- 2.30.2