X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=show.c;h=f09095a5c9f1802630c757e3f2ec890949dfbcc2;hp=54b367c909a98046d11d25b8dc34cb53e6bf73ed;hb=87cb3b61d72f430479bb5fdfd3c0c909f3ac899e;hpb=09fc39da486b8618d65b66ca96a760478c3e89e2 diff --git a/show.c b/show.c index 54b367c..f09095a 100644 --- a/show.c +++ b/show.c @@ -610,7 +610,7 @@ void show_dev_detail(void) gvar = g_variant_get_child_value(gvar_list, i); g_variant_get(gvar, "(tt)", &p, &q); if (srci->datatype == SR_T_RATIONAL_PERIOD) - s = sr_period_string(p * q); + s = sr_period_string(p, q); else s = sr_voltage_string(p, q); printf(" %s", s); @@ -674,7 +674,7 @@ void show_dev_detail(void) } #ifdef HAVE_SRD -void show_pd_detail(void) +static void show_pd_detail_single(const char *pd) { struct srd_decoder *dec; struct srd_decoder_option *o; @@ -682,9 +682,9 @@ 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); + pdtokens = g_strsplit(pd, ",", -1); for (pdtok = pdtokens; *pdtok; pdtok++) { /* Strip options. */ if ((optsep = strchr(*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) { @@ -768,6 +777,12 @@ void show_pd_detail(void) g_strfreev(pdtokens); } + +void show_pd_detail(void) +{ + for (int i = 0; opt_pds[i]; i++) + show_pd_detail_single(opt_pds[i]); +} #endif void show_input(void)