]> sigrok.org Git - sigrok-cli.git/blobdiff - sigrok-cli.c
use input API properly
[sigrok-cli.git] / sigrok-cli.c
index df8236e9d1bd9a3c498cf4e4572dc5e9796504e4..eba6966ee877134e88f2fb30c3164a463d20efcb 100644 (file)
@@ -1189,7 +1189,7 @@ static void load_input_file_format(void)
        in->format = input_format;
        in->param = fmtargs;
        if (in->format->init) {
-               if (in->format->init(in) != SR_OK) {
+               if (in->format->init(in, opt_input_file) != SR_OK) {
                        g_critical("Input format init failed.");
                        exit(1);
                }
@@ -1312,7 +1312,7 @@ static int set_limit_time(const struct sr_dev_inst *sdi)
                return SR_ERR;
        }
 
-       if (sr_driver_hwcap_exists(sdi->driver, SR_CONF_LIMIT_MSEC)) {
+       if (sr_dev_has_option(sdi, SR_CONF_LIMIT_MSEC)) {
                if (sr_config_set(sdi, SR_CONF_LIMIT_MSEC, &time_msec) != SR_OK) {
                        g_critical("Failed to configure time limit.");
                        sr_session_destroy();
@@ -1404,7 +1404,7 @@ static void run_session(void)
        }
 
        if (opt_continuous) {
-               if (!sr_driver_hwcap_exists(sdi->driver, SR_CONF_CONTINUOUS)) {
+               if (!sr_dev_has_option(sdi, SR_CONF_CONTINUOUS)) {
                        g_critical("This device does not support continuous sampling.");
                        sr_session_destroy();
                        return;