The demo driver was using sr_session_source_add_channel() to add
a poll source, but was relying on sr_session_run_poll() to call
sr_session_source_remove(). This, coupled with the design of the
driver caused errors once the samples were collected.
The error stream was most likely related to failing to properly close
one of the channels.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This is the first step in fixing the demo driver: figuring out what is
being called and what is not _and_ have it show up in the logs.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Options in addition to the usual "9600/8n1" syntax start with a
slash, and take the form of key=value, where different options are
also separated by slashes. For example:
"9600/8n1/rts=0/dtr=1"
This sets RTS low and DTR high.
The packet mode byte is akin to a signature. If that is invalid, there's
no point in calculating the checksum, so check the mode first.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Serial detection was using serial_readline, which stripped carriage
return from the packets. This made for a very unreliable detection
mechanism.
Switch to a timeout-based detection mechanism that parses the data
as it comes in. This also allows us to stop parsing once we found
our first valid packet.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
ols driver used to probe a series of available serial ports obtained
by regexp matching of common serial port names.
There are a number of problems with this approach:
1. It will probe all serial devices, including devices that do not
like to be probed, potentially causing them to act up.
2. It will try to probe serial ports which may already be opened in
other applications for other purposes.
3. It assumes the naming of the serial ports is set in stone, and
creates an unnecessary OS-specific list.
4. It produces unnecessary debug output even when an OLS device is
not connected.
5. etc...
Do not implicitly probe serial ports. Only probe the port specified
by the frontend, if any; otherwise, just quit.
Also get rid of all functionality in serial.c which was designed
specifically for random probing.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>