]> sigrok.org Git - sigrok-cli.git/blobdiff - session.c
options: String options are only allowed once.
[sigrok-cli.git] / session.c
index 4648ed8b9c8481fa1d4113943e41e1290b224a5e..07144aa4ee70fb02eeefe68de64d140095382c38 100644 (file)
--- a/session.c
+++ b/session.c
@@ -28,16 +28,6 @@ static int default_output_format = FALSE;
 static uint64_t limit_samples = 0;
 static uint64_t limit_frames = 0;
 
-extern gchar *opt_output_file;
-extern gchar *opt_output_format;
-extern gchar *opt_pds;
-extern gboolean opt_wait_trigger;
-extern gchar *opt_time;
-extern gchar *opt_samples;
-extern gchar *opt_frames;
-extern gchar *opt_continuous;
-extern gchar *opt_config;
-extern gchar *opt_triggers;
 #ifdef HAVE_SRD
 extern struct srd_session *srd_sess;
 #endif
@@ -372,7 +362,7 @@ int opt_to_gvar(char *key, char *value, struct sr_config *src)
                        break;
                src->data = g_variant_new_int32(tmp_u64);
                break;
-       case SR_T_CHAR:
+       case SR_T_STRING:
                src->data = g_variant_new_string(value);
                break;
        case SR_T_BOOL:
@@ -457,8 +447,6 @@ void run_session(void)
        GVariant *gvar;
        struct sr_dev_inst *sdi;
        uint64_t min_samples, max_samples;
-       int max_channels, i;
-       char **triggerlist;
 
        devices = device_scan();
        if (!devices) {
@@ -500,18 +488,10 @@ void run_session(void)
        }
 
        if (opt_triggers) {
-               if (!(triggerlist = sr_parse_triggerstring(sdi, opt_triggers))) {
+               if (!parse_triggerstring(sdi, opt_triggers)) {
                        sr_session_destroy();
                        return;
                }
-               max_channels = g_slist_length(sdi->channels);
-               for (i = 0; i < max_channels; i++) {
-                       if (triggerlist[i]) {
-                               sr_dev_trigger_set(sdi, i, triggerlist[i]);
-                               g_free(triggerlist[i]);
-                       }
-               }
-               g_free(triggerlist);
        }
 
        if (opt_continuous) {