Commit Graph

1292 Commits

Author SHA1 Message Date
Uwe Hermann 5887c9cc1a serial-dmm: Add MASTECH MAS345 support. 2012-12-02 14:22:51 +01:00
Uwe Hermann f0ac4929d3 serial-dmm: Add PeakTech 3410 support. 2012-12-02 14:22:51 +01:00
Uwe Hermann ce3777ada9 serial-dmm: Add Metex ME-31 support. 2012-12-02 14:22:46 +01:00
Uwe Hermann f086b83011 serial-dmm: Add Digitek DT4000ZC support. 2012-12-02 14:21:19 +01:00
Uwe Hermann e90cf076aa metex14: Add sr_metex14_packet_request(). 2012-12-02 14:21:18 +01:00
Uwe Hermann 8f46911e42 metex14: Fix 'is_ol' handling.
Thanks to Bert Vermeulen for the reminder.
2012-12-02 14:21:18 +01:00
Alexandru Gagniuc 2477fb9569 metex14: Parse microamp (uA) values.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-02 14:21:18 +01:00
Alexandru Gagniuc 3ebc9b59a2 metex14: Fix parsing of measurement flags.
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>
2012-12-02 14:21:18 +01:00
Alexandru Gagniuc e82d7dbc20 metex14: Print contents of received packet.
The packet is an ASCII string. We can simply print the raw packet data.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-02 14:21:18 +01:00
Alexandru Gagniuc 76b55dfa8a metex14: Fix parsing of spaces.
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>
2012-12-02 14:21:18 +01:00
Uwe Hermann 21a7f2692e Rename tekpower-dmm to serial-dmm.
This is now a generic driver for multiple DMM "subdrivers" that use simple
serial port protocols.
2012-12-02 14:21:18 +01:00
Uwe Hermann 729b01f988 tekpower-dmm: Generalize & first-class TP4000ZC driver.
Prepare the tekpower-dmm driver to be able to support various simple
serial port based DMMs.

Also, make a 'tekpower-tp4000zc' "first-class" driver which is currently
the only user of this generic driver.
2012-12-02 14:21:18 +01:00
Uwe Hermann 1fbab46626 metex14: Pass 'info' as a void pointer.
This is done so that the function prototype of all sr_*_parse() DMM
functions is the same, which will be needed later.
2012-12-02 14:21:17 +01:00
Uwe Hermann 93357bc3ce fs9721: Pass 'info' as a void pointer.
This is done so that the function prototype of all sr_*_parse() DMM
functions is the same, which will be needed later.
2012-12-02 14:21:17 +01:00
Uwe Hermann d84fc9cb3b tekpower-dmm: Drop unneeded g_try_malloc(). 2012-12-02 14:21:17 +01:00
Uwe Hermann 5ddb0cc7d4 serial: Don't hardcode parity and stop bits on Windows. 2012-12-02 14:10:27 +01:00
Uwe Hermann 5ae35c29a7 serial: Full baudrate support on Windows/MinGW. 2012-12-02 13:56:13 +01:00
Uwe Hermann 39e5d79826 serial: RTS/DTR support on Windows/MinGW. 2012-12-02 13:41:49 +01:00
Uwe Hermann a54dd31e38 serial: Use OS-independent flags for serial port opening.
Add SERIAL_RDWR, SERIAL_RDONLY, and SERIAL_NONBLOCK (for now), which are
mapped to the respective OS-specific mechanism in serial_open().
2012-12-02 12:45:54 +01:00
Uwe Hermann 0f84cda05d serial: Fix Windows build. 2012-12-01 22:34:53 +01:00
Alexandru Gagniuc c216d62307 demo: Properly stop acquisition after reaching our sample quota
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>
2012-12-01 22:00:16 +01:00
Alexandru Gagniuc 49145a63c7 demo: Be more verbose about starting/stopping acquisition
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>
2012-12-01 22:00:15 +01:00
Bert Vermeulen 71caaad46b serial: allow for extra rts and dtr options in conn string
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.
2012-11-27 00:55:08 +01:00
Uwe Hermann 700dcd5caa serial: Initial code for setting DTR/RTS.
Currently disabled until option parsing is in place.
2012-11-26 17:01:15 +01:00
Petteri Aimonen 6b7ace4832 Add compress option to input/vcd. 2012-11-22 23:15:37 +01:00
Alexandru Gagniuc 9047358761 radioshack-dmm: Be more verbose with packet checks
Add sr_spew() messages to state why the packet was found to be invalid.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-11-21 19:33:55 -06:00
Alexandru Gagniuc 2ecc5d432f radioshack-dmm: Check for valid mode before calculating checksum
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>
2012-11-21 19:30:26 -06:00
Alexandru Gagniuc 54be7c005e radioshack-dmm: Improve serial detection
For device detection, use serial_stream_detect() instead of
serial_readline() + custom logic.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-11-21 19:19:58 -06:00
Alexandru Gagniuc 551c3d8ce3 serial.c: Sanitize serial_stream_detect
Print the timeout in miliseconds, not microseconds.
Only calculate elapsed time once oer loop.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-11-21 19:18:21 -06:00
Petteri Aimonen 8be8746951 Improve compatibility with various kinds of VCD files. 2012-11-21 16:39:16 +01:00
Petteri Aimonen 0157808d74 Add downsample and skip parameters to input/vcd. 2012-11-21 16:39:16 +01:00
Petteri Aimonen 61a429c963 VCD data parsing 2012-11-20 22:24:17 +02:00
Petteri Aimonen 99eaa20695 Beginnings of VCD input module.
File header parsing implemented.
Data parsing not yet implemented.
2012-11-20 21:03:06 +02:00
Petteri Aimonen 8c012adbc1 Add support for fs and ps to sr_parse_period.
These time units are used in VCD files.
2012-11-20 21:02:14 +02:00
Uwe Hermann ac913e5c35 Add Metex 14-byte ASCII protocol parser. 2012-11-17 22:27:54 +01:00
Bert Vermeulen 90165efe55 ols: if no serial port specified, this driver is not used. 2012-11-16 15:26:47 +01:00
Uwe Hermann 766456be1c Move serial_stream_detect() to serial.c. 2012-11-14 18:40:07 +01:00
Uwe Hermann e42b82a66f configure.ac: Update NEED_SERIAL list. 2012-11-14 18:29:27 +01:00
Uwe Hermann 4da1a800df serial: Compile-fix for Windows/MinGW. 2012-11-14 18:20:13 +01:00
Uwe Hermann 6bef68a7e1 tekpower-dmm: Cosmetics. 2012-11-14 18:13:56 +01:00
Alexandru Gagniuc 2546b05c80 tekpower-dmm: Improve serial detection.
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>
2012-11-14 18:13:56 +01:00
Uwe Hermann bda8fc98b1 Drop obsolete genericdmm driver. 2012-11-14 15:26:11 +01:00
Bert Vermeulen d35afa87c9 tekpower-dmm: use new serial API 2012-11-12 12:50:42 +01:00
Bert Vermeulen 401476daaf radioshack-dmm: use new serial API 2012-11-12 12:41:10 +01:00
Bert Vermeulen 19ee7dff78 tondaj-sl-814: use new serial API 2012-11-12 03:00:32 +01:00
Bert Vermeulen f306ca61f6 colead-slm: use new serial API 2012-11-12 02:54:10 +01:00
Bert Vermeulen 109a3ba413 agilent-dmm: use new serial API 2012-11-12 02:25:37 +01:00
Bert Vermeulen 58d03f034f fluke-dmm: use new serial API 2012-11-12 02:25:17 +01:00
Bert Vermeulen 530f201eb8 ols: use new serial API 2012-11-12 02:24:47 +01:00
Bert Vermeulen 299bdb249e serial: revamp internal API
The only thing to get passed around now is the struct sr_serial_dev_inst
pointer. This should make things more portable as well.
2012-11-12 00:27:17 +01:00