Uffe Jakobsen
15eea61a47
Fix compile error on FreeBSD
2015-01-05 22:16:48 +01:00
Uwe Hermann
b1a7ca3b60
serial.c: Cosmetics/consistency/documentation fixes.
2015-01-03 18:03:50 +01:00
Aurelien Jacobs
24287ea9e3
Add a public API to list available serial ports.
2015-01-03 17:51:51 +01:00
Aurelien Jacobs
5e1b68c6e7
Only save enabled channels to a session file.
...
This reverts bc96d5f08f
which is not
needed anymore since we have a better fix for #410 and #495 .
2014-12-05 01:14:22 +01:00
Aurelien Jacobs
a160a0c344
session_file: Enable only the probes that are actually listed in metadata.
...
This is a better fix for #410 and #495 .
2014-12-05 01:14:22 +01:00
Bert Vermeulen
974fb0fffa
saleae-logic16: Show libusb transfer status name instead of code.
2014-11-28 00:21:56 +01:00
Uwe Hermann
a11e10ec91
saleae-logic16: Change two errors into warnings.
...
Related to #466 , convert two more sanity checks from errors into warnings.
This may allow more devices to work with libsigrok.
2014-11-27 23:22:05 +01:00
Bert Vermeulen
5cfcab6603
saleae-logic16: Clearer error message.
2014-11-27 01:01:13 +01:00
Aurelien Jacobs
e743a47d6d
beaglelogic: Add SR_CONF_CAPTURE_RATIO support.
2014-11-25 22:13:36 +01:00
Aurelien Jacobs
5a971f66a3
saleae-logic16: Add SR_CONF_CAPTURE_RATIO support.
2014-11-25 22:13:36 +01:00
Aurelien Jacobs
7bfcb25cf1
fx2lafw: Add SR_CONF_CAPTURE_RATIO support.
2014-11-25 16:56:34 +01:00
Aurelien Jacobs
fe5a735553
soft-trigger: Add support for pre-triggering.
2014-11-25 16:56:34 +01:00
Bert Vermeulen
bc96d5f08f
Always save all channels to a session file.
...
This works around limitations of the current API that screw up saving
only enabled channels. See bug 410. And bug 495.
2014-11-24 02:21:52 +01:00
Uwe Hermann
9f42e2e6be
sr_session_trigger_{get,set}: Document, add error checks.
2014-11-24 00:50:11 +01:00
Uwe Hermann
b6085eb179
manson-hcs-3xxx: Fix incorrect SR_CONF_SCAN_OPTIONS handling.
...
The SR_CONF_SCAN_OPTIONS key must be listable with or without sdi,
otherwise the device will not be detected by frontends.
2014-11-23 21:13:16 +01:00
Vincent Palatin
2f004b4bc1
usb_get_port_path(): fix libusb error checking
...
When libusb cannot access a device, libusb_get_port_numbers() will return
an error. Check the return code rather than doing invalid pointer
operations (out-of-bound read).
Avoid segfaults at sigrok-cli startup on my setup where some USB devices are
not accessible and also make Valgrind happier.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
2014-11-23 17:58:21 +01:00
Bert Vermeulen
68ac991dba
Publish config key capabilities on session driver.
2014-11-23 17:48:29 +01:00
Bert Vermeulen
90cefe0cc7
Add sr_rational_set() convenience function.
2014-11-23 17:48:29 +01:00
Tim Hatch
cd3c4df35a
saleae-logic16: Downgrade error during capture to a message.
...
Some clone doesn't set this to the exact same value, and both bits in 0x48 are
marked as unknown at
http://sigrok.org/wiki/Saleae_Logic16/Firmware#FPGA_variables
This fixes bug #466 .
2014-11-23 13:47:45 +01:00
Uwe Hermann
cc8be68f22
trigger: Add some more error handling.
...
All of these error conditions are checked via the unit tests.
Also, add the following missing entries (analog trigger types):
- SR_TRIGGER_RISING
- SR_TRIGGER_EDGE
2014-11-22 21:03:39 +01:00
Uwe Hermann
a445f8aa08
trigger: Add API documentation.
2014-11-22 19:32:28 +01:00
Uwe Hermann
54ab1dcdc4
Add missing entries to sr_config_info_data[].
...
Newly added keys:
- SR_CONF_SAMPLE_INTERVAL
- SR_CONF_NUM_TIMEBASE
- SR_CONF_NUM_VDIV
- SR_CONF_CENTER_FREQUENCY
- SR_CONF_DEVICE_MODE
- SR_CONF_SCAN_OPTIONS
- SR_CONF_DEVICE_OPTIONS
- SR_CONF_DEVICE_MODE
- SR_CONF_TEST_MODE
Also, keep the same ordering and grouping as in libsigrok.h.
2014-11-22 17:02:57 +01:00
Uwe Hermann
91219afc75
Use g_malloc0() consistently, simplify error handling.
...
Use g_malloc0() for small allocations and assume they always
succeed. Simplify error handling in a few places accordingly.
Don't always sanity-check parameters for non-public (SR_PRIV)
functions, we require the developers to invoke them correctly.
This allows further error handling simplifications.
2014-11-22 17:02:57 +01:00
Uwe Hermann
c368e6f3d2
Don't check sr_channel_new() return value (always succeeds).
...
We now use g_malloc0() for the allocation and assume the allocation
will always succeed, thus sr_channel_new() will always return a
valid new channel.
2014-11-21 12:10:05 +01:00
Uwe Hermann
f57d8ffe66
Consistently use g_malloc0() for allocating devc.
...
We assume the allocation will always succeed, hence no need for
checking the returned value.
2014-11-21 12:09:01 +01:00
Uwe Hermann
aac29cc192
Eliminate sr_dev_inst_new().
2014-11-21 02:01:36 +01:00
Bert Vermeulen
a9b2283fd0
Fix invalid pointer dereference.
2014-11-20 03:08:55 +01:00
Aurelien Jacobs
cf0280fa1b
yokogawa-dlm: Publish driver options.
2014-11-19 23:54:01 +01:00
Aurelien Jacobs
413f1944d1
motech-lps-30x: Publish driver options.
2014-11-19 23:53:35 +01:00
Aurelien Jacobs
f3ba3c119c
manson-hcs-3xxx: Publish driver options.
2014-11-19 23:53:10 +01:00
Aurelien Jacobs
6ec3ef9b92
hameg-hmo: Publish driver options.
2014-11-19 23:52:51 +01:00
Aurelien Jacobs
8a58419d37
Finish fixing broken sr_config_list() logic.
2014-11-19 17:34:19 +01:00
Martin Ling
a24da9a813
Make sr_analog_*_to_string() functions allocate the necessary buffers.
2014-11-19 17:34:19 +01:00
Uwe Hermann
e07edc83d6
mic-985xx: Correctly report SR_CONF_THERMOMETER/_HYGROMETER.
...
Some models only log temperature, others log temperature and humidity
(so they need different drvopts).
2014-11-18 23:43:38 +01:00
Uwe Hermann
20a7cd07c9
mic-985xx: Drop unneeded #define.
2014-11-18 23:26:10 +01:00
Uwe Hermann
d6e1e6c4e1
mic-985xx: Publish driver options.
2014-11-18 23:26:10 +01:00
Uwe Hermann
489c338884
center-3xx: Drop unneeded #define.
2014-11-18 23:20:09 +01:00
Uwe Hermann
6685e9a6b3
center-3xx: Publish driver options.
2014-11-18 23:20:09 +01:00
Bert Vermeulen
5c868fef43
Revert "victor-dmm: Set spec digits to 3, matching the display."
...
This reverts commit 28b4243493
.
2014-11-18 18:10:19 +01:00
Bert Vermeulen
63ea6141b6
ols: Publish driver options.
2014-11-18 17:41:36 +01:00
Bert Vermeulen
f9dada0b60
agilent-dmm: Now really fix driver options.
2014-11-18 17:31:58 +01:00
Bert Vermeulen
42a47a9a4b
appa-55ii: Publish driver options.
2014-11-18 16:50:47 +01:00
Bert Vermeulen
5ecd9049e5
hantek-dso: Fix driver options.
2014-11-18 16:46:39 +01:00
Bert Vermeulen
1f889afd61
atten-pps3xxx: Fix driver options.
2014-11-18 16:44:58 +01:00
Bert Vermeulen
023c73ae05
cem-dt-885x: Fix driver options.
2014-11-18 16:44:14 +01:00
Bert Vermeulen
9d9cf1c4b9
scpi-pps: Fix driver options.
2014-11-18 16:44:14 +01:00
Bert Vermeulen
2ff11e50a5
asix-sigma: Fix driver options.
2014-11-18 16:30:47 +01:00
Bert Vermeulen
820c48f8c2
output/analog: Add option to restrict number of decimal digits printed.
...
This is a feature restricted to the new analog struct.
By default all the digits available in the encoding struct are printed.
The option "digits", when set to "spec", changes this to print the
number given in the spec struct.
2014-11-18 15:51:38 +01:00
Bert Vermeulen
db6fa867a4
Add debug spew to all sr_config_(get|set|list) calls.
2014-11-18 15:46:59 +01:00
Bert Vermeulen
cf3db38193
Fix broken sr_config_list() logic.
2014-11-18 15:46:24 +01:00
Bert Vermeulen
1e4a7cace2
demo: Fix driver options.
2014-11-18 15:39:46 +01:00
Bert Vermeulen
ff6b76a145
fx2lafw: Publish driver options.
2014-11-18 15:35:30 +01:00
Bert Vermeulen
ce4bd05256
agilent-dmm: Publish driver options.
2014-11-18 15:34:52 +01:00
Bert Vermeulen
5533392828
victor-dmm: Publish driver options.
2014-11-18 14:34:02 +01:00
Bert Vermeulen
a5892391b0
Add analog helper sr_analog_unit_to_string().
2014-11-18 01:16:27 +01:00
Bert Vermeulen
c2a25ebb8f
Add analog helper sr_analog_float_to_string().
2014-11-18 01:15:41 +01:00
Bert Vermeulen
1954dfa963
Show SR_DF_ANALOG2 packets in debug output.
2014-11-18 00:24:37 +01:00
Bert Vermeulen
28b4243493
victor-dmm: Set spec digits to 3, matching the display.
2014-11-18 00:24:08 +01:00
Bert Vermeulen
4b4fdeea94
analog: Fix analog_to_float typos, and cleanup.
...
This was adding 1 to every measurement being converted.
2014-11-17 23:08:49 +01:00
Aurelien Jacobs
41caa31909
Add a sr_analog_init() API to initialize sr_datafeed_analog2 struct.
...
It fills the fields with reasonable default values that should suit
most of the drivers. Drivers are obviously free to override the fields
they want after initializing.
2014-11-17 22:04:24 +01:00
Aurelien Jacobs
62f155f0c7
demo: Fix analog output at low samplerate.
2014-11-17 13:39:53 +01:00
Aurelien Jacobs
3772c04990
demo: Fix square pattern output shorter than other patterns.
2014-11-17 13:39:53 +01:00
Bert Vermeulen
c6dde8125a
Check driver capabilities before sr_config_get/set/list.
2014-11-17 13:20:32 +01:00
Bert Vermeulen
adfba7368a
Refactor scan options check.
2014-11-14 20:25:12 +01:00
Bert Vermeulen
071151b578
sr_driver_scan: Enforce options passed in by client.
2014-11-14 12:22:54 +01:00
Bert Vermeulen
4b664cd6ce
demo: Use allocation for model string.
2014-11-14 11:37:11 +01:00
Uwe Hermann
676877f6ce
mic-985xx: Convert to use SR_DF_ANALOG2.
2014-11-13 22:51:39 +01:00
Uwe Hermann
a84a26d98a
victor-dmm: Convert to use SR_DF_ANALOG2.
2014-11-13 22:51:39 +01:00
Bert Vermeulen
e02e9e6a1c
output/analog: Add SR_DF_ANALOG2 support.
2014-11-13 22:51:39 +01:00
Bert Vermeulen
fb019a0e4d
Add sr_analog_to_float().
2014-11-13 22:51:39 +01:00
Uwe Hermann
0af636bed9
Change sr_dev_inst_new() to take no parameters.
...
Change all callers to set the fields manually as needed.
2014-11-12 17:18:46 +01:00
Bert Vermeulen
3250d8c7e0
output: Add srzip, the session file format.
...
The 'filename' option is required: this module creates the zip file
itself, and never actually outputs anything back to the calling frontend.
2014-11-12 00:12:59 +01:00
Uwe Hermann
e705ce3bf6
Add sr_dev_inst_user_new(), sr_dev_inst_channel_add().
2014-11-11 22:16:12 +01:00
Uwe Hermann
2f5f97056a
Constify the sdi parameter of all sr_dev_inst_*() getters.
2014-11-11 12:44:37 +01:00
Uwe Hermann
96727ef016
Make 'struct sr_dev_inst' opaque.
2014-11-11 12:24:08 +01:00
Uwe Hermann
e437da2b86
Add sr_dev_inst_channels_get() and sr_dev_inst_channel_groups_get().
2014-11-11 11:59:23 +01:00
Uwe Hermann
3f2cd87f36
session_driver.c: Allow querying of SR_CONF_CAPTURE_UNITSIZE.
2014-11-09 20:04:09 +01:00
Uwe Hermann
6508992d04
Brymen BM25x: Drop unneeded _ser/_SER suffix.
...
There's only one cable for this DMM, thus there's no need for a
_ser/_SER suffix or for specifying the cable name.
2014-11-02 16:40:40 +01:00
Uffe Jakobsen
bce75f947d
ols: Fix a serial port related issue on FreeBSD.
...
Add sp_drain() to ensure bytes have actually been transmitted
over the wire.
This fixes bug #414 .
2014-11-01 19:44:36 +01:00
Bert Vermeulen
7aebe22d10
Only sr_dev_inst_free() should free channel groups.
2014-11-01 13:20:00 +01:00
Uwe Hermann
aab4b8cb70
fx2lafw: Fix wide (16bit) sampling case.
...
This fixes bug #373 .
2014-10-29 22:46:57 +01:00
Bert Vermeulen
e3594306a9
zeroplus-logic-cube: Add support for AKIP-9101.
...
Thanks to Nikita Nazarenko for the patch.
2014-10-29 13:26:57 +01:00
Soeren Apel
9c6a2913fd
Make sr_dev_inst_connid_get() available without libusb
2014-10-27 21:22:31 +01:00
Bert Vermeulen
933defaa03
hantek-dso: Fix driver/global/channel group config keys.
...
This was way behind and did not yet support channel groups.
2014-10-27 17:09:57 +01:00
Bert Vermeulen
6fad08e6ab
Change SR_CONF_FILTER key to a boolean type.
...
This was an ill-defined string before, now it's simply something
you turn on or off on a channel.
2014-10-27 17:09:57 +01:00
Bert Vermeulen
e7ba5a994b
asix-sigma: Publish driver options.
2014-10-27 17:09:47 +01:00
Bert Vermeulen
a258204e00
scpi-pps: Publish driver options.
2014-10-27 17:09:47 +01:00
Bert Vermeulen
390795c099
demo: Rearrange driver and device options.
2014-10-27 17:09:47 +01:00
Bert Vermeulen
d7125bfa1e
cem-dt-885x: Publish driver options.
2014-10-27 17:09:47 +01:00
Bert Vermeulen
d6fa8ace94
atten-pps3xxx: Publish driver options.
2014-10-27 17:09:47 +01:00
Bert Vermeulen
a700a3a4bf
More robust searching for config keys.
2014-10-27 17:09:27 +01:00
Bert Vermeulen
51b1b95edb
Add config info for device type and limit config keys.
2014-10-27 17:09:07 +01:00
Uwe Hermann
8769478c07
Add support for the UNI-T UT71x series (aka Voltcraft VC-920/940/960).
...
Tested on the Voltcraft VC-920 and VC-940 (both UT-D02 and UT-D04
cables), but it should work for all devices in this series without
any changes.
2014-10-25 17:14:30 +02:00
Uwe Hermann
626027df0f
Add UNI-T UT71x DMM parser.
2014-10-25 16:53:32 +02:00
Bert Vermeulen
ce48b174da
sr_dev_inst_connid_get() requires libusb.
2014-10-23 00:22:07 +02:00
Bert Vermeulen
cf49d66bc6
hantek-dso: Properly zero out MQ flags.
2014-10-22 22:19:41 +02:00
Bert Vermeulen
61b0292217
Accept subtype of expected GVariant values.
2014-10-22 22:18:52 +02:00
Janne Huttunen
a42a39ac37
Export LCR meter 'auto' bits as config keys instead of mqflags.
...
The automatic selections of the measured quantity and equivalent circuit
model are more part of the configuration of the meter than attributes
of the measurement result. To reflect this, model them as config keys
instead of mqflags. This allows a driver that supports remote control to
implement 'set' method for them and has the additional benefit of saveing
two flag bits.
2014-10-21 12:23:20 +02:00
Jens Steinhauser
160691b900
input/csv: Skip header line.
2014-10-19 23:23:58 +02:00
Bert Vermeulen
c3eadb0760
scpi-pps: Add support for Fluke/Philips PM2800 series.
2014-10-18 23:21:37 +02:00
Bert Vermeulen
c1d56d2013
scpi-pps: Move non-standard data type processing to SCPI parser.
2014-10-18 23:21:37 +02:00
Bert Vermeulen
4a471029c2
scpi-pps: Add channel probe facility to scan.
...
If the number and specs of the device's channels are not static, i.e.
need to be probed, this facility is needed.
Initially this will be used for the Philips PM2800 series, where only
the model returned by *IDN? is needed. However this could also be used
to do actual discovery with vendor-specific SCPI commands.
2014-10-18 23:21:37 +02:00
Bert Vermeulen
99d090d8e5
Fix typos.
2014-10-18 23:21:37 +02:00
Bert Vermeulen
b1b1944e19
Free channel group private storage when clearing device instance.
2014-10-18 23:21:37 +02:00
Janne Huttunen
c7c8994c20
Rename "SERIAL" -> "SERIES".
...
Use the more correct term "SERIES" for the corresponding equivalent
circuit model.
2014-10-17 12:13:51 +02:00
Soeren Apel
e8cbb22314
Auto-set sdi->connection_id for serial devices in the getter
2014-10-17 03:02:52 +02:00
Soeren Apel
d1314831e4
yokogawa-dlm: Populate sdi->serial_num and sdi->version
2014-10-17 03:02:52 +02:00
Soeren Apel
b3fccc851b
rigol-ds: Populate sdi->serial_num
2014-10-17 03:02:52 +02:00
Soeren Apel
b33db61c48
hameg-hmo: Populate sdi->serial_num
2014-10-17 03:02:52 +02:00
Soeren Apel
d08667c53b
scpi-pps: Populate sdi->serial_num and fix hw_info mem leak
2014-10-17 03:02:52 +02:00
Soeren Apel
b2c02b0747
scpi: Populate sdi->connection_id
2014-10-17 03:02:52 +02:00
Soeren Apel
0699ccdd92
sysclk-lwla: Let the sdi getter populate sdi->connection_id
...
This fixes bug #441 .
2014-10-17 03:02:52 +02:00
Soeren Apel
c962d07cba
ikalogic-scanalogic2: Let the sdi getter popuplage sdi->connection_id
...
This fixes bug #440 .
2014-10-17 03:02:52 +02:00
Soeren Apel
0157fdce99
Provide getters for sr_dev_inst member access
2014-10-17 03:02:52 +02:00
Bert Vermeulen
984e4b0db8
scpi-pps: Start acquisition on the first enabled channel.
2014-10-17 03:00:55 +02:00
Bert Vermeulen
624503ae90
scpi-pps: Optimize channel selection.
...
This avoids sending a channel selection command to the device if
the channel we're working on is already on the same underlying
output channel.
2014-10-17 03:00:05 +02:00
Bert Vermeulen
ee2860ee11
scpi-pps: Disable beeper during session.
...
At least the Rigol DP800 series trigger the beeper when changing
channels remotely. Which gets rather annoying when doing acquisition
on three channels as fast as you can.
2014-10-16 15:24:27 +02:00
Bert Vermeulen
bf48ccebee
scpi-pps: Properly clean up acquisition session.
2014-10-16 14:55:56 +02:00
Bert Vermeulen
60475cd788
scpi-pps: Use only standard SCPI for Rigol DP800 series.
2014-10-16 13:23:21 +02:00
Bert Vermeulen
ae431bc8d6
Fix short names for SR_CONF_OUTPUT_VOLTAGE_TARGET/_CURRENT_LIMIT.
2014-10-16 13:22:51 +02:00
Martin Ling
1de3ccede9
Track sdis created by sr_session_load(), and free in sr_session_destroy().
2014-10-15 13:44:25 +02:00
Martin Ling
c0e3ba4b79
Correct description of sr_session.devs.
2014-10-15 13:44:25 +02:00
Bert Vermeulen
ca95e90fb3
Use SR_CONF_OUTPUT_VOLTAGE_TARGET and _CURRENT_LIMIT.
...
These describe them better; the two are fundamentally different
things to set.
2014-10-15 12:03:00 +02:00
Bert Vermeulen
53a81803e4
scpi-pps: Split boolean set options into enable/disable.
...
This makes it easier to support devices that need something else
than "ON" or "OFF".
2014-10-13 12:50:28 +02:00
Uwe Hermann
b9a348f56c
Rename SR_CONF_LCR_METER to SR_CONF_LCRMETER.
...
(to be consistent with some other key names)
2014-10-13 11:39:15 +02:00
Uwe Hermann
3ea46116de
libsigrok-internal.h: Fix some outdated comments.
2014-10-13 01:06:09 +02:00
Janne Huttunen
b50891952d
Add driver for DER EE DE-5000 LCR meter.
...
Add a driver for the DER EE DE-5000 LCR meter. This meter is based on
the Cyrustek ES51919/ES51920 chipset and communicates with the host
computer via an optional connectivity kit.
The kit uses an optoisolated unidirectional link to connect to the
meter and an USB cable on the host side. Internally the connection is
using the FTDI FT232R USB UART chip i.e. from the host computer point
of view the meter is connected into an RS-232 serial port.
This driver implements just a thin shim layer for registering the
driver and uses the es51919 module for all the actual work.
2014-10-13 00:56:11 +02:00
Janne Huttunen
6bcb3ee876
Add protocol decoder for Cyrustek ES51919 LCR meter chip.
...
Add a protocol decoder for the Cyrustek ES51919 LCR meter chip.
This chipset (together with ES51920 front-end) is supposedly used
by multiple different portable LCR meters including at least
DER EE DE-5000, Yihua V&A VA520, Mastech MS5308, Uni-T UT612,
CEM DT-9935 and various OEM rebadges of them.
The communication protocol seems to be implemented on the Cyrustek
chip itself so all the different models are expected to use the
same protocol if they implement a host connection. Unfortunately
the protocol is not available in the public documentation of the
chipset, so this implementation is based on reverse engineering it
from traffic captures.
The actual connection between the meter and the host computer may be
different from meter to meter even when based on the same chip. This
module implements a decoder for the protocol and some common helper
functions for interfacing with the meter via an RS-232 serial port.
2014-10-13 00:56:11 +02:00
Janne Huttunen
02c7c482a6
Add pretty-printer for new units and flags.
...
Add support for printing henries and degrees as well as the new
reference and auto flags.
2014-10-12 23:19:05 +02:00
Aurelien Jacobs
76bc5f6376
usb: Simplify usb_get_port_path() and fix writing into a const char *.
2014-10-12 19:36:11 +02:00
Bert Vermeulen
d099d88021
Fix sr_dev_has_option().
...
This wasn't taking the SR_CONF_GET/_SET/_LIST flags into account.
Thanks to Janne Huttunen for spotting this.
2014-10-09 23:42:24 +02:00
Bert Vermeulen
f4d3a4fb9a
ols: Fix serial port timeout.
2014-10-08 03:00:47 +02:00
Bert Vermeulen
9e6d9bee2a
colead-slm: Fix serial port timeout.
2014-10-08 02:23:20 +02:00
Bert Vermeulen
2eb1612d46
atten-pps3xxx: Use serial_timeout().
2014-10-06 12:12:13 +02:00
Bert Vermeulen
c5cfc735e5
serial: Add serial_timeout().
...
This calculates a proper timeout value for blocking writes on the
given serial port, for the given number of bytes. Timeout is based
on a fixed 10ms OS overhead, baud rate, data bits and stop bits.
2014-10-06 12:10:25 +02:00
Bert Vermeulen
945cfd4fdd
atten-pps3xxx: Fix serial port timeout.
2014-10-05 12:29:28 +02:00
Bert Vermeulen
204014007f
fluke-dmm: Fix blocking serial write timeout.
2014-10-04 10:39:11 +02:00
Bert Vermeulen
95779b43b8
agilent-dmm: Fix blocking serial write timeout.
2014-10-04 10:39:11 +02:00
Bert Vermeulen
4ab01c3564
input/csv: Fix size_t printing.
2014-10-04 10:39:11 +02:00
Martin Ling
9092e66888
Add a configurable read timeout to blocking SCPI reads, default 1s.
2014-10-03 13:40:41 +02:00
Martin Ling
eead278242
Add a timeout parameter to blocking serial calls.
...
Set this new parameter to 0 (no timeout) at every call site. This is
consistent with previous behaviour, so cannot cause any regressions.
Waiting forever for a serial operation is clearly always wrong. Without
specific knowledge of each device and driver however, I can't choose
appropriate timeouts for each call. The maintainers of these drivers
will need to do so, and also add appropriate handling of timeouts.
When this commit is merged, a bug should be entered for each driver
that is touched by it.
2014-10-02 22:06:16 +02:00
Bert Vermeulen
7ce59a3133
Avoid serial_write_blocking() warnings.
2014-10-02 16:01:27 +02:00
Martin Ling
081c214eac
Fix similar broken error handling on several serial calls.
2014-10-02 15:57:02 +02:00
Bert Vermeulen
7f22cd9554
kecheng-kc-330b: Fix missing time/frequency weighting.
2014-10-02 15:06:36 +02:00
Bert Vermeulen
8219214ff0
hantek-dso: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 15:03:18 +02:00
Bert Vermeulen
385cb66058
demo: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 15:02:14 +02:00
Bert Vermeulen
f4d0020ec6
fluke-dmm: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 15:00:37 +02:00
Bert Vermeulen
65c8d48f14
chronovu-la8: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 14:58:57 +02:00
Bert Vermeulen
382cb19f29
asix-sigma: Trigger code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 14:53:20 +02:00
Bert Vermeulen
90486ba835
agilent-dmm: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 14:11:35 +02:00
Bert Vermeulen
f3616a0857
scpi/vxc: Avoid NULL dereference.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 14:07:31 +02:00
Bert Vermeulen
18078d0532
input/csv: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 13:59:44 +02:00
Bert Vermeulen
74e1f6f53c
input/chronovu_la8: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 13:55:37 +02:00
Bert Vermeulen
577a9fe423
input/binary: Code cleanup.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 13:55:21 +02:00
Bert Vermeulen
6409821143
input: Avoid NULL dereference.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 13:51:19 +02:00
Bert Vermeulen
19e43ab21b
sr_parse_sizestring: Deal with invalid strings better.
...
This cleans up a warning generated by clang's static analyzer.
2014-10-02 12:57:19 +02:00
Bert Vermeulen
d386a52f64
Clean up sr_session_load().
...
This cleans up some warnings generated by clang's static analyzer.
The function now also returns SR_ERR to signify the specified filename
does not point to a valid session file.
Other SR_ERR_* returns indicate a session file was found, but loading
failed.
2014-10-02 11:32:52 +02:00
Bert Vermeulen
753793eff5
Clean up internal input API docs.
2014-09-30 01:49:58 +02:00
Bert Vermeulen
60107497fe
input: Use SR_ERR_NA instead of SR_OK_CONTINUE.
2014-09-30 01:49:58 +02:00
Bert Vermeulen
d5cc282ff8
input: sr_input_free() is now a void function.
...
Its backend, input_module.cleanup(), is now also a void function.
2014-09-30 01:49:58 +02:00
Bert Vermeulen
7066fd4660
input: Add sr_input_end().
...
This signifies to the module instance no more input will come. This
will cause the module to process any data it may have buffered. The
SR_DF_END packet will also typically be sent at this time.
2014-09-30 01:49:58 +02:00
Bert Vermeulen
89da5b3b54
input: Free instance-private storage at instance free.
2014-09-30 01:49:58 +02:00
Bert Vermeulen
d018181331
input: Add sdi_ready flag to struct sr_input.
...
When an input module instance has received enough input to fully
populate the struct sr_dev_inst, sdi_ready is set to TRUE and its
receive() method returns immediately. Any remaining received data
is buffered until the next time the function is called.
2014-09-30 01:49:58 +02:00
Soeren Apel
66c91e2509
Removal of sdi->index, step 8: fix victor-dmm
2014-09-30 01:42:58 +02:00
Soeren Apel
bde9fbd197
Removal of sdi->index, step 7: fix testo
2014-09-30 01:42:58 +02:00
Soeren Apel
c79d4444fe
Removal of sdi->index, step 6: fix sysclk-lwla
2014-09-30 01:42:58 +02:00
Soeren Apel
65340dd5df
Removal of sdi->index, step 5: fix ikalogic-scanalogic2
2014-09-30 01:42:58 +02:00
Soeren Apel
aed4ad0bea
Removal of sdi->index, step 4: fix trivial sr_dev_inst_new() calls
2014-09-30 01:42:58 +02:00
Soeren Apel
f220936473
Removal of sdi->index, step 3: sr_dev_inst_new() calls for input mods
2014-09-30 01:42:58 +02:00
Soeren Apel
c6805a02cc
Removal of sdi->index, step 2: remove it from sr_session_load()
2014-09-30 01:42:58 +02:00
Soeren Apel
1b9e567b08
Removal of sdi->index, step 1: remove it from headers and helper funcs
2014-09-30 01:42:58 +02:00
Soeren Apel
ce7d3578e3
saleae-logic16: Use physical USB connection instead of sdi->index
2014-09-30 01:42:58 +02:00
Soeren Apel
71580ef1f3
Remove sdi->index from openbench-logic-sniffer and pipistrello-ols
2014-09-30 01:42:58 +02:00
Soeren Apel
395206f460
hantek-dso: Use physical USB connection instead of sdi->index
2014-09-30 01:42:58 +02:00
Soeren Apel
ee4f9bb1bd
zeroplus-logic-cube: Use physical USB connection instead of sdi->index
2014-09-30 01:42:58 +02:00
Soeren Apel
5e2c86eb31
fx2lafw: Use physical USB connection instead of sdi->index
...
Previously, sdi->index was used to tell several identical fx2lafw-compatible
devices apart. This was a bit of a hack, so this patch makes it use physical
device connections instead. They're guaranteed to remain the same even if
the USB device reconnects.
2014-09-27 12:49:44 +02:00
Bert Vermeulen
8143cfdc90
Add sr_packet_copy/_free functions.
...
These will be used to make a copy of a packet on the session bus,
valid for the duration of the device instance that generated it.
2014-09-26 01:35:02 +02:00
Martin Ling
98edee7926
serial: Eliminate serial_read(), serial_write() and SERIAL_NONBLOCK.
2014-09-24 23:30:32 +02:00
Martin Ling
6c592ece70
std_serial_dev_open: Remove SERIAL_NONBLOCK flag.
...
All calls in drivers are now explicitly (non)blocking.
2014-09-24 23:30:32 +02:00
Martin Ling
406e0c79cf
scpi_serial: Mark read/write calls nonblocking, remove SERIAL_NONBLOCK.
...
These calls were already nonblocking. Having marked them as such, the flag can
be removed.
2014-09-24 23:30:32 +02:00
Martin Ling
7ef93fb09f
tondaj-sl-814: Remove SERIAL_NONBLOCK flag.
...
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:32 +02:00
Martin Ling
539a85596f
tondaj-sl-814: Mark serial read/write calls as blocking.
...
These calls are executed from an event handler and were previously nonblocking,
but they have no partial read/write handling. The code is already marked TODO
for improvement.
2014-09-24 23:30:32 +02:00
Martin Ling
47d98603e7
tondaj-sl-814: Mark serial read call as nonblocking.
...
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. Partial reads are handled.
2014-09-24 23:30:31 +02:00
Martin Ling
9333691aaf
teleinfo: Mark serial read as nonblocking, remove SERIAL_NONBLOCK flag.
...
This call was already nonblocking due to the flag.
2014-09-24 23:30:31 +02:00
Martin Ling
4ded59eef0
openbench-logic-sniffer: Remove SERIAL_NONBLOCK flag.
...
All calls in this driver are already explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling
d12ef776d3
norma-dmm: Remove SERIAL_NONBLOCK flag.
...
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling
92714255b3
norma-dmm: Make serial write call block.
...
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
2014-09-24 23:30:31 +02:00
Martin Ling
8849f45ad7
norma-dmm: Make write call block.
...
This call was previously nonblocking, but has no partial write handling.
It is called in the scan where it is free to block.
2014-09-24 23:30:31 +02:00
Martin Ling
32950cc071
norma-dmm: Mark serial read call as nonblocking.
...
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. It only reads one byte, and a zero result is handled
appropriately.
2014-09-24 23:30:31 +02:00
Martin Ling
5b980134c5
motech-lps-30x: Remove SERIAL_NONBLOCK.
...
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling
856dccb7a6
motech-lps-30x: Make serial write call block.
...
This call was previously explicitly nonblocking, but has no partial write
handling. It sends a short packet so should be OK to block, most likely the
output buffer will be empty anyway.
2014-09-24 23:30:31 +02:00
Martin Ling
e050124095
motech-lps-30x: Mark serial read call as nonblocking.
...
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. It only reads one byte, and a zero result is handled
appropriately.
2014-09-24 23:30:31 +02:00
Martin Ling
51056d61ec
mic-985xx: Remove SERIAL_NONBLOCK call.
...
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling
3e2373247c
mic-985xx: Make serial write call block.
...
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
2014-09-24 23:30:31 +02:00
Martin Ling
98842e53eb
mic-985xx: Mark serial read as nonblocking.
...
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. Partial reads are handled.
2014-09-24 23:30:31 +02:00
Martin Ling
e13e354f89
gmc-mh-1x-2x: Remove SERIAL_NONBLOCK flag.
...
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling
612db3c44b
gmc-mh-1x-2x: Make serial write calls block.
...
These calls are executed from an event handler and were previously nonblocking,
but have no partial write handling. They send short packets so should be OK to
block, most likely the output buffer will be empty anyway.
Fix error handling for some: serial_write can return any negative error code.
2014-09-24 23:30:30 +02:00
Martin Ling
e1960467ce
gmc-mh-1x-2x: Make serial write call block, and fix error handling.
...
This call was previously nonblocking, but there is no handling of partial
writes. It is called from config_set where it is free to block.
Also fix error handling: serial_write can return any negative error code,
not just -1.
2014-09-24 23:30:30 +02:00
Martin Ling
4a0eda2b70
gmc-mh-1x-2x: Mark serial read calls as nonblocking.
...
These calls were already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. They only read one byte. A return value of zero is not
handled, but should not occur in theory due to the G_IO_IN check. It might be
good to add handling of a zero return anyway, since I'm not sure if this is
always accurate.
2014-09-24 23:30:30 +02:00
Martin Ling
0714a010cc
gmc-mh-1x-2x: Mark serial read call as nonblocking.
...
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. It only reads one byte, and a zero result is handled
appropriately.
2014-09-24 23:30:30 +02:00