2015-02-10 14:16 GMT+01:00 Bert Vermeulen <b...@biot.com>: > On 02/10/2015 01:50 PM, Bartosz Golaszewski wrote: > >> when passing multiple options with the same name to sigrok-cli, only >> the last one in the option string has any effect. >> >> For example: >> >> sigrok-cli --driver=baylibre-acme --config >> probe_power=1=off:probe_power=3=off --set >> >> only powers off the third probe. >> >> The reason for this is using a GHashTable in parse_generic_arg() - when a >> key already exists in the hashtable, the corresponding value gets >> overwritten. Is this an intentional behavior? I don't see any hashtable >> look-ups after any call to parse_generic_arg(). Is there any reason why >> it couldn't be changed to a GSList of option structures to allow >> duplicate keys? > > More like it's "known" behavior -- we haven't had a really hard case of > needing multiple-value options passed so far. Keep in mind sigrok-cli isn't > the result of much design: when we add features to libsigrok, some way to > use that feature is glommed on to sigrok-cli. If you have a need for this > feature, go ahead and fix it. > > Having said that: can't you just disable the probes with the regular channel > enable/disable stuff? This wouldn't need a driver option at all, in that case.
You mean something like: 'sigrok-cli (...) --config probe_power=off --channel-group=PROBE_1'? This is probably the standard approach in sigrok, but it won't allow us to set different states for different probes at the same time. I have to think about a possible solution. BTW I forgot to add a check for ch->enabled in bl_acme_receive_data() (it's already fixed in my tree, either I'm going to resend it together with the next version of the series for acme, or it will be a stand alone patch). Bart ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel