Commit Graph

1776 Commits

Author SHA1 Message Date
Gerhard Sittig 11e3a56380 srzip: don't access non-existing option
The srzip output module dropped support for the "filename" option in
commit 37875f7506 on 2015-07-30, but still used to assign to slot
options[0] which clobbers the array's sentinel. Remove those accesses
to the non-existing option.
2018-02-09 21:59:18 +01:00
Uwe Hermann 793e9963b8 hantek-4032l: Fix a compiler warning.
api.c: In function 'config_set':
  api.c:352:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint64_t' [-Wformat=]
       sr_err("invalid sample range 2k...64M: %ld",
       ^
2018-02-09 21:44:23 +01:00
Uwe Hermann 3347fe26a0 beaglelogic: Fix a compiler warning.
beaglelogic_tcp.c: In function 'beaglelogic_tcp_send_cmd':
 beaglelogic_tcp.c:114:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Wformat=]
     sr_dbg("Only sent %d/%lu bytes of command: '%s'.", out,
     ^
2018-02-09 21:44:23 +01:00
Gerhard Sittig 93b5cd6919 yokogawa-dlm: fix several compiler warnings (assignment, memory)
Check pointers' validity before dereferencing them. Release partially
allocated memory in an error path. Remove an assignment which never took
effect.

This was reported by clang's scan-build.
2018-02-09 21:37:40 +01:00
Gerhard Sittig 2da5c95f3d tondaj-sl-814: fix a potential memory leak
Release an allocated device instance in an error path.

This was reported by clang's scan-build.
2018-02-09 21:37:40 +01:00
Gerhard Sittig aedbf89d85 sysclk-lwla: silence potential NULL dereference compiler warning
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:40 +01:00
Gerhard Sittig 08eba2d301 scpi-pps: silence potential NULL dereference compiler warning
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:40 +01:00
Gerhard Sittig 6a821db6f2 saleae-logic-pro: silence "assigned, not used" compiler warning
Remove an assignment that never took effect.

This was reported by clang's scan-build.
2018-02-09 21:37:40 +01:00
Gerhard Sittig 0306ae30b6 rigol-ds: silence potential NULL dereference compiler warning
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig b04cbd0ba3 ols, pipistrello-ols: silence "assigned, not used" compiler warning
Each code path either assigns to 'flags', or leaves the routine. There
is no potential path that leaves the variable at the initially assigned
value, so the assignment took no effect. Remove it.

Nit: Trim the source code line length while we are here.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig 8eadb70a37 norma-dmm: fix a potential memory leak
Release an allocated buffer in an error path.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig e4924d752b motech-lps-30x: fix several compiler warnings
Check pointers' validity before dereferencing them. Explicitly assign a
default value to variables, before conversion routines conditionally
assign the "real" value (and don't in case of conversion errors). This
avoids processing "garbage" data.

Strictly speaking I cannot see how the conversion routine returns OK and
has _not_ assigned a result. But the explicit assignment won't harm
either, and matches the fallback when the conversion fails (detectibly).
Which means that runtime behaviour won't change.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig fe535a89c9 maynuo-m97: fix potential NULL dereference
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig 4072d5b42f manson-hcs-3xxx: fix potential NULL dereference
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig f62c2ad65d lecroy-xstream: fix several compiler warnings (assignment, memory)
Remove an assignment that won't take effect. Check pointers' validity
before dereferencing. Fix a memory leak.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig b65adcedb8 lascar-el-usb: fix potential NULL dereference and memory leak
Check for successful allocation of multiple memory ranges, and release
partial allocations in the error path when one of them failed. This
fixes a potential memory leak, as well as avoids NULL dereferences.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig fc69eecca0 korad-kaxxxxp: fix potential NULL dereference
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig 1674225a2f hp-3457a: fix potential NULL dereference
Check the active channels' list for not being empty, before
dereferencing pointers.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig e93ca8a4d6 hantek-6xxx: fix potential NULL dereference
Check pointers' validity before dereferencing.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig b0e80e9aa9 hameg-hmo: fix several compiler warnings (assignments, memory)
Silence warnings about assigned values that never get used, potential
NULL deference, and potential memory leaks.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig 56e9672b11 gmc-mh-1x-2x: fix potential memory leak
The scan_2x_bd232() routine used to always prepare one spare context,
and filled it in when a device was found, just to allocate another one
and continue scanning.

Free the last allocated context unconditionally, as it was allocated
unconditionally, and never used.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig 0d1c51f57f fx2lafw: silence "NULL dereference" compiler warning
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:37:39 +01:00
Gerhard Sittig f6051b9eca ftdi-la: silence "assigned but never used" compiler warning
Stick with the prepared but unfinished "limit msec" code path, but
silence the warning about an unused variable value.

This was reported by clang's scan-build.
2018-02-09 21:37:35 +01:00
Gerhard Sittig 051e4beb79 dreamsourcelab-dslogic: avoid division by zero
Do not align to block_size when its value is zero.

This was reported by clang's scan-build.
2018-02-09 21:34:17 +01:00
Gerhard Sittig 8e2fd23acb dreamsourcelab-dslogic: avoid NULL pointer dereference
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:34:17 +01:00
Gerhard Sittig 755eb22156 chronovu-la: avoid NULL pointer dereference
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:34:17 +01:00
Gerhard Sittig 05b0cc416f beaglelogic: fixup use of uninitialized data in TCP routines
Make sure that failure to communicate via TCP results in access to
uninitialized data.

This was reported by clang's scan-build.
2018-02-09 21:34:17 +01:00
Gerhard Sittig 71f2000bfb beaglelogic: fixup memory leak in the TCP command send routine
Release allocated memory in an error code path.

This was reported by clang's scan-build.
2018-02-09 21:34:17 +01:00
Gerhard Sittig f6c685e4d3 atten-pps3xxx: silence NULL dereference compiler warnings
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 21:34:17 +01:00
Gerhard Sittig 7ee8511be4 session_driver: avoid division by zero, catch API violation
Avoid a division by zero, by not using a zero unitsize in a modulo
operation. As a byproduct, avoid processing and counting input that
neither has analog nor logic data. This should never have happened,
but the change now catches the error if invalid input is seen.

This was reported by clang's scan-build.
2018-02-09 21:34:09 +01:00
Gerhard Sittig f129014ca4 session: fixup access to uninitialized memory
The sr_packet_copy() routine could have written to an arbitrary memory
location. Make sure to allocate the space before writing to it, and
check for successful allocation before accessing the memory.

It's assumed that this error never took effect, as the routine appears
to be unused.

This was reported by clang's scan-build.
2018-02-09 21:32:11 +01:00
Gerhard Sittig da6f107eff scpi: avoid uninitialized use of a variable
The 'opc' variable was only conditionally assigned to (depends on
successful SCPI communication). Ensure there always is a known value.

This was reported by clang's scan-build.
2018-02-09 21:32:11 +01:00
Gerhard Sittig d3ec7035bc output/srzip: silence "use after free" compiler warning
Defer memory g_free() until after the data gets accessed one last time.

This was reported by clang's scan-build.
2018-02-09 21:32:04 +01:00
Gerhard Sittig a21fef07b6 output/csv: silence NULL dereference compiler warnings
Check pointers' validity before dereferencing them.

This was reported by clang's scan-build.
2018-02-09 20:52:26 +01:00
Gerhard Sittig 603643fa71 input/raw_analog: silence "use after free" compiler warning
The cleanup() call will void the memory which 'inc' points to. Move the
dereference before the release.

This was reported by clang's scan-build.
2018-02-08 21:47:21 +01:00
Soeren Apel d8fb599c67 lecroy-xstream: Wait for trigger before acquiring additional frames 2018-01-11 02:21:50 +01:00
Soeren Apel 724b4945d5 lecroy-xstream: Properly handle a stopping acquisition 2018-01-11 02:21:50 +01:00
Soeren Apel 2498512972 lecroy-xstream: Keep acquiring infinitely if no frame limit is set 2018-01-11 02:21:50 +01:00
Uwe Hermann d3f14af7ed hantek-dso: Capture ratio is a uint64_t.
From src/hwdriver.c:

  {SR_CONF_CAPTURE_RATIO, SR_T_UINT64, "captureratio",
          "Pre-trigger capture ratio", NULL},
2018-01-11 02:21:50 +01:00
Uwe Hermann 04069272b4 hantek-dso: config_set(): Shorten SR_CONF_CAPTURE_RATIO case.
The sr_config_set() wrapper already checks for SR_CONF_CAPTURE_RATIO
being 0..100.
2018-01-11 02:21:50 +01:00
Uwe Hermann be702d16d0 hantek-dso: Add missing SR_PRIV. 2018-01-11 02:21:50 +01:00
Uwe Hermann 6deb361bbf hantek-dso: Sample rate is a uint64_t.
Also make 'base' uint64_t, otherwise there'll be compiler warnings.
2018-01-11 02:21:50 +01:00
Uwe Hermann ab8df2b1a6 hantek-dso: Random cosmetics, drop unneeded debug output. 2018-01-11 02:21:50 +01:00
Philipp Marek 8f484ca78e hantek-dso: dso2250: Fix capture runaway, only do the requested number of frames.
After the first capture ->num_frames never got to be _equal_
to ->limit_frames; fixed by resetting to zero in dev_acquisition_stop(),
and protected against similar problems in the future by switching to
greater-or-equal instead.
2018-01-11 02:21:50 +01:00
Philipp Marek 12f62ce620 hantek-dso: dso2250: Allow setting TRIGGER_LEVEL as well. 2018-01-11 02:21:50 +01:00
Philipp Marek 16a1dca4ad hantek-dso: Fix a memory leak. 2018-01-11 02:21:50 +01:00
Philipp Marek be10b96d40 hantek-dso: Fix segfault when accessing already free()d memory.
This fix was guessed from other drivers' code.

This fixes bug #458.
2018-01-11 02:21:30 +01:00
Philipp Marek 95983cc3fe hantek-dso: dso2250: It's not HORIZ_TRIGGERPOS but CAPTURE_RATIO.
Seems a bit unfortunately named; if my current guess is right,
perhaps it should be
  :%s/SR_CONF_HORIZ_TRIGGERPOS/SR_CONF_HORIZ_DISPLAYOFFSET/g
2018-01-11 01:48:57 +01:00
Philipp Marek 11e3319656 hantek-dso: dso2250: Support sample rates correctly.
Fast mode not done yet, only 125MHz allowed right now.
2018-01-10 22:34:23 +01:00
Philipp Marek 3b2b703177 hantek-dso: dso2250: Report the sample rate back.
So that cursor (and other) measurements and the time axis are correct.
2018-01-10 22:34:20 +01:00
Philipp Marek 87f56d0178 hantek-dso: dso2250: Initial support for the Hantek DSO 2250.
Crashes after first acquiration, but at least it _does_ acquire data.
2018-01-10 22:33:37 +01:00
Andreas Zschunke 5089a14345 hantek-4032l: Add initial driver implementation.
[Note: This patch is basically a squashed version of the initial driver
commits by Andreas Zschunke <andreas.zschunke@gmx.net>, two fixes by
Andrej Valek <andy@skyrain.eu>, and various coding style / cosmetic
fixes by Uwe Hermann <uwe@hermann-uwe.de> to make the driver a lot more
consistent with the rest of the libsigrok code-base.]
2018-01-05 20:28:14 +01:00
Andreas Zschunke 6a25fa4238 hantek-4032l: Initial driver skeleton. 2018-01-05 18:22:20 +01:00
Michał Janiszewski be61937929 zeroplus-logic-cube: Add LAP-16032U 2018-01-01 14:41:23 +01:00
Stefan Brüns bbcffe51d2 rigol-ds: Fix crash when fetching logic channels
When refactoring the code, some places where sr_scpi_send was replaced
by rigol_ds_config_set the first argument was not changed from sdi->conn
to sdi. Fix the remaining ones.

Fix: https://sigrok.org/bug/1073

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2017-12-26 19:21:42 +01:00
Uwe Hermann 8e45ba3f4e zeroplus-logic-cube: Fix Logian-16L metadata.
According to a vendor software screenshot of a user on IRC, this
device is detected as having 200MHz max. samplerate and 128kBit
memory per channel.
2017-12-25 15:42:06 +01:00
Uwe Hermann fb1d341d6e zeroplus: Add support for Meilhaus Logian-16L.
Untested yet, but pretty likely to work.
2017-12-25 14:30:00 +01:00
Uwe Hermann 42d14d9108 sysclk-lwla: Fix a regression with (at least) the LWLA1034.
This regression was introduced in f1ba6b4b2c.

Due to how the sysclk-lwla driver does up to 3 open/close operations in
one dev_open() API callback we cannot rely on the sr_dev_open() and
sr_dev_close() wrappers setting the sdi->status variable in this case.

Tested on LWLA1034.
2017-12-25 12:48:58 +01:00
Uwe Hermann 6c1a4cb44c sysclk-lwla: Fix a segfault in dev_close(). 2017-12-24 15:24:35 +01:00
Uwe Hermann 56c8dd821e sr_dev_close(): Drop unneeded variable. 2017-12-24 15:23:40 +01:00
Gerhard Sittig f9bc17d4c0 input/vcd: fixup VCD timestamp to sigrok samplenum mapping
When processing of large VCD input files was spread across multiple
parse_contents() invocations, the resulting sigrok stream of sample data
had gaps in them and total timing was off. For instance 74ms of input
data were interpreted as spanning some 600ms or 300ms, depending on the
number of channels in the input stream.

Move the "previous timestamp" variable to the input module context. This
eliminates the inappropriate gaps and fixes the translation of VCD file
timestamps to sigrok sample numbers.

This fixes bug #1075.
2017-12-22 11:47:03 +01:00
Uwe Hermann 51d64bf501 output/csv: Fix a typo. 2017-12-21 16:06:48 +01:00
Uwe Hermann 767d4f37c7 fx2lafw: Update comments listing supported devices. 2017-12-17 20:19:13 +01:00
Uwe Hermann 6605f1b9bb zeroplus-logic-cube: Add LAP-C(16128+) USB VID/PID.
Untested, so we don't know for sure it'll work.

This fixes bug #1045.
2017-12-17 19:46:23 +01:00
Stefan Brüns bd70ec4b73 hameg-hmo: Forward internal channel state to sigrok channel state
This fixes bug #883.
2017-12-10 14:24:36 +01:00
Holger Müller 41802ca4c0 korad-kaxxxxp: Add support for Korad KD3005P 2017-12-09 23:17:12 +01:00
Frank Stettner 7c517d02f7 scpi-pps: Channel group device options for HP 663xx 2017-11-11 19:46:52 +01:00
Frank Stettner 4f0463a079 drivers: Fix locale dependent string to float conversion
Some drivers used locale dependent functions for converting strings
to float/double values. These functions fail when the decimal mark
is a "," in the locale settings but the string contains a ".".

This fixes bug #1064.
2017-11-11 19:46:52 +01:00
Frank Stettner 688e44ae06 output/analog: Display META packets 2017-11-11 19:46:52 +01:00
Frank Stettner 2472271e08 arachnid-labs-re-load-pro: Add SR_DF_META packets for changed values/states 2017-11-11 19:46:44 +01:00
Frank Stettner b76a414d51 arachnid-labs-re-load-pro: Stop monitoring when open/close device 2017-11-11 19:46:44 +01:00
Frank Stettner 0b7c07850c conrad-digi-35-cpu: Add SR_CONF_LIST for voltage_target and current_limit. Change current_limit lower limit. 2017-11-07 12:07:19 +01:00
Frank Stettner ae32859759 lipgpib: Enhanced error message 2017-11-07 12:04:30 +01:00
Soeren Apel 767ca13532 demo: Properly handle low samplerates
A "low samplerate" in this case means anything where
samples_todo is less than SAMPLES_PER_FRAME. This case
wasn't handled properly before, resulting in wrong
amounts of data being sent out.
2017-11-02 14:28:16 +01:00
Soeren Apel e0b6855bd4 lecroy-xstream: Fix sample rate
We can't use the memory size command because it returns
the *maximum* memory used, not the *actual* memory used.
Hence, we only know the number of samples per div once
sample data actually comes in.
2017-11-02 07:29:22 +01:00
Soeren Apel 86f76e6cae lecroy-xstream: Perform acquisition if no data is available 2017-11-02 07:29:22 +01:00
Soeren Apel 6e9606dbae lecroy-xstream: Comment/style fixes 2017-11-02 07:29:22 +01:00
Timo Rothenpieler 095eba19d6 hantek-6xxx: use lower MAX_PACKET_SIZE on Windows
WinUSB seems to have a maximum size of 2M, reads of a larger size fail.

This fixes bug #1048.
2017-10-19 15:01:06 +02:00
Soeren Apel 79100d4e8b lecroy-xstream: Implement config_channel_set API callback 2017-10-03 17:31:48 +02:00
Soeren Apel 5000c12f57 lecroy-xstream: Fix trigger source/slope 2017-10-03 17:31:48 +02:00
Soeren Apel 952c7376e4 lecroy-xstream: Random whitespace/style fixes 2017-10-03 17:31:48 +02:00
Soeren Apel e7d2cd1e05 lecroy-xstream: Use best-effort strategy for unknown models
As there is a huge range of supported LeCroy scopes, naming
the IDN response for every single one of them is going to be
impossible. Hence, it makes more sense to treat all LeCroy
devices as if they were scopes and supported. This approach
lets users try to see how far they get and if they run into
issues, they can then be treated separately - e.g. by creating
a custom device profile.
Unless we do this, the vast majority of LeCroy scopes will
not be recognized by the driver.
2017-10-03 17:31:48 +02:00
Sylvain Pelissier 6158728cdb lecroy-xstream: Fix COMM_HEADER and COMM_FORMAT 2017-10-03 17:31:48 +02:00
Sylvain Pelissier 47bbc4b531 SCPI: Ignore IDN header in *IDN? response 2017-10-03 17:31:48 +02:00
Soeren Apel f55bea7626 Demo: Implement multi-frame development feature 2017-10-03 17:31:48 +02:00
Soeren Apel b7602846fd Add std_session_send_frame_begin/end helpers 2017-10-03 17:31:48 +02:00
Joel Holdsworth 55584d38dd dreamsourcelab-dslogic: Fixed deinterleaving when non-contiguous set of channels are enabled 2017-09-26 21:48:04 +02:00
Uwe Hermann cb17f580b9 beaglelogic: Inline beaglelogic_devc_alloc(). 2017-09-26 19:51:55 +02:00
Uwe Hermann f82525e60d beaglelogic: Minor whitespace and consistency fixes. 2017-09-26 19:51:55 +02:00
Uwe Hermann 00f2e9bc6b beaglelogic: No need to check g_free() argument.
glib's g_free() function will gracefully handle NULL as input.
2017-09-26 19:51:55 +02:00
Kumar Abhishek a31010b3e4 beaglelogic: Coding style fixes
In beaglelogic_native.c and beaglelogic_tcp.c

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek ca0d1a21af beaglelogic: Fix regression in continuous sampling
Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek 3124d3bc48 beaglelogic: Update copyright notices in all files
Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek f154b40ddd beaglelogic: Fix compiler warnings in beaglelogic_tcp.c
Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek a486fca9e2 beaglelogic: Close device after detection, and reopen upon open
Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek f955ffe83f beaglelogic: Changes for proper operation in PulseView
Set samplelimit to a sane value (was causing PulseView to
crash earlier), as well as advertise samplerate using SR_CONF_LIST
so that PulseView can show the sample rates.

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek d6f20d0366 beaglelogic: Fix PulseView crash on close
Use dev_clear instead of std_dev_clear to clean up our private
data structure.

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek f7d7ee82dd beaglelogic: Add beaglelogic_tcp_drain function
The function drains off all the remaining data in the receive socket
and is triggered before starting a capture and after a capture is
completed. In the absence of this function, there is a possibility of
data corruption and also the NodeJS TCP server throws an error if the
buffer is not completely read out before the socket is closed.

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek 9b2b3ef93e beaglelogic: Implement TCP protocol
BeagleLogic now supports two modes of interface - one being the
native mode running on an ARM system like the BeagleBone Black
and the other mode acting like a TCP client for the BeagleLogic
server running off a BeagleBone compatible system. This makes it
convenient for desktop users to retrieve samples from BeagleLogic,
no more copying files and SSHing into the BeagleBone hardware in
order to use BeagleLogic.

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek 0bca2e75f5 beaglelogic: Re-organize to prepare for TCP support
Organize driver functions into an ops structure (there will be
separate structures for both native and TCP mode of operation).

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek 88d2037bca beaglelogic: Split beaglelogic code into .h and .c file
The code earlier was in a single .h file, so it's now separated into a C file
and H file

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek e71062d99b beaglelogic: Flexible sampleunit depending on enabled channels
If a channel in the higher-than-8-bit group is enabled then use
16-bit captures. Otherwise just do 8-bit captures.

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:46 +02:00
Kumar Abhishek 55f26c42de beaglelogic: Remove 'as root' from warning message
Starting with Linux kernel version 4.9, BeagleLogic attributes
setting does not require root permissions.

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:14:31 +02:00
Kumar Abhishek 713f3f8480 beaglelogic: Enable seamless continuous capturing
This is done by setting triggerflags to 1 unless SR_CONF_LIMIT_SAMPLES is set

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:06:34 +02:00
Kumar Abhishek 6eab3021ec beaglelogic: Update scan() to return all 14 channels by default
This is unlike the previous behavior to return 8 channels and then
use logic_channels to get all the 14 channels

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
2017-09-26 18:06:34 +02:00
Uwe Hermann 1f488f50b9 sr_parse_rational(): Make is_negative a bool. 2017-09-24 21:17:51 +02:00
Stefan Brüns 41c47f2c6a strutil: Fix sr_parse_rational for integral parts between -0 and -1
Values like '-0.1' would be parsed as being positive, as the integral
type does not discern +0 and -0. Also allow values without leading
integral value, to match behaviour of strtod/sr_atof.
2017-09-24 21:04:46 +02:00
Joel Holdsworth f05600f4be dreamsourcelab-dslogic: Fixed enabling of triggers 2017-09-19 00:31:11 +02:00
Joel Holdsworth 16d4c982a3 dreamsourcelab-dslogic: Moved devc and usb assignment into initializers 2017-09-19 00:31:11 +02:00
Joel Holdsworth 9f58023066 dreamsourcelab-dslogic: Improved naming of variables in fpga_configure 2017-09-19 00:31:11 +02:00
Joel Holdsworth b7a3d79e46 dreamsourcelab-dslogic: Fixed trigger-stages field in trig_glb 2017-09-19 00:31:11 +02:00
Joel Holdsworth b23ecd6ce7 dreamsourcelab-dslogic: Simplified trigger population 2017-09-19 00:31:06 +02:00
Uwe Hermann 19c9b17648 serial-dmm: Add PeakTech 4390A alias.
This is a rebadged Metex M-3860M.
2017-09-15 22:03:32 +02:00
Uwe Hermann 86a1571135 dreamsourcelab-dslogic: Fix incorrect default threshold setting.
This was leading to an invalid threshold config value and indirectly
to frontend issues.

Slightly modified patch from James Churchill <pelrun@gmail.com>, thanks!
2017-09-14 11:15:06 +02:00
Frank Stettner 57837aeda5 conrad-digi-35-cpu: Fix key names for setting voltage and current 2017-09-13 14:11:07 +02:00
Frank Stettner fcc73918b0 serial-dmm: Add Metex M-3860M 2017-09-13 14:03:40 +02:00
Frank Stettner eea576077b conrad-digi-35-cpu: Add and use missing dev_context structure 2017-09-13 14:03:40 +02:00
Uwe Hermann bc98407b8f dreamsourcelab-dslogic: config_list: Handle SR_CONF_TRIGGER_MATCH.
This fixes bug #1032.
2017-09-13 13:05:42 +02:00
Uwe Hermann 7bf81cb7a9 chronovu-la: Silence overly verbose log message.
This triggered all kinds of unrelated / confusing log messages
for unrelated hardware devices, e.g.:

  sr: [00:00.613080] chronovu-la: Unknown iProduct string 'USB-based Instrument'.
  sr: [00:00.614374] chronovu-la: Unknown iProduct string 'GL3220      '.
  sr: [00:00.614907] chronovu-la: Unknown iProduct string 'USB 3.0 HUB      '.
  sr: [00:00.615558] chronovu-la: Unknown iProduct string 'USB 2.0 HUB      '.
  sr: [00:00.619846] chronovu-la: Unknown iProduct string 'Bluetooth USB Host Controller'.
  sr: [00:00.620411] chronovu-la: Unknown iProduct string 'USB 3.0 HUB      '.
  sr: [00:00.624293] chronovu-la: Unknown iProduct string 'UAC1 DAC'.
  sr: [00:00.627849] chronovu-la: Unknown iProduct string 'BRCM20702 Hub'.
  sr: [00:00.628640] chronovu-la: Unknown iProduct string 'USB 2.0 HUB      '.
  sr: [00:00.674777] chronovu-la: Unknown iProduct string 'USB2223'.
  sr: [00:00.675034] chronovu-la: Unknown iProduct string ''.
  sr: [00:00.675180] chronovu-la: Unknown iProduct string ''.
  sr: [00:00.675205] hwdriver: Scan found 0 devices (chronovu-la).
2017-09-12 22:15:32 +02:00
Marcus Comstedt 393375e1fe drivers: Remove dependency on linker implementation specific behaviour 2017-09-02 17:06:37 +02:00
turboaffe 9520fd4134 manson-hcs-3xxx: enabled output guaranteed write 2017-08-19 19:21:54 +02:00
turboaffe 6508294dca manson-hcs-3xxx: added new name for 3304, adjustment to new manson fw 2017-08-19 19:21:54 +02:00
Gerhard Sittig 5753d2e84b brymen-bm86x: support channel selection (enable/disable channels)
The previous implementation unconditionally submitted analog data
whenever values could get extracted out of received serial packets.
This commit checks the channels' enabled state before submission. Care
is taken to obey the user's acquisition limits, exclusively counting
submitted not received values.
2017-08-19 19:21:54 +02:00
Gerhard Sittig 503519b70a lsr/es51919: support channel selection (enable/disable P1/P2)
Upon reception of serial data from the ES51919 LCR chipset, the data for
channels P1 and P2 was extracted from the packet, and unconditionally got
sent to the sigrok session.

Do check the channels' enabled state before submission. This fixes for
serial-lcr what recently got reported for a Brymen DMM. Tested with

  $ sigrok-cli -d peaktech-2170:conn=/dev/ttyUSB0 --channels P2

and other --channels specifications.
2017-08-19 19:21:53 +02:00
Gerhard Sittig 12788e7e40 lcr/es51919: clean but don't free dev context in cleanup callback
The es51919_serial_clean() routine is called by std_dev_clear_with_callback().
Common code unconditionally frees the 'priv' part. The cleanup callback only
shall release descending resources which are local to the callee and opaque
to the caller.

This fixes a double free error. Tested with PeakTech 2170.

  $ sigrok-cli -d peaktech-2170:conn=/dev/ttyUSB0 --show
2017-08-19 19:21:51 +02:00
Uwe Hermann 1503d4571b resource: Also check $SIGROK_FIRMWARE_DIR for firmware files.
If the SIGROK_FIRMWARE_DIR environment variable is specified, look there
first for firmware files.
2017-08-15 22:15:47 +02:00
Gerhard Sittig dde0175d19 asix-sigma: download sample data upon user initiated stop, too
When the acquisition was stopped before a configured limit was reached,
no sample data was retrieved. This is because the api.c stop routine did
unregister the receive callback.

Pass the stop request to the receive routine instead when stop is called
while the acquisition is still running. Have sample data downloaded very
much like it's done for reached limits, and existing logic will run the
stop routine again after state was advanced to "idle".

Extend the 'state' tracking while we are here, mark sample download as
well (that was omitted in the previous implementation). Though the
omission was non-fatal. Move the release of 'dram_line' to some earlier
location (as soon as the resource is not needed any longer), before some
rather complex calls to other routines will execute.

Reported-By: Michael Kaplan <M.KAPLAN@evva.com>
2017-08-11 18:52:23 +02:00
Uwe Hermann 379e95c587 drivers: Use serial_write_blocking() everywhere.
This fixes bug #962.
2017-08-07 14:22:52 +02:00
Uwe Hermann b5df922e4f sr_voltage_string(): Add a space before the unit.
This makes the output consistent with most of the other functions
in libsigrok.
2017-08-06 19:45:45 +02:00
Uwe Hermann d2391b5453 drivers: Use g_strdup_printf() where possible. 2017-08-06 19:38:31 +02:00
Uwe Hermann 8ebad34370 drivers: Random whitespace fixes. 2017-08-06 17:31:46 +02:00
Uwe Hermann db85496ed1 drivers: Simplify some more trigger slope settings. 2017-08-06 17:31:46 +02:00
Uwe Hermann 3782e57129 drivers: Reduce unnecessarily high indentation in some places. 2017-08-06 17:31:46 +02:00
Uwe Hermann 612336970d drivers: Consistently use the same method to check for !cg. 2017-08-06 17:31:46 +02:00
Uwe Hermann fcd6a8bdf1 drivers: Factor out std_cg_idx(). 2017-08-06 17:31:46 +02:00
Uwe Hermann d1ac53ccd5 drivers: Start counting at 0 for some loops. 2017-08-06 17:31:46 +02:00
Uwe Hermann b3fd09937c drivers: Use NUM_CHANNELS in favor of hardcoded values. 2017-08-06 17:31:46 +02:00
Uwe Hermann bd633efa32 drivers: Use std_*idx*() helpers in some more places. 2017-08-03 16:35:19 +02:00
Uwe Hermann 76f0fa5dfb lecroy-xstream: Use array-based approach for timebases/vdivs.
This makes the driver more consistent with the rest of the code-base
and allows us to use the new array helpers in a few more places.
2017-08-03 16:35:19 +02:00
Uwe Hermann 692716f5d1 drivers: Use array-based approach in some places.
This allows us to use the new array helpers in a few more places.
2017-08-03 16:35:19 +02:00
Uwe Hermann 373e92a491 drivers: Consistently name SCPI helper functions 'probe_device'. 2017-07-31 16:23:32 +02:00
Uwe Hermann 21fe5dba36 drivers: Drop some unneeded voltage_/volt_ prefixes. 2017-07-31 16:23:32 +02:00
Uwe Hermann e124cf9b7a drivers: Drop some unneeded _names suffixes. 2017-07-31 16:23:32 +02:00
Uwe Hermann efad7cccec drivers: SR_CONF_CAPTURE_RATIO fixes.
Move the check for the capture ratio being 0..100 into the wrappers,
drop unneeded helper functions, fix incorrect variable types, minor
other consistency fixes.
2017-07-31 16:23:32 +02:00
Uwe Hermann 758906aa71 drivers: Remove some unneeded 'ret' variables. 2017-07-31 16:23:31 +02:00
Uwe Hermann 50ccb36f20 drivers: Random SR_CONF_LIMIT_* cleanups.
Drop unneeded variables and checks (performed by the wrappers already).
2017-07-31 16:23:31 +02:00
Uwe Hermann 697fb6ddfc drivers: Factor out std_*_idx*(). 2017-07-31 16:23:31 +02:00
Uwe Hermann 94e64a0b89 drivers: Replace struct voltage_threshold with an array.
This makes the code-base more consistent and will allow for wider usage
of upcoming array helper functions.
2017-07-31 16:23:31 +02:00
Uwe Hermann 87dc541027 drivers: Move SR_ERR_CHANNEL_GROUP log messages to wrappers. 2017-07-31 16:23:31 +02:00
Uwe Hermann 00ed77f27c drivers/input: Remove some hardcoded values. 2017-07-31 16:23:31 +02:00
Uwe Hermann 95c1fe62f7 drivers: Use g_variant_new_printf() where possible. 2017-07-31 16:23:31 +02:00
Uwe Hermann 9fb9afb573 drivers: Factor out std_gvar_thresholds(). 2017-07-31 16:23:31 +02:00
Uwe Hermann 43995cda36 drivers: Factor out std_gvar_tuple_double(). 2017-07-31 16:23:31 +02:00
Uwe Hermann a162eeb2e8 drivers: Factor out std_gvar_tuple_u64(). 2017-07-31 16:23:31 +02:00
Uwe Hermann dd7a72ea69 drivers: Consistently use same indentation for config_*() API calls. 2017-07-31 16:23:31 +02:00
Uwe Hermann 58ffcf9712 std_gvar_tuple_array(): Change to allow for more ARRAY_AND_SIZE usage.
Thanks to Marcus Comstedt <marcus@mc.pp.se> for the hint!
2017-07-21 19:04:34 +02:00
Uwe Hermann 8dacbcf68f drivers: Consistently use the exact driver name as LOG_PREFIX. 2017-07-21 18:46:27 +02:00
Uwe Hermann f272d7ddc0 drivers: Consistently make LOG_PREFIX the first item after #includes. 2017-07-21 18:46:27 +02:00
Uwe Hermann b15ff1c92a drivers: Eliminate some unnecessary vendor/model #defines.
Most drivers use the vendor/model strings directly already; make all
of them do that consistently.
2017-07-21 18:46:26 +02:00
Uwe Hermann f8195cb2da drivers: Shorten some unnecessarily long arrays. 2017-07-21 17:06:40 +02:00
Uwe Hermann 76d10d1324 drivers: Consistently use the name trigger_matches[] everywhere. 2017-07-21 17:06:40 +02:00
Uwe Hermann 9e411f4be8 rigol-ds: config_set: Move error printing to wrapper. 2017-07-21 17:06:40 +02:00
Uwe Hermann 0f8bee7162 rigol-ds: Update a code comment. 2017-07-21 17:06:40 +02:00
Uwe Hermann 396cdca0c3 rigol-ds: Drop two unneeded #defines. 2017-07-21 17:06:40 +02:00
Uwe Hermann 53012da658 drivers: Use ARRAY_AND_SIZE where possible. 2017-07-21 17:06:40 +02:00
Uwe Hermann 105df67463 drivers: Factor out std_gvar_array_*(). 2017-07-21 16:54:05 +02:00
Uwe Hermann 7bc3cfe6ff drivers: Factor out std_gvar_min_max_step_thresholds(). 2017-07-21 16:54:05 +02:00
Uwe Hermann bcee129962 scpi-pps: Change some floats to doubles.
This makes the code more consistent with the rest of the code-base
and also allows std_gvar_min_max_step_array() to work here.

Without this change:

  src/hardware/scpi-pps/api.c: In function ‘config_list’:
  src/hardware/scpi-pps/api.c:570:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->voltage);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/hardware/scpi-pps/api.c:573:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->frequency);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/hardware/scpi-pps/api.c:576:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->current);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-07-21 16:49:01 +02:00
Uwe Hermann 54d471f498 drivers: Factor out std_gvar_min_max_step{,_array}(). 2017-07-21 16:49:01 +02:00
Uwe Hermann 463160cbca drivers: Factor out std_gvar_samplerates{,_steps}(). 2017-07-21 16:49:01 +02:00
Uwe Hermann db944f1622 drivers: Factor out std_gvar_tuple_{array,rational}(). 2017-07-21 16:40:15 +02:00
Uwe Hermann 6b82c3e57a drivers: Consistently name per-cg options 'devopts_cg_*'. 2017-07-21 15:45:03 +02:00
Uwe Hermann 4b25cbffa1 drivers: Drop some unnecessary prefixes. 2017-07-21 15:45:03 +02:00
Uwe Hermann ca314e060f drivers: Drop unneeded or duplicate comments.
Drop various comments which are not really needed, too verbose, document
obvious things, are duplicated across all drivers, or simply incorrect.
2017-07-21 15:23:56 +02:00
Uwe Hermann c8e789fa0c baylibre-acme: Add SR_CONF_POWERMETER key. 2017-07-19 15:40:41 +02:00
Uwe Hermann 31bdc10ec2 Add SR_CONF_POWERMETER. 2017-07-19 15:40:41 +02:00
Uwe Hermann b258c09f26 testo: Drop unneeded sdi->driver assignment.
This is already done by std_scan_complete().
2017-07-19 15:39:23 +02:00
Uwe Hermann 05199c0ac9 drivers: Provide proper drvopts.
The device class config keys should be in drvopts (not devopts).
2017-07-19 15:39:23 +02:00
Uwe Hermann 55fb76b348 drivers: Always use same scanopts/drvopts/devopts/devopts_cg* order. 2017-07-19 15:11:01 +02:00
Uwe Hermann e66d1892d0 drivers: Add and use STD_CONFIG_LIST().
This ensures consistent handling of the SR_CONF_SCAN_OPTIONS and
SR_CONF_DEVICE_OPTIONS (with sdi NULL or non-NULL) config keys
and also reduces copy-pasted boilerplate in the drivers a bit.

This function does not handle channel-group specific items, that's
very driver-specific and thus left to the individual drivers.

Also move some generic checks and error messages from the drivers into
the sr_config_list() wrapper.
2017-07-19 15:11:01 +02:00
Uwe Hermann 13d2ac54f4 saleae-logic-pro: Use sr_dev_acquisition_stop() wrapper. 2017-07-17 11:26:12 +02:00
Jan Luebbe f2b8a31be5 saleae-logic-pro: Detect and abort on capture errors
The HW simply stops sending data on overflows, so if we receive no data
in one second, we abort the acquisition. We also need to allocate more
buffers to support higher sample rates.
2017-07-16 19:28:58 +02:00
Jan Luebbe da39089014 saleae-logic-pro: Implement bitstream upload and initialization
The control packets can be longer than 256 bytes, so change the
low-level functions accordingly.
2017-07-16 19:25:46 +02:00
Jan Luebbe f1aca068c7 saleae-logic-pro: Implement FX3 firmware upload 2017-07-16 19:24:27 +02:00
Uwe Hermann a9010323dd drivers: Remove some uneeded 'ret' variables. 2017-07-13 11:59:11 +02:00
Uwe Hermann b4fde527b6 session_driver: Use std_cleanup(). 2017-07-13 11:59:11 +02:00
Uwe Hermann 029b20425b session_driver: Don't open-code std_dev_clear(). 2017-07-13 11:59:11 +02:00
Uwe Hermann 3553451f1e clear_helper(): Use a cast to shorten all implementations. 2017-07-13 11:59:11 +02:00
Uwe Hermann 8bf18daabb sr_dev_clear(): Always free sdi->priv (devc).
Until now, clear_helper() callbacks for std_dev_clear_with_callback()
were expected to g_free(devc), but not all of them did that.

Have std_dev_clear_with_callback() unconditionally g_free(sdi->priv)
(i.e., devc), regardless of whether a clear_helper() callback was
provided or not. It was doing g_free(sdi->priv) when no callback
was provided already anyway.

This makes the individual drivers' clear_helper() implementations
shorter and prevents errors such as missing g_free(devc) calls.

This works, because all drivers either call std_dev_clear_with_callback()
directly, or indirectly via std_dev_clear().

This also allows us to remove some no-longer needed dev_clear()
and clear_helper() implementations that only did g_free(devc)
in favor of std_dev_clear().
2017-07-13 11:59:11 +02:00
Uwe Hermann 53279f13e4 dev_clear(): Consistently name callback 'clear_helper()'. 2017-07-13 11:59:11 +02:00
Uwe Hermann f778bf02ea std: Add and use std_dev_clear() where possible.
Be explicit and consistent in the drivers about which dev_clear function
will be called to avoid confusion and inconsistencies.

Drop some open-coded implementations of std_dev_clear().
2017-07-13 11:59:11 +02:00
Uwe Hermann 6e43c3d531 std: Rename std_dev_clear() to std_dev_clear_with_callback(). 2017-07-13 11:59:11 +02:00
Uwe Hermann 4d67b9d9dc std: Factor out some API call dummy implementations. 2017-07-13 11:59:11 +02:00
Uwe Hermann 91057d2fc2 Various log message cleanups.
Drop unneeded log messages, add some others that might be useful,
document which ones we're intentionally not emitting.

Don't log "$operation successful" type of messages in most cases,
that's too verbose; logging failures only is sufficient there.

baylibre-acme: Don't log "No such file or directory" messages during scan,
this triggers on all kinds of unrelated devices (e.g. "AMDGPU i2c bit
bus 0x91" in this case):

  sr: [...] baylibre-acme: Name for probe 1 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0040/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 2 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0041/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 3 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0044/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 4 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0045/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 5 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0042/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 5 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004c/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 6 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0043/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 6 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0049/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 7 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0046/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 7 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004f/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 8 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0047/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 8 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004b/name”: No such file or directory
2017-07-13 11:59:11 +02:00
Uwe Hermann 12852b0337 std: Simplifications, random fixes, Doxygen cosmetics.
- sr_dev_clear(): Don't try to clear uninitialized drivers (the same
   check was previously done in std_dev_clear()).

 - Document some places where we intentionally don't emit log messages.

 - std: Various Doxygen fixes and updates.

 - std: Add some more sanity-checks on input parameters.
2017-07-13 11:59:11 +02:00
Uwe Hermann e374786753 session_file: Start out with SR_ST_INACTIVE like all drivers. 2017-07-08 14:25:23 +02:00
Uwe Hermann f1ba6b4b2c sr_dev_close(): Set status to SR_ST_INACTIVE.
This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.
2017-07-08 14:25:23 +02:00
Uwe Hermann 7e46362338 sr_dev_open(): Set status to SR_ST_ACTIVE upon success.
This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.
2017-07-08 14:25:23 +02:00
Uwe Hermann 6402c37916 sr_dev_open(): Factor out SR_ST_ACTIVE check.
This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.
2017-07-08 14:25:23 +02:00
Uwe Hermann 093e1cba6b sr_dev_close(): Factor out SR_ERR_DEV_CLOSED check.
This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.
2017-07-07 21:51:25 +02:00