X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok-cli.c;h=bc293179b4c8130a32ebbc517bbe6207f5be79de;hb=a172e2a0f496c1b7685d8843ace31ac940f91c21;hp=df8236e9d1bd9a3c498cf4e4572dc5e9796504e4;hpb=b1bb484525c606019ef14692f814563c2acd58b3;p=sigrok-cli.git diff --git a/sigrok-cli.c b/sigrok-cli.c index df8236e..bc29317 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -746,7 +746,7 @@ static void datafeed_in(const struct sr_dev_inst *sdi, if (o->format->data && packet->type == o->format->df_type) o->format->data(o, filter_out, filter_out_len, &output_buf, &output_len); - if (output_buf) { + if (output_len) { fwrite(output_buf, 1, output_len, outfile); fflush(outfile); g_free(output_buf); @@ -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;