X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok-cli.c;h=231572c6767d5c8c71a7ebe484b600b678efbdb6;hb=8e8827f4055c22b84d507b98342c321d5bed42bc;hp=e58c51422a817ac37c8e0171c570caaa2bdbfeb2;hpb=2d73284ebd14c28579076312987694cbd35cfe42;p=sigrok-cli.git diff --git a/sigrok-cli.c b/sigrok-cli.c index e58c514..231572c 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -305,7 +305,7 @@ static void show_dev_detail(void) GSList *devices; uint64_t *integers; const int *hwopts, *hwcaps; - int cap, num_devices, n, i; + int cap, num_devices, *tmp_bool, i; char *s, *title; const char *charopts, **stropts; @@ -324,6 +324,14 @@ static void show_dev_detail(void) sdi = devices->data; print_dev_line(sdi); + /* This properly opens and initializes the device, so we can get + * current settings. */ + sr_session_new(); + if (sr_session_dev_add(sdi) != SR_OK) { + g_critical("Failed to use device."); + return; + } + if (sr_config_list(sdi->driver, SR_CONF_TRIGGER_TYPE, (const void **)&charopts, sdi) == SR_OK && charopts) { printf("Supported triggers: "); @@ -474,12 +482,22 @@ static void show_dev_detail(void) for (i = 0; stropts[i]; i++) printf(" %s\n", stropts[i]); + } else if (srci->key == SR_CONF_DATALOG) { + /* Turning on/off internal data logging. */ + printf(" %s\t(on/off", srci->id); + if (sr_config_get(sdi->driver, SR_CONF_DATALOG, + (const void **)&tmp_bool, sdi) == SR_OK) { + printf(", currently %s", *tmp_bool ? "on" : "off"); + } + printf(")\n"); } else { /* Everything else */ printf(" %s\n", srci->id); } } + sr_session_destroy(); + } static void show_pd_detail(void)