Commit Graph

983 Commits

Author SHA1 Message Date
Soeren Apel e5b280e4c7 analog save: Avoid index duplication between analog & logic channels. 2016-03-24 08:55:42 +01:00
Soeren Apel 1393bccfcb input/raw_analog: Prevent "duplicate const decl specifier" warning
Warnings emitted by gcc before this patch:
src/input/raw_analog.c:51:13: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
        const char const *fmt_name;
                   ^
src/input/raw_analog.c:55:35: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const struct sample_format const sample_formats[] =
                                  ^
2016-03-22 08:29:25 +01:00
Uwe Hermann 74a9c0adc0 output/srzip: Minor whitespace fixes. 2016-03-15 18:40:50 +01:00
Martin Ling 2dc4081540 session_driver: Process analog chunks into analog packets. 2016-03-14 00:34:09 +01:00
Martin Ling 906921bad2 session_driver: Read analog chunks from file. 2016-03-14 00:34:09 +01:00
Martin Ling b317d1bbfb sr_session_load(): Create analog channels from loaded file. 2016-03-14 00:34:09 +01:00
Martin Ling 26918dced0 srzip: Renumber analog channels from zero in output file. 2016-03-14 00:34:09 +01:00
Martin Ling 7163dcbe18 srzip: Save analog data. 2016-03-14 00:34:09 +01:00
Martin Ling eab052996c srzip: Store total number of analog channels. 2016-03-14 00:34:09 +01:00
Martin Ling 828832194f srzip: Count only logic channels in "total probes". 2016-03-14 00:34:09 +01:00
Uwe Hermann c940b7a32f hantek-6xxx: libusb_get_device_descriptor() cannot fail. 2016-03-13 23:33:56 +01:00
Chriter f2a66a8ee6 hantek-6xxx: Initial driver implementation.
Note: This commit is based on the initial implementation by
Christer Ekholm (but stashed into one commit), with some adaptations
(forward porting, coding style and consistency fixes) by Uwe Hermann.
2016-03-13 23:33:56 +01:00
Chriter 6c6bc80a99 hantek-6xxx: Initial driver skeleton. 2016-03-09 19:20:13 +01:00
Uwe Hermann 5af975b587 maynuo-m97: Fix a typo in an error message. 2016-03-05 18:51:39 +01:00
Alexandru Gagniuc 6cc931283d scpi-pps: Add profile for Agilent N5763A 12.5V 120A supply 2016-03-05 18:49:30 +01:00
Uwe Hermann ba4dfbde11 fluke-dmm: Add support for the Fluke 289.
Thanks to Julien Bresciani <julien.bresciani@free.fr> for providing
the information about the required changes!
2016-03-04 17:38:35 +01:00
Wolfram Sang b84f91ff2e session: allocate correct amount of memory in sr_packet_copy
We want the size of the struct, not of a pointer to the struct. And to
be absolutely future proof, dereference the pointer we are assigning the
memory to (not the one we are copying the data from). Found by Coverity,
CID 50858.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-02-28 18:21:18 +01:00
Uwe Hermann 2217be1dd4 arachnid-labs-re-load-pro: Handle undervoltage condition.
Support the SR_CONF_UNDER_VOLTAGE_CONDITION* keys.

Undervoltage (and overtemperature) conditions now emit a
warning-level message as well.
2016-02-11 14:42:50 +01:00
Uwe Hermann 2fe1011f1d Add SR_CONF_UNDER_VOLTAGE_CONDITION* config keys.
Add two new config keys:

 - SR_CONF_UNDER_VOLTAGE_CONDITION

 - SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE
2016-02-11 14:42:50 +01:00
Uwe Hermann 8084e0fa81 arachnid-labs-re-load-pro: Only support firmware >= 1.10.
The "on\n" and "off\n" commands require this.
2016-02-11 14:42:50 +01:00
Uwe Hermann 8501448cfe arachnid-labs-re-load-pro: Add support for setting SR_CONF_ENABLED.
The firmware has "on\n" and "off\n" commands since 1.10, so use them.

Apparently you can only set the state (on/off) of the load, but it's
not possible to query the current state.
2016-02-11 14:42:50 +01:00
Uwe Hermann 6e68da5140 arachnid-labs-re-load-pro: Convert to SR_DF_ANALOG. 2016-02-11 14:42:50 +01:00
Uwe Hermann 803db07a1a arachnid-labs-re-load-pro: Add initial driver. 2016-02-08 15:02:29 +01:00
Uwe Hermann 6e8d31d468 arachnid-labs-re-load-pro: Initial driver skeleton. 2016-02-08 15:02:29 +01:00
Aurelien Jacobs 83bf4762e4 beaglelogic: use standard # operator instead of ugly __STRING macro
Also note that the __ namespace is reserved by POSIX for its private
usage, so user land software should never rely on any kind of API
with a __ prefix.
2016-02-06 17:24:34 +01:00
Soeren Apel 10c4ca9c5b hameg-hmo/yokogawa-dlm: Fix warning about pointer typecast 2016-01-29 23:13:32 +01:00
Soeren Apel a084a8f2a4 SCPI: Do not use RL1 lockout for Yokogawa devices 2016-01-29 21:59:06 +01:00
Soeren Apel b18b8a9202 yokogawa-dlm: Fix array_float_get() 2016-01-29 21:39:20 +01:00
Soeren Apel 8cccbac8da hameg-hmo: Fix array_float_get() and also use it for the time base 2016-01-29 21:35:16 +01:00
Soeren Apel fe227d17ae hameg-hmo: Add missing 20/50V vdiv entries 2016-01-29 21:13:07 +01:00
Soeren Apel e786b19467 hameg-hmo: Add more supported scope models 2016-01-29 21:08:49 +01:00
Lars-Peter Clausen b165a24234 hung-chang-dso-2100: Fix session source fd
For session sources without a file descriptor to poll a negative number
should be passed for the fd parameter. The hung-chang-dso-2100 driver
currently passes 0 instead, which is the stdin stream. Fix the issue by
passing -1 for the fd parameter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2016-01-29 18:24:42 +01:00
Uwe Hermann eb8e6cd2cb Use libusb_error_name() more often for better diagnostics. 2016-01-29 18:00:11 +01:00
Aurelien Jacobs 9dfacd8706 demo: fix infinite loop with 0 channels of one type
The following command line exhibits the inifinit loop:
  sigrok-cli -d demo:analog_channels=0 --samples=8
2016-01-28 23:41:19 +01:00
Wolfram Sang 3f48fc82b5 input: vcd: by default do not limit number of channels
Accept (and set to default) 0 for numchannels which means 'unlimited'.
I think it is convenient to read all channels of a vcd file by default.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang ab464eb3dc input: vcd: register channels when parsing header not when initializing
Benefits:

* only channels really used in vcd will be added
* we can give them the proper name found in the vcd file
* less code :)

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 34724ffa34 input: vcd: support 1 bit vectors
Use the new process_bit() function to parse 1 bit vectors, too.

This is the first step to fix bug #723. Minimal testcase vcd:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$var wire 1 n1 addr_1 $end
$enddefinitions $end
#0
0n0
b1 n1
#1
1n0
b0 n1
#2
0n0
b1 n1
#3
1n0
b0 n1

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 36dacf17bc input: vcd: refactor parsing a bit
Move to a separate function which we want to reuse later.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang a66175c2b1 input: vcd: avoid needless copying
Current code moves the identifier string one byte to the front to
overwrite the bit value, so 'tokens[i]' is a string to compare against
the desired value. This copying is unnecessary, just pass a properly
setup pointer.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 76bc28c3f1 input: vcd: try to continue when a vector was found
No need to bail out on vectors. As long as there are tokens left, we can
try to parse the rest. Also, print a message so the user knows what's
going on. Here is a testcase vcd:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$var wire 1 n1 addr_1 $end
$enddefinitions $end
#0
0n0
b1 n1
#1
1n0
b0 n1
#2
0n0
b1 n1

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 73f052d329 input: vcd: properly bail out on missing identifiers
If we hit the missing identifier case, then we reached the end of the
token list. So, we should break out of the loop, and not continue.
Otherwise we will go past the end of the array as this minimal testcase
shows:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$enddefinitions $end
1

gives:

$ ./sigrok-cli -I vcd -i no_mod.vcd -O vcd -o /tmp/o.vcd
Segmentation fault

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang e85e550d92 input: vcd: allow optional index item
A $var block can have an optional index item which looks like '[<sth>]'.
Parse it, too, and append it to the channel name.

This fixes bug #322. A first version was posted by Simon Richter. This
version is rebased and simplified.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Uwe Hermann 650847e7d3 hameg-hmo: Fix some compiler warnings. 2016-01-28 19:03:53 +01:00
Soeren Apel 8fff75196f hameg-hmo: Replace floating point comparison for vdiv
This should fix bug #731.
2016-01-28 19:03:53 +01:00
Soeren Apel a5be5d5bc0 Trace32 import module: Send trigger only once
As we're downsampling, several record time stamps can match the specified
trigger time. For this reason, it's possible that several trigger packets
are sent when a file is loaded. This prevents the issue and sends a
trigger packet only on the first matching record.
2016-01-28 19:03:52 +01:00
Uwe Hermann 1b4aedc06f Use ALL_ZERO in a few more places. 2016-01-07 23:50:17 +01:00
Uwe Hermann ff7c7cda93 lecroy-logicstudio: Fix some compiler warnings on MinGW.
src/hardware/lecroy-logicstudio/protocol.c: In function 'handle_fetch_samples_done':
src/hardware/lecroy-logicstudio/protocol.c:261:3: warning: passing argument 6 of 'libusb_fill_bulk_transfer' from incompatible pointer type
   recv_bulk_transfer, (void *)sdi, USB_TIMEOUT_MS);
   ^
In file included from ./src/libsigrok-internal.h:31:0,
                 from src/hardware/lecroy-logicstudio/protocol.h:26,
                 from src/hardware/lecroy-logicstudio/protocol.c:23:
/home/uwe/sr_mingw/include/libusb-1.0/libusb.h:1546:20: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
 static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,
                    ^
src/hardware/lecroy-logicstudio/protocol.c: In function 'fetch_samples_async':
src/hardware/lecroy-logicstudio/protocol.c:314:4: warning: passing argument 6 of 'write_registers_async' from incompatible pointer type
    handle_fetch_samples_done);
    ^
src/hardware/lecroy-logicstudio/protocol.c:200:12: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
 static int write_registers_async(const struct sr_dev_inst *sdi,
            ^
src/hardware/lecroy-logicstudio/protocol.c: In function 'lls_start_acquisition':
src/hardware/lecroy-logicstudio/protocol.c:1122:3: warning: passing argument 6 of 'libusb_fill_interrupt_transfer' from incompatible pointer type
   recv_intr_transfer, (void *) sdi, USB_TIMEOUT_MS);
   ^
In file included from ./src/libsigrok-internal.h:31:0,
                 from src/hardware/lecroy-logicstudio/protocol.h:26,
                 from src/hardware/lecroy-logicstudio/protocol.c:23:
/home/uwe/sr_mingw/include/libusb-1.0/libusb.h:1602:20: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
 static inline void libusb_fill_interrupt_transfer(
                    ^
2016-01-07 23:50:17 +01:00
Uwe Hermann d64b5f43cc sysclk-lwla: Minor whitespace and consistency fixes. 2016-01-07 23:50:17 +01:00
Uwe Hermann 0cadb8a350 Minor whitespace and cosmetic fixes. 2016-01-07 23:50:17 +01:00
Wolfram Sang 3591481e87 dmm: vc870: drop unused variable
There is no status bit for RMS. We know about RMS if certain modes are
active. So, drop this superfluous variable.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang ee2e9be21b dmm: vc870: support effective voltage & current
And rename the status variable because in sigrok the term RMS is used
instead of "effective value".

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang 2e1c4817c7 dmm: vc870: render POWER_FACTOR as such and not as frequency
The primary display is the power factor, the secondary is the frequency.
This got mixed up, so change the order. We also need to fix the
conversion factor.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang 4867dd177f dmm: vc870: keep the order when processing modes
is_power_apparent_power is index 0 of function 0x39, so it is better to
process it first and the later indices after that (we need to add
another one with a different patch later).

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang b4a0770ef8 dmm: vc870: fix AC conversion factors
Testing showed that AC current needs to be handled different from DC.
Note that ACA is still untested because of limited testing equipment.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang b89462e457 dmm: vc870: show display value properly in debug output
It was confusing to see the display value (5 digits) printed in debug
output as a float. Print it the same way as shown on the real device,
without comma, of course.
This also allows to simplify the code a little.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Daniel Elstner 32ba0d8005 resource: Replace ssize_t with gssize to avoid unistd.h 2016-01-04 20:53:30 +01:00
Uwe Hermann e43887683c baylibre-acme: Replace g_close() with close() for now.
This g_close(), the only one in the whole code-base, would unnecessarily
raise the minimum glib version to 2.36.

Thanks to Daniel Glöckner for the report.

This fixes bug #724.
2016-01-03 02:59:00 +01:00
Uwe Hermann 6954fdbca9 src/backend.c: Add missing winsock2.h #include. 2016-01-03 00:39:44 +01:00
Martin Ling fa69e191b2 win32: Call WSAStartup() at sr_init() time.
Should fix bug #692.
2016-01-02 17:40:00 +01:00
Uwe Hermann 8141a0325c Rename sr_driver_scan_options() to sr_driver_scan_options_list(). 2015-12-31 19:04:34 +01:00
Uwe Hermann 0c697a4b33 Rename sr_dev_config_capabilities() to sr_dev_config_capabilities_list(). 2015-12-31 19:04:28 +01:00
Martin Ling e318f01b2f Make SR_CONF_MASK an internal constant. 2015-12-31 19:00:16 +01:00
Martin Ling cffdc3e63b Make SR_CONF_{SCAN,DEVICE}_OPTIONS into internal constants.
These are no longer needed in the public API as we have new wrapper functions.
They are still used internally by drivers.
2015-12-31 19:00:16 +01:00
Martin Ling 8f3168b89b Add new sr_driver_scan_options() helper function.
This function replaces the pattern of calling config_list() with
SR_CONF_SCAN_OPTIONS to obtain a list of scan options.
2015-12-31 19:00:16 +01:00
Martin Ling e7136c626f Add new sr_dev_options() helper function.
This function replaces the pattern of calling config_list() with
SR_CONF_DEVICE_OPTIONS to obtain a list of device options. Note
that this does not include the SR_CONF_{GET,SET,LIST} bitmask,
which is now retrieved for a specific key by calling
sr_dev_config_capabilties().
2015-12-31 19:00:16 +01:00
Martin Ling 71e9c54dab Add new sr_dev_config_capabilities() helper function. 2015-12-31 19:00:15 +01:00
Uwe Hermann 039a2fd78a src/usb.c: Only allow hex characters in CONN_USB_VIDPID.
(and also allow case-insensitive specification)

Thanks to Hannu Vuolasaho for the fix.
2015-12-29 13:21:01 +01:00
Wolfram Sang 52fb2d4484 modbus: silence a build warning
Refactor handling the size of modbus_devs, so it doesn't produce a build
warning and still allows the compiler to remove unused code.

This fixes bug #637. It could be reverted once modbus_devs
unconditionally has a member in the struct.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-12-29 13:19:36 +01:00
Uwe Hermann 0a1f7b09b3 Prefer postfix-increment for consistency across the code-base.
Only when there are technical reasons use prefix-increment.
2015-12-26 14:37:33 +01:00
Uwe Hermann a078d3ec52 korad-kaxxxxp: Add workaround for a Korad KA3005P issue.
In some situations, the reply to the *IDN? command contains an
additional trailing 0x01 byte for unknown reasons.

This issue seems to be reproducible by changing the voltage using the knobs
on the device, then turning on the output and turning it off again.

The next korad-kaxxxxp scan() operation would contain the trailing 0x01
byte, which would lead to the detection of the device in libsigrok no
longer working until the next power-cycle.

Work around this issue by treating both the ID string with and without
the trailing 0x01 byte as valid.
2015-12-25 23:29:35 +01:00
Uwe Hermann ae9ca5b1df korad-kaxxxxp: Add support for the Velleman PS3005D. 2015-12-24 01:19:11 +01:00
Daniel Elstner 1d80e1c641 sysclk-lwla: Use static array for LWLA1034 init sequence
Just as in the LWLA1016 initialization, make use of a static array
for the constant part of the LWLA1034 capture setup sequence.
2015-12-22 23:42:36 +01:00
Daniel Elstner e35a459248 sysclk-lwla: Attempt initialization three times
This is a desperate measure to improve the success rate of device
initialization even after it got into a bad state. Combine this
with a reduced USB timeout (1 second) so that if it fails, it fails
quickly. Also ignore USB errors from the initial dummy read of the
device test ID.
2015-12-22 16:09:39 +01:00
Daniel Elstner 04f2428354 sysclk-lwla: Use static array for init sequence 2015-12-22 16:09:39 +01:00
Daniel Elstner 786485772f sysclk-lwla: Work around short transfer quirk
Detect whether the FX2 firmware of the LWLA device exhibits the
short transfer bug. If so, work around the problem by limiting
reads to at most 64 bytes at a time. This slows down the memory
read after acquisition quite noticably, but makes the device
usable even in adverse conditions.
2015-12-22 16:09:39 +01:00
Daniel Elstner 940805ce7d sysclk-lwla: Skip unused registers in status poll
Reduce the number of long registers read in bulk during status
polling from 10 to 5. The LWLA1034 driver used to do that already
in an earlier iteration, which was then changed to be more like
the original vendor software. The reason for bringing it back now
is that it reduces the response size to 40 bytes, which works
around the spurious 64 byte limit bug in the FX2 firmware of the
LWLA devices.
2015-12-22 16:09:39 +01:00
Daniel Elstner ef7df53d36 sysclk-lwla: Declare model_info structs as extern
This fixes bug 714.
2015-12-22 16:08:18 +01:00
Daniel Elstner fc6cbfce2b sysclk-lwla: Close USB handle on drain error 2015-12-21 17:56:52 +01:00
Daniel Elstner 407b6e2cff sysclk-lwla: Various cosmetic improvements 2015-12-21 17:56:52 +01:00
Soeren Apel 6d2897e394 Add the Lauterbach Trace32 logic analyzer data import module 2015-12-21 16:32:49 +01:00
Soeren Apel 8a66b0777c Add RL64 and RL64S endianness helper macros 2015-12-21 16:23:44 +01:00
Soeren Apel d01c4c56d5 Whitespace fixes 2015-12-21 16:23:44 +01:00
Uwe Hermann 30726a8a32 input/raw_analog: Fix two compiler warnings.
../src/input/raw_analog.c:63:67: warning: integer overflow in expression [-Woverflow]
  { "S32_LE",     { 4, TRUE,  FALSE, FALSE, 0, TRUE, { 1, INT32_MAX+1}, { 0, 1}}},
                                                                   ^
../src/input/raw_analog.c:65:67: warning: integer overflow in expression [-Woverflow]
  { "S32_BE",     { 4, TRUE,  FALSE, TRUE,  0, TRUE, { 1, INT32_MAX+1}, { 0, 1}}},
                                                                   ^
2015-12-21 16:23:39 +01:00
Uwe Hermann 21cbe810fe input/raw_analog: Use ARRAY_SIZE. 2015-12-21 16:10:20 +01:00
Stefan Brüns 221cec31fc input/raw_analog: set scale and offset appropriately 2015-12-21 15:56:31 +01:00
Stefan Brüns e6b15cb5e6 input/raw_analog: Add input module for raw analog signals 2015-12-21 15:56:31 +01:00
Stefan Brüns 4d376e082c analog: add conversion from various integer formats to float 2015-12-21 15:53:01 +01:00
Stefan Brüns 74c9a8d2bd input/wav: initialize channel list before going into ready state
The sr_input_dev_inst_get API documentation guarantees an input is fully
initialized as soon as the device instance is returned. An sdi
implementation should not set sdi_ready any earlier.

This fixes parts of bug #387.
2015-12-21 15:37:32 +01:00
Tilman Sauerbeck c7b17bcba3 lecroy-logicstudio: Initial driver implementation.
This supports both 8 and 16 channel modes with samplerates up to
500 MHz. Voltage thresholds are currently fixed at 1.58V.
2015-12-04 10:35:04 +01:00
Tilman Sauerbeck 17b93fd7c0 Add the RB64 macro.
Reads an unsigned 64 bit integer from memory.
2015-12-04 01:04:33 +01:00
Hannu Vuolasaho 8abdf0066e korad-kaxxxxp: Workaround for Korad device bug
The sixth character from ISET? is read and discarded. If the device is
turned off and on again, this won't be there and causes 10 ms delay in
every ISET? Luckily, this value isn't queried that often. To get the
sixth byte, the *IDN? command has to be issued before ISET?.
2015-12-01 10:46:51 +01:00
Hannu Vuolasaho bcf9384d3d korad-kaxxxxp: Fix typo in Korad driver device enum 2015-12-01 10:46:40 +01:00
Stefan Brüns 17124cf9ad output/wav: use the right buffer for SR_DF_ANALOG 2015-11-29 02:30:38 +01:00
Stefan Brüns 8b5aefc681 input/wav: fix and simplify conversion of integer samples
Size of individual samples is specified by unitsize, not samplesize.
The sample immediate is not necessary.
2015-11-29 02:30:37 +01:00
Stefan Brüns b944e336d6 input/wav: increase search range for data chunk, report errors 2015-11-29 02:30:37 +01:00
Stefan Brüns 288f8ce23c input/wav: fix error in offset calculation 2015-11-29 02:30:37 +01:00
Stefan Brüns c7224164a0 output/wav: track and free memory for float conversion buffer 2015-11-29 01:14:54 +01:00
Stefan Brüns c01378c95f input: fix leak of config data in several input modules 2015-11-29 01:13:58 +01:00
Stefan Brüns da3d141f04 output: fix options memory leak 2015-11-29 01:13:58 +01:00
Stefan Brüns 2dbe445d55 output/analog: track and free memory for float conversion buffer
==18779== 800,000 bytes in 196 blocks are definitely lost in loss record 29 of 29
==18779==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18779==    by 0x4E635C3: receive (analog.c:319)
==18779==    by 0x40870B: datafeed_in (session.c:316)
==18779==    by 0x4E59D4E: sr_session_send (session.c:1201)
==18779==    by 0x4E59F8B: sr_session_send (session.c:1159)
==18779==    by 0x4E62595: send_chunk (wav.c:234)
==18779==    by 0x4E62A06: process_buffer (wav.c:290)
==18779==    by 0x40954A: load_input_file_module (input.c:123)
==18779==    by 0x4097AB: load_input_file (input.c:157)
==18779==    by 0x40531E: main (main.c:288)
2015-11-29 01:13:58 +01:00
Stefan Brüns 877a6d09d5 session: free memory for datafeed callbacks, reported by valgrind
==17549== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 39
==17549==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17549==    by 0x5359200: g_malloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x536EE2D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x5370165: g_slist_append (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x4E595C3: sr_session_datafeed_callback_add (session.c:512)
==17549==    by 0x409527: load_input_file_module (input.c:111)
==17549==    by 0x4097AB: load_input_file (input.c:157)
==17549==    by 0x40531E: main (main.c:288)
2015-11-29 01:13:58 +01:00
Stefan Brüns fe7b8efc6b session: fix use after free of session->devs as reported by valgrind
==7478== Invalid write of size 8
==7478==    at 0x4E59182: sr_session_dev_remove_all (session.c:302)
==7478==    by 0x4E591CD: sr_session_destroy (session.c:265)
==7478==    by 0x4095D9: load_input_file_module (input.c:143)
==7478==    by 0x4097AB: load_input_file (input.c:157)
==7478==    by 0x40531E: main (main.c:288)
==7478==  Address 0x7877eb8 is 88 bytes inside a block of size 96 free'd
==7478==    at 0x4C2A37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7478==    by 0x4E5F454: sr_input_free (input.c:573)
==7478==    by 0x4095C3: load_input_file_module (input.c:140)
==7478==    by 0x4097AB: load_input_file (input.c:157)
==7478==    by 0x40531E: main (main.c:288)
2015-11-29 01:13:58 +01:00
Uwe Hermann b3cfc6e98e Make all sizeof() consistently use parenthesis. 2015-11-29 00:23:53 +01:00
Daniel Elstner 09ffac33b7 sysclk-lwla: Simplify trigger mask generation 2015-11-28 23:27:45 +01:00
Daniel Elstner 93ed0241aa sysclk-lwla: Drain pending replies on initialization
When opening the device, drain any pending data from the USB
buffers so that the device won't get stuck on crashes etc.
2015-11-28 23:27:45 +01:00
Daniel Elstner 567674b4f8 sysclk-lwla: Remove double USB set configuration
This was a pointless attempt to make the reset hiccups go away.
It didn't help, the problem must be something else.
2015-11-27 21:26:13 +01:00
Daniel Elstner 7ed808179f sysclk-lwla: Cut down on size_t overuse
Do not use size_t for values whose width is defined by the device,
not the host. Also don't use size_t for simple indices with known
small range, unless type compatibility considerations apply.
2015-11-27 15:07:56 +01:00
Daniel Elstner 43af7604d0 sysclk-lwla: Fix copy'n'paste mistake in comment 2015-11-27 03:19:43 +01:00
Uwe Hermann 9e9dba7b41 Use the ALLZERO macro in more places. 2015-11-27 00:55:09 +01:00
Hannu Vuolasaho 2c5bdf1bbd Support for Korad KA3005P 2015-11-27 00:54:07 +01:00
Uwe Hermann 16fc7ee29f korad-kdxxxxp: Rename driver to korad-kaxxxxp.
This matches the supported / supportable devices better.
2015-11-27 00:54:07 +01:00
Uwe Hermann 89b3a0d8d1 doxygen: Only use @since on public API functions. 2015-11-27 00:17:31 +01:00
Petteri Aimonen db0e5c999d VCD input: Chunk up the samples in 1MB blocks.
This gives about 100x speed improvement when converting VCD->SR.

Also should allow practically unlimited number of channels.

This fixes bug #551.
2015-11-26 21:44:31 +01:00
Daniel Elstner 3393f185a5 session: Remove debug spew on I/O events
This really is a bit much with some drivers that do lots of small
I/O transfers.
2015-11-26 21:44:31 +01:00
Daniel Elstner be64f90b53 sysclk-lwla: Implement support for LWLA1016
Refactor the sysclk-lwla driver to separate the generic logic from
the model-specific implementation. Based on this, implement support
for the SysClk LWLA1016 device.
2015-11-26 21:44:31 +01:00
Daniel Elstner ce19d4c615 sysclk-lwla: Remove global driver instance pointer
Obtain the sr_dev_driver pointer from the device instance so that
the remaining references to the global di pointer can be removed.
2015-11-26 21:44:31 +01:00
Uwe Hermann e4ce146fef sr_usb_find(): Increase the 'bus' limit to 255.
On some systems it can happen that the USB 'bus' number is a lot larger
than 64, but sr_usb_find() currently errors out if it is > 64.

Example:
Bus 250 Device 006: ID 1ab1:04ce 1ab1 DS1000Z Series[...]

Increase that limit so that the code will work everywhere. This bus number
is queried via libusb_get_bus_number() which returns an uint8_t, so we're
limiting to 255 here.

Thanks to 'ssi' on IRC for reporting the issue.
2015-11-21 20:27:25 +01:00
Matthieu Gaillet d79244dc34 serial-dmm: Add support for Velleman DVM4100 & PeakTech 3415.
(both are using the new dtm0660 DMM parser)
2015-11-15 23:54:37 +01:00
Matthieu Gaillet eed3dec849 Add dtm0660 15-byte DMM protocol parser. 2015-11-15 23:54:37 +01:00
Uwe Hermann b98b70222f usb.c: Fix usb_get_port_path() issue on Mac OS X.
Apparently (some versions of) Mac OS X have the same problem with
usb_get_port_path() as FreeBSD does. Work around this in the same way.

Thanks to hanyazou@gmail.com for the patch!

This fixes bug #673.
2015-11-15 19:11:54 +01:00
Uwe Hermann 382bea8250 chronovu-la: Add missing libusb dependencies.
The chronovu-la driver now uses libusb (in addition to libftdi), so add
a missing <libusb.h> #include and libusb dependency in configure.ac.
2015-11-15 16:20:07 +01:00
Uwe Hermann 67f890d5bb chronovu-la: Properly handle multiple devices.
The driver should now be able to cope with e.g. multiple ChronoVu LA8
and/or ChronoVu LA16 devices being connected to the same PC.

It now also provides the serial number and connection ID, which can be
used by frontends to differentiate multiple devices.

Also improve the scanopts / drvopts / devopts lists handling.

This fixes bug #504.
2015-11-09 01:54:41 +01:00
Uwe Hermann d0f1fa0758 asix-sigma: Drop unneeded asix_sigma_driver_info.
This is not needed, but also causes linker issues on some platforms.
2015-11-08 19:11:25 +01:00
Uwe Hermann 2c24077466 Constify a lot more items.
This fixes various compiler warnings when -Wdiscarded-qualifiers is used.
2015-11-08 19:11:25 +01:00
jry 3ba56876b4 asix-sigma: Split into api.c and protocol.[ch] modules. 2015-11-05 21:26:39 +01:00
Daniel Elstner 8105e82913 openbench-logic-sniffer: Avoid recreating event source
With the current driver API and the corresponding session event
handling, it is not possible to destroy and then re-create an
event source with the same key within the same main loop iteration.

The next generation driver API will fix this problem. But for now,
just change the driver to make do without that sort of thing. Also
increase the I/O timeout to 100 ms to be safer in the event of all
kind of delays the OS environment may induce.

This fixes bug #678.
2015-11-01 19:38:40 +01:00
Bert Vermeulen d09a82a8fe Remove obsolete SR_INPUT_META_MIMETYPE metadata key.
This was never really implemented, since getting the mimetype of a
file or stream in a cross-platform way is a gigantic tangle.
2015-10-31 18:56:34 +01:00
Bert Vermeulen c958ab59d6 input/csv: Remove obsolete mimetype format match.
Mimetypes never worked, and in any case this caused a segfault due to a
missing SR_INPUT_META_REQUIRED flag.

This fixes bug #681.
2015-10-31 18:54:50 +01:00
Daniel Elstner 58cc125b0f sysclk-lwla: Read full 64 bit of capture duration field
Evaluate all 64 bit of the duration field in the capture status
record. Although unlikely in practical use, due to compression
it is possible for the duration in ms to exceed 32 bit.
2015-10-31 10:19:51 +01:00
Daniel Elstner 30f34dbdf0 sysclk-lwla: Define constants for long registers 2015-10-31 01:39:03 +01:00
Daniel Elstner 586ff70a21 sysclk-lwla: Clarify use of SRAM control registers
Assign more meaningful names to things and introduce new constants.
2015-10-31 01:11:31 +01:00
Daniel Elstner a6dc3dacab zip: Provide fallback if zip_discard() is unavailable
zip_discard() was introduced in libzip 0.11, which some systems
do not have yet. Provide a fallback replacement for zip_discard(),
and reduce the requirement to libzip 0.10 again.

This fixes bug #674.
2015-10-30 15:09:46 +01:00
Daniel Elstner e1172cf847 sysclk-lwla: Read test word twice during initialization
During initialization of the LWLA1034, read the 64-bit test word
twice and verify the result of the second read only. This better
matches what the original vendor software does.
2015-10-30 12:51:16 +01:00
Daniel Elstner 3a322bbc3b sysclk-lwla: Clarify function of registers 10B0 to 10BC
Apparently, these four registers form an interface for indirect
access to another internal 64 bit wide memory. This is likely the
same memory as that accessed by the bulk transfer commands 7 and 8.
2015-10-30 12:51:16 +01:00
Uwe Hermann 9e5366df4f korad-kdxxxxp: Minor cosmetics and consistency changes. 2015-10-29 18:51:09 +01:00
Hannu Vuolasaho c40ed60f27 Over voltage and current protection support
Developed against Velleman LABPS3005D and seems to work.
2015-10-29 18:43:09 +01:00
Hannu Vuolasaho b16d975a5c Support for regulation status and fix for mysterious M
Added support for SR_CONF_REGULATION which returns value for CH1
Also VELLEMAN LABPS3005D (only device currently supported) sends single
'M' character in beginning of return value, which is specially discarded.
2015-10-29 18:43:09 +01:00
Martin Ling a00106b7f8 scpi: Move closing of discovered devices to sr_scpi_scan_resource(). 2015-10-25 22:40:35 +01:00
Martin Ling b7b873cea3 rigol-ds: After successfully finding a device, close it properly. 2015-10-24 22:50:37 +02:00
Aurelien Jacobs 7977054d61 scpi_usbtmc_libusb: remove libusb_clear_halt() hack which is not useful anymore 2015-10-24 22:11:38 +02:00
Uwe Hermann a73665a3fa transform/scale: Fix g_variant_new() argument. 2015-10-24 21:44:20 +02:00
Aurelien Jacobs 938bdc25b7 scpi_usbtmc_libusb: set_configuration only if it is not already set
This avoids the issues described here:
http://libusb.sourceforge.net/api-1.0/caveats.html#configsel
2015-10-24 21:32:13 +02:00
Aurelien Jacobs e40e9ca28d scpi_usbtmc_libusb: add Rigol DS2000 to the RL1 blacklist
The Rigol DS2000 series also give a USB timeout when trying to apply
RL1 lock or unlock.
2015-10-24 21:32:13 +02:00
Uwe Hermann 222fdfd526 Drop unneeded sr_analog_float_to_string().
A simple g_strdup_printf() is sufficient, no need for an extra
libsigrok API call here.
2015-10-24 21:21:50 +02:00
Tilman Sauerbeck a5c38703ee drivers: Fix behaviour when trying to set an invalid capture ratio.
Trying to configure an invalid capture ratio would reset the
previously configured value. Instead, we should just reject the
new value and keep the original one.
2015-10-24 21:10:29 +02:00
Uwe Hermann 087c4d59c0 fx2lafw: Drop obsolete macro usage. 2015-10-24 20:55:40 +02:00
Uwe Hermann 3e91de2bd6 fx2lafw: Add the official fx2lafw sigrok VID/PID pairs.
As supported by sigrok-firmware-fx2lafw >= 0.1.3:

 - 1D50:608C: fx2lafw-sigrok-fx2-8ch.fw

 - 1D50:608D: fx2lafw-sigrok-fx2-16ch.fw
2015-10-22 19:19:40 +02:00
Uwe Hermann 22fb1bffc3 analog.c: Various Doxygen additions and improvements. 2015-10-21 00:29:29 +02:00
Uwe Hermann 5cee3d08e4 analog.c: Return SR_ERR_ARG upon invalid arguments.
(instead of segfaulting)
2015-10-21 00:29:29 +02:00
Uwe Hermann 8ea0c90268 sr_analog_float_to_string(): Make 'digits' argument unsigned. 2015-10-21 00:29:29 +02:00