Bug 256 - sr_parse_triggerstring matches probe names against a prefix of the input
Summary: sr_parse_triggerstring matches probe names against a prefix of the input
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: API (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-07 21:02 CET by Marcus Comstedt
Modified: 2014-01-29 22:09 CET (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2014-01-07 21:02:19 CET
If a probe has name "FOO", then sr_parse_triggerstring will consider any string which starts with "FOO" to be a match for this probe.  So you can type FOOBAR=r or FOO77=f or whatever.

This becomes especially troublesome when the probes have names like "0" through "15", because the input string "12" will match probe "1", and not "12" as intended.
Comment 1 Bert Vermeulen 2014-01-29 16:28:17 CET
Do you have a commandline example?
Comment 2 Marcus Comstedt 2014-01-29 16:52:46 CET
Well, something like

sigrok-cli --driver=ols -t 25=1

would set the trigger on probe 2 instead of 25.

(Why do you ask for examples if you decided not to fix the bug?)
Comment 3 Bert Vermeulen 2014-01-29 22:09:22 CET
I just wanted an example that demonstrates it, this is sort of vague as a bug report otherwise. I'd expected you to reopen when you provided one.

So yes, I can see the problem now, reopening.