X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=sigrok-cli.c;h=a9f15285e8faa64028904924fb8da6176801bc7d;hp=5e54f7bf9149878a99f9be7fc8af1bd4b9728137;hb=498f9167faca80af9cc813979ea87b12b5bb9c87;hpb=c8db71728eb10141d68f2139eee5f9e648ce4980 diff --git a/sigrok-cli.c b/sigrok-cli.c index 5e54f7b..a9f1528 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -320,6 +320,42 @@ static void show_dev_detail(void) for (i = 0; stropts[i]; i++) printf(" %s\n", stropts[i]); + } else if (hwo->hwcap == SR_HWCAP_FILTER) { + /* Supported trigger sources */ + printf(" %s", hwo->shortname); + if (sr_dev_info_get(dev, SR_DI_FILTERS, + (const void **)&stropts) != SR_OK) { + printf("\n"); + continue; + } + printf(" - supported filter targets:\n"); + for (i = 0; stropts[i]; i++) + printf(" %s\n", stropts[i]); + + } else if (hwo->hwcap == SR_HWCAP_VDIV) { + /* Supported volts/div values */ + printf(" %s", hwo->shortname); + if (sr_dev_info_get(dev, SR_DI_VDIVS, + (const void **)&rationals) != SR_OK) { + printf("\n"); + continue; + } + printf(" - supported volts/div:\n"); + for (i = 0; rationals[i].p && rationals[i].q; i++) + printf(" %s\n", sr_voltage_string( &rationals[i])); + + } else if (hwo->hwcap == SR_HWCAP_COUPLING) { + /* Supported coupling settings */ + printf(" %s", hwo->shortname); + if (sr_dev_info_get(dev, SR_DI_COUPLING, + (const void **)&stropts) != SR_OK) { + printf("\n"); + continue; + } + printf(" - supported coupling options:\n"); + for (i = 0; stropts[i]; i++) + printf(" %s\n", stropts[i]); + } else { /* Everything else */ printf(" %s\n", hwo->shortname); @@ -1098,12 +1134,18 @@ static int set_dev_options(struct sr_dev *dev, GHashTable *args) ret = dev->driver->dev_config_set(dev->driver_index, sr_hwcap_options[i].hwcap, &tmp_float); break; - case SR_T_RATIONAL: + case SR_T_RATIONAL_PERIOD: if ((ret = sr_parse_period(value, &tmp_rat)) != SR_OK) break; ret = dev->driver->dev_config_set(dev->driver_index, sr_hwcap_options[i].hwcap, &tmp_rat); break; + case SR_T_RATIONAL_VOLT: + if ((ret = sr_parse_voltage(value, &tmp_rat)) != SR_OK) + break; + ret = dev->driver->dev_config_set(dev->driver_index, + sr_hwcap_options[i].hwcap, &tmp_rat); + break; default: ret = SR_ERR; }