From: Daniel Elstner Date: Thu, 20 Feb 2014 23:34:12 +0000 (+0100) Subject: session: Allow probe selection for session files. X-Git-Tag: sigrok-cli-0.5.0~37 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e1ec80fab866118c0403c81bbc7fcc4ae0818fb1;p=sigrok-cli.git session: Allow probe selection for session files. --- diff --git a/input.c b/input.c index 4d3f358..b293ddd 100644 --- a/input.c +++ b/input.c @@ -152,9 +152,23 @@ static void load_input_file_format(void) void load_input_file(void) { + GSList *sessions; + struct sr_dev_inst *sdi; + int ret; if (sr_session_load(opt_input_file) == SR_OK) { /* sigrok session file */ + ret = sr_session_dev_list(&sessions); + if (ret != SR_OK || !sessions->data) { + g_critical("Failed to access session device."); + sr_session_destroy(); + return; + } + sdi = sessions->data; + if (select_probes(sdi) != SR_OK) { + sr_session_destroy(); + return; + } sr_session_datafeed_callback_add(datafeed_in, NULL); sr_session_start(); sr_session_run(); @@ -165,4 +179,3 @@ void load_input_file(void) load_input_file_format(); } } -