From e1ec80fab866118c0403c81bbc7fcc4ae0818fb1 Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Fri, 21 Feb 2014 00:34:12 +0100 Subject: [PATCH] session: Allow probe selection for session files. --- input.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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(); } } - -- 2.30.2