- If libusb-1.0 is not found, do not compile in ezusb.c and usb.c since
they require libusb.h. The respective hardware drivers that use
libusb-1.0, and usb.c and/or ezusb.c will be excluded from the build
elsewhere in configure.ac. Rename NEED_EZUSB to NEED_USB.
- Drop the NEED_SERIAL check and always compile in serial.c. This is a
very small chunk of code, it does not depend on any external
libraries that might be missing, and it compiles on all architectures.
Thus there's no need to conditionally include or exclude it.
Some unusual modes required re-parsing the value. Instead of assigning the
re-parsed value to *floatval, it was reassigned directly to *analog->data;
however, analog->data is not initialized at this point, causing a segfault.
This situation was created when moving the radioshack-dmm code to serial-dmm,
with the segfault not being observed at that time.
Do not write directly to analog->data, but instead use the intermediate
variable rawval.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Convert bit masks from hardcoded hex values to bit shifts. For example 0x80
becomes (1 << 7). This also fixes a typo error in the definition of INFO_DIODE.
Add comments explaining that some case values in sr_rs9lcd_parse() are meant to
fall through without a 'break;', and explain some of the unusual modes.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Use the infrastructure of serial-dmm to handle the RadioShack 22-812,
and completely remove radioshack-dmm.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Move the parsing part of radioshack-dmm into a separate protocol
parser, following the model from hardware/common/dmm.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
strcmp(buf + 9, " mA") does not work because buf is CR-terminated,
while " mA" is NUL-terminated.
Drop ambiguities arising from the termination of the strings, and
only compare the characters we care about, using strncmp().
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
When the parser found a space, it treated it as an invalid digit
and discarded the whole packet. This behavior was incorrect on
2000 count devices, where the first digit can be sent as a space
rather than a '0'.
Convert spaces to '0' and parse them as usual.
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.