Skip to content

Commit

Permalink
show: print binary classes as well in protocol decoder details
Browse files Browse the repository at this point in the history
The output of `sigrok -P <decoder> --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 <gerhard.sittig@gmx.net>
  • Loading branch information
gsigh authored and uwehermann committed Oct 16, 2016
1 parent d473271 commit 2091761
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion show.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2091761

Please sign in to comment.