Commit Graph

1613 Commits

Author SHA1 Message Date
Uwe Hermann 338143ea03 Convert a few more occurrences of d->priv to d->context. 2015-07-10 18:19:24 +02:00
Soeren Apel 41812aca43 Fix #442 by renaming sr_dev_driver.priv to .context 2015-07-10 01:22:15 +02:00
Uwe Hermann c11a1e6122 fx2lafw: Use the USB_INTERFACE #define. 2015-07-10 01:22:15 +02:00
Uwe Hermann dc2903bbdb fx2lafw: Fix segfault wrt libusb_detach_kernel_driver().
Move the libusb_detach_kernel_driver() call after the code that
sets the usb->devhdl pointer, otherwise it'll be NULL and result
in a segfault.

  #0  libusb_kernel_driver_active (dev=0x0, interface_number=0) at libusb/core.c:1711
  #1  dev_open (sdi=0x12d99f0) at src/hardware/fx2lafw/api.c:374
  [...]

Tested on a device with the default Cypress VID/PID and one with
the Saleae Logic VID/PID, both works fine.
2015-07-10 01:05:54 +02:00
Soeren Apel 39e4517759 fx2lafw: Fix #445 by detaching the kernel driver (if any)
This avoids the need to run "rmmod usbtest" on Linux for devices
with the standard Cypress FX2 USB VID/PID (04b4:8613).
2015-07-10 01:03:54 +02:00
Daniel King 536141ff49 Demo: Fix #314 by always honoring sample limit changes 2015-07-09 20:22:51 +02:00
Soeren Apel e2b99f04d8 Fix #505 by providing a separate property list for the analog group 2015-07-09 20:22:51 +02:00
Soeren Apel 815e3cb83e Fix #574 by setting up the transfer first, then starting acquisition 2015-07-06 12:16:10 +02:00
Bartosz Golaszewski d586a7f4bd baylibre-acme: Remove unnecessary close().
The timerfd descriptor is closed automatically by
g_io_channel_shutdown(). No need to close it manually.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-07-01 12:30:09 +02:00
Bartosz Golaszewski 7a1a3a36a9 baylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-07-01 10:47:38 +02:00
Bartosz Golaszewski 7e5a048ff2 baylibre-acme: Add a workaround for slow data acquisition.
At high sampling rates and maximum channels we are not able to acquire
samples fast enough, even though frontends still think that samples
arrive on time. This causes visible shifts in frontend plots.

To compensate for the delay introduce the following workaround: check
if we are late (if any clock events have been missed) and resend the
last frame n times (n == number of missed clock events).

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-07-01 00:03:58 +02:00
Daniel Lezcano a0648b1a12 baylibre-acme: Use timerfd instead of a fake pipe.
Currently baylibre-acme uses a fake pipe as the input channel required by
libsigrok API and calls sleep() in the data acquisition callback to create
intervals between measurements.

Switch to a more elegant approach: use Linux' timerfd and set a periodic
timer equal to the sampling rate. Then read the data every time the timer
expires.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-07-01 00:00:33 +02:00
Bartosz Golaszewski f9b0ab6b2d baylibre-acme: Close sysfs files after stopping the acquisition.
Add a missing call to dev_acquisition_close() in dev_acquisition_stop().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-06-29 16:07:59 +02:00
Daniel Lezcano 4e88b86cc8 baylibre-acme: Optimize reading of values from sysfs.
Opening a file has a cost (security, allocation, syscalls). The
read_sample() function always does an open/read/close sequence.

In order to optimize that, let's open the file at the moment the
acquisition starts, close it when the acquisition stops and make
read_sample() only lseek() to the beginning of the file and read
the value.

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-06-29 16:07:52 +02:00
Daniel Elstner fe473123ba sysclk-lwla: Do not create channels in reverse order
This was originally done as an optimization in combination with a list
reversal which has since been removed from the code.  Thus, un-reverse
the channels so that the UI lists them in the correct order again.
2015-06-27 23:56:37 +02:00
Uwe Hermann a93086528e yokogawa-dlm: Minor cosmetics, consistency fixes, typos. 2015-06-23 00:46:45 +02:00
Soeren Apel 49f49cb55e yokogawa-dlm: Return correct value for SR_CONF_HDIV 2015-06-23 00:15:56 +02:00
Soeren Apel 2dcf82e9cb yokogawa-dlm: Remove dlm_setup_channels() 2015-06-23 00:15:56 +02:00
Soeren Apel c65a021c05 yokogawa-dlm: Introduce config_channel_set() 2015-06-23 00:15:56 +02:00
Soeren Apel f3c60fb6af yokogawa-dlm: Config get/set/list handler updates 2015-06-23 00:15:56 +02:00
Soeren Apel f77afcf0aa yokogawa-dlm: Fix number of digital groups 2015-06-23 00:15:56 +02:00
Soeren Apel 6fd78a9fd0 yokogawa-dlm: Prevent duplicate channel index 2015-06-23 00:15:56 +02:00
Soeren Apel 7048bb1f35 yokogawa-dlm: Add support for the DL9000 series 2015-06-23 00:15:56 +02:00
Daniel Gröber b7c53d48a8 fx2lafw: Add DSLogic Pro and DSCope firmware loading support 2015-06-22 17:14:00 +02:00
Carl-Fredrik Sundström 65e0036635 dslogic: Fix incorrect samplerate setting. 2015-06-22 16:54:39 +02:00
Alexandru Gagniuc 9a5185c736 scpi-pps: Chroma 62000P: Get capabilities from device name
The Chroma 62000P series comes in various models with different
current and voltage capabilities. These are encoded in the *IDN
string, so just get them from there, rather than needing a profile
for every model.
2015-06-16 13:04:24 +02:00
Alexandru Gagniuc 5281993e0a scpi-pps: Add profile for Chroma 62024P-80-60 DC Source 2015-06-16 13:04:24 +02:00
Uwe Hermann 84ab9da11f saleae-logic16: Emit debug info of which bitstream is used. 2015-06-11 18:35:40 +02:00
Marcus Comstedt c868139629 saleae-logic16: Support new bitstream version 1.3 with renumbered registers 2015-06-11 18:35:40 +02:00
Uwe Hermann da005885c8 scpi: Update names of a few *_OUTPUT_* items. 2015-06-07 20:58:46 +02:00
Uwe Hermann ae1827f557 modbus: Consistently use the "Modbus" spelling.
(as per modbus.org spelling)
2015-06-07 20:42:33 +02:00
Uwe Hermann f54ebe0c06 modbus: Minor typos, cosmetics and consistency fixes. 2015-06-07 20:40:32 +02:00
Aurelien Jacobs ffb580cf73 Actual implementation for the maynuo-m97 driver. 2015-06-07 20:15:08 +02:00
Aurelien Jacobs e1ccfb1910 maynuo-m97: Initial driver skeleton. 2015-06-07 20:15:08 +02:00
Aurelien Jacobs c4b7838922 libsigrok.h: Add SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE. 2015-06-07 20:15:07 +02:00
Aurelien Jacobs 4c938fc27f modbus: add a serial RTU backend. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs daa3901205 Add a modbus communication helper module. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs a2632bcafc libsigrok-internal.h: add helper macro to read floats from unaligend memory. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs 7a0b98b544 Rename SR_CONF_OUTPUT_* to SR_CONF_*.
All those options are currently applied only to power-supplies
but they could apply as well to electronic loads, except for the
fact that electronic loads channels are called inputs and not
outputs.
Also when you think about an SMU (or any kind of 4-quadrants
power-supply), their channels can both source and sink current,
so they can be considered as input as much as output.
Those SR_CONF_* are thus renamed so that they can be used in all
those situations.
2015-05-12 13:22:34 +02:00
Aurelien Jacobs c1603f4574 scpi-pps: don't fail acquisition start for devices with no CMD_SELECT_CHANNEL
For devices such as the HP 6632B the following invocation was failing due to
scpi_cmd(sdi, SCPI_CMD_SELECT_CHANNEL, ...) returning SR_OK_CONTINUE.

./sigrok-cli -d scpi-pps:conn=/dev/ttyUSB0:serialcomm=9600/8n1 --continuous
sr: session: sr_session_start: could not start an acquisition (not enough data to decide error status yet)
Failed to start session.
2015-05-09 23:06:10 +02:00
Aurelien Jacobs bbc42811d0 Use G_PI instead of defining our own version of PI. 2015-05-09 22:52:24 +02:00
Uwe Hermann 562a34908e scpi-pps: Minor cleanups. 2015-05-07 03:15:35 +02:00
Uwe Hermann c80cf3e02e scpi-pps: Fix a compiler warning.
CC       src/hardware/scpi-pps/profiles.lo
  src/hardware/scpi-pps/profiles.c:67:2: warning: missing initializer
  for field 'frequency' of 'const struct channel_spec'
  [-Wmissing-field-initializers]
    { "1", { 0, 60, 0.0001 }, { 0, 25, 0.1 } },
    ^
  In file included from src/hardware/scpi-pps/profiles.c:24:0:
  src/hardware/scpi-pps/protocol.h:106:8: note: 'frequency' declared
  here
    float frequency[3];
          ^
2015-05-07 02:59:28 +02:00
Uwe Hermann 8cb5affe00 scpi-pps: Make some more items static. 2015-05-07 02:49:59 +02:00
Alexandru Gagniuc 5c9e56c95b spci-pps: Add profile for Agilent N5767A DC source 2015-05-07 02:09:09 +02:00
Alexandru Gagniuc 6c0c9dd257 spci-pps/profiles: Support frequency control in Chroma 61604 2015-05-06 19:41:46 +02:00
Alexandru Gagniuc 4264f1c03b scpi-pps: Add infrastructure for controlling output frequency
This patch only adds the needed infrastructure to control output
frequency in the same manner as output voltage or current limit. This
does require a new field in the channel_spec struct, for the sake of
symmetry.
2015-05-06 19:41:46 +02:00
Alexandru Gagniuc a77585d4ae global: Add configuration key for output frequency target
This will be used to set up the output frequency of AC sources.
2015-05-06 19:41:46 +02:00
Alexandru Gagniuc b94dd07b08 global: Treat SR_CONF_OUTPUT_FREQUENCY as float instead of uint64_t
This makes 'output_frequency' symmetrical with 'output_current' and
'output_voltage'. On a more fundamental level, there's no reason why
frequency should be treated as a discrete quantity, other than
"es51919 used it this way".
2015-05-06 10:25:16 -07:00
Alexandru Gagniuc e8686e3ae3 asix-sigma: Avoid use of variable length arrays
This was only done once in sigma_write_register().
2015-05-01 13:42:25 +02:00
Alexandru Gagniuc 4ee1e2f35f spci-pps: Add profile for Chroma 61604 AC Source
Only the capabilities which map directly to SCPI commands supported by
sigrok are implemented at this time. This is sufficient to control
the most often used functionality of this AC source
2015-04-29 22:59:56 +02:00
Alexandru Gagniuc 0c08023f50 scpi: Accept *IDN responses with more than four tokens
Some devices with more than one microcontroller report the firmware
version for each of them, giving us more than four tokens. When that
happens, sigrok aborts, even though it received a valid response.

This happens, for example with the Chroma 61604:
'Chroma ATE,61604,001060,1.25,1.34,1.20'
2015-04-29 22:59:56 +02:00
Aurelien Jacobs 76372c5a9c Define our own constant for PI.
M_PI is not defined in the C standard nor in POSIX, it is a
non-standard GNU extension.
2015-04-28 22:07:03 +02:00
Aurelien Jacobs ba464a1217 strcasecmp() is defined in strings.h. 2015-04-28 22:07:01 +02:00
Aurelien Jacobs 94b138a3c3 wav: Stricter check for valid chunk ID.
isascii() is a superset of isalpha() and isblank() so the current
code doesn't really make sense.
Moreover, isascii(x) is just a funky and non standard way to
write x < 128.
2015-04-28 22:05:47 +02:00
Uwe Hermann 468665dfa7 Fix various warnings when building without libusb.
../src/backend.c: In function 'sr_init':
  ../src/backend.c:435:1: warning: label 'done' defined but not used [-Wunused-label]
   done:
   ^

  ../src/device.c: In function 'sr_dev_inst_connid_get':
  ../src/device.c:525:7: warning: unused variable 'connection_id' [-Wunused-variable]
    char connection_id[64];
         ^
  ../src/device.c:524:20: warning: unused variable 'b' [-Wunused-variable]
    int r, cnt, i, a, b;
                      ^
  ../src/device.c:524:17: warning: unused variable 'a' [-Wunused-variable]
    int r, cnt, i, a, b;
                   ^
  ../src/device.c:524:14: warning: unused variable 'i' [-Wunused-variable]
    int r, cnt, i, a, b;
                ^
  ../src/device.c:524:9: warning: unused variable 'cnt' [-Wunused-variable]
    int r, cnt, i, a, b;
           ^
  ../src/device.c:524:6: warning: unused variable 'r' [-Wunused-variable]
    int r, cnt, i, a, b;
        ^
  ../src/device.c:523:22: warning: unused variable 'drvc' [-Wunused-variable]
    struct drv_context *drvc;
                      ^
2015-04-17 17:45:07 +02:00
Uwe Hermann 17dda6c5d4 ols: Whitespace fixes. 2015-04-17 17:45:07 +02:00
Bartosz Golaszewski 192d37e728 baylibre-acme: Add a missing return value check.
Check the return value of sr_gpio_setval_export() in bl_acme_set_power_off()
and return an appropriate error if the call fails.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-04-17 16:42:36 +02:00
Bartosz Golaszewski 09d217a40a Revert "baylibre-acme: Fix a compiler warning."
This reverts commit 4cd97e5ad7.

We should actually check the return value of sr_gpio_setval_export().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-04-17 16:42:36 +02:00
Uwe Hermann 55462b8ba9 windows: Fix various compiler warnings.
Add LIBUSB_CALL where needed to avoid warnings such as the following:

  In file included from src/hardware/hantek-dso/api.c:34:0:
  src/hardware/hantek-dso/dso.h:212:13:
  note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
   SR_PRIV int dso_get_channeldata(const struct sr_dev_inst *sdi,
               ^
2015-04-12 19:28:36 +02:00
Uwe Hermann 76598cda54 input/wav: windows: Fix a compiler warning.
src/input/wav.c:41:0: warning: "WAVE_FORMAT_PCM" redefined
   #define WAVE_FORMAT_PCM          0x0001
   ^
  In file included from [...]/include/windows.h:86:0,
                   from [...]/include/libusb-1.0/libusb.h:70,
                   from ./src/libsigrok-internal.h:31,
                   from src/input/wav.c:28:
  [...]/include/mmsystem.h:482:0: note: this is the location of the previous definition
   #define WAVE_FORMAT_PCM 1
   ^
2015-04-12 18:54:43 +02:00
Uwe Hermann 4cd97e5ad7 baylibre-acme: Fix a compiler warning.
CC       src/hardware/baylibre-acme/protocol.lo
  ../src/hardware/baylibre-acme/protocol.c: In function 'bl_acme_set_power_off':
  ../src/hardware/baylibre-acme/protocol.c:417:6: warning: variable 'val' set but not used [-Wunused-but-set-variable]
    int val;
        ^
2015-04-12 17:26:48 +02:00
Bartosz Golaszewski 7c91c22a31 baylibre-acme: Set update_interval when modifing samplerate.
Both ina2xx and tmp401 linux drivers used by baylibre-acme expose
the standard hwmon update_interval attribute, which affects the internal
update interval of the chip.

When setting samplerate for data acquisition try to modify this
attribute accordingly.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-04-12 17:16:32 +02:00
Bartosz Golaszewski 1fe04eb8d6 baylibre-acme: Dynamically check per probe config options.
PROBE_FACTOR and POWER_OFF options are advertised for all ACME probes
(channel groups) regardless of whether they actually have given capability.

Check these options in config_list() at runtime and only advertise them
for probes which support them.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-04-12 17:16:32 +02:00
Uwe Hermann 1190c65397 Fix a USB timeout related issue in sr_session_iteration().
This issue could lead to e.g. crashes when an OLS was used.

This fixes bug #571.
2015-04-12 17:16:32 +02:00
Uwe Hermann b65630f78d uni-t-dmm: Add a missing NULL (fixes a crash on Android).
This caused an non-terminated driver list, which lead to a crash
on Android (at least on ARM).
2015-04-09 23:13:30 +02:00
Uwe Hermann d93c14707e dslogic: Fix FPGA bitstream upload. 2015-04-09 20:04:32 +02:00
Uwe Hermann 4df5739a9f dslogic: Add #defines for timeouts and delays. 2015-04-09 20:04:32 +02:00
Uwe Hermann eac0c61327 rigol-ds: Drop unneeded check of g_strdup_printf() result. 2015-04-08 19:14:05 +02:00
Uwe Hermann 032da34b78 sr_driver_list() now takes a context pointer.
This requires sr_hw_cleanup_all() and sanity_check_all_drivers()
to also take a context.

The (runtime) generation of the driver list now happens in sr_init()
and sr_driver_list() always returns that pre-generated list. This fixes
a segfault when (correctly) invoking multiple sr_init() and sr_exit()
calls with different contexts (caught by the unit tests).

This fixes bug #565.
2015-04-07 02:09:56 +02:00
Uwe Hermann 07962655ec link-mso: Eliminate unneeded NUM_CHANNELS. 2015-04-07 02:02:43 +02:00
Uwe Hermann 0f26276329 fx2lafw: Use libusb_error_name() for reporting transfer status. 2015-04-03 21:05:02 +02:00
Uwe Hermann 07ffa5b315 Replace some magic numbers with a #define. 2015-04-01 00:23:25 +02:00
Uwe Hermann dc89faeace Reduce unnecessarily high indentation level in some places. 2015-04-01 00:23:25 +02:00
Uwe Hermann 2ea67fc9bf Minor cosmetics and consistency fixes. 2015-04-01 00:23:25 +02:00
Uwe Hermann b1f8310376 Don't check g_free() arguments for NULL.
The g_free() call is guaranteed to not segfault when NULL is passed.
2015-04-01 00:23:25 +02:00
Uwe Hermann e742b88f9a cem-dt-885x: Add a missing break statement. 2015-04-01 00:23:25 +02:00
Uwe Hermann 72d69b7cd1 zeroplus: Add a missing break statement.
This fixes a bug when trying to trigger on a channel being 0/low.
2015-04-01 00:23:24 +02:00
Uwe Hermann 2cca921d91 Fix a typo in a for loop (wrong variable). 2015-04-01 00:23:24 +02:00
Uwe Hermann ce3ecb7049 sysclk-lwla: Use ARRAY_SIZE instead of G_N_ELEMENTS.
Both do exactly the same, but we consistently use ARRAY_SIZE
in the rest of the code-base.
2015-03-26 23:53:52 +01:00
Martin Ling f05406117d uni-t-dmm: Declare each meter type in only one place. 2015-03-26 23:52:06 +01:00
Martin Ling bb5f61105b Call libusb_get_next_timeout() to get minimum timeout for g_poll().
We should have been doing this all along, but we get away with it
on Linux where libusb can do everything with fds, and we get away
with it for many drivers that have a short timeout on their events.

On Windows though, handling this correctly is essential.

Fixes bug #343.
2015-03-26 01:02:40 +01:00
Martin Ling 4ed5d21d04 Store a context pointer in struct sr_session. 2015-03-26 01:02:40 +01:00
Martin Ling 61e6e2da45 Make sr_session_new() and sr_session_load() require a context. 2015-03-26 01:02:40 +01:00
Uwe Hermann c72981ac41 Revert "session_file.c: Use config_*() wrappers."
This temporarily reverts commit 421bc3eba0.

We cannot yet use the sr_config_*() wrappers, otherwise loading *.sr
files is broken. A fix is being worked on.
2015-03-24 23:35:29 +01:00
Martin Ling f6c30de4b0 Initial fix attempt for a thread-related issue on Windows.
This is a partial fix for bug #343, which lead to a large amount of
handles being created, and eventually to a frontend "hang".

It's not yet a "full" fix as some issues are still observable,
but it successfully improves the situation on Windows to the extent
that frontend hangs due to large amounts of handles no longer seem
to happen.

Thanks to Boris Gjenero <boris.gjenero@gmail.com> for the debugging
efforts, testing, and updating of this patch!

Additionally, this seems to also fix a "SysClk LWLA hanging" bug
and apparently not receiving any samples during an acquisition
(tested on an LWLA1034).

This closes bug #328.
2015-03-24 20:14:04 +01:00
Uwe Hermann 515ab0889e Various #include file cosmetic fixes.
Generally include system headers before local headers, unless there's
a technical reason to use another order.
2015-03-24 19:30:16 +01:00
Uwe Hermann 98fec29ecb Various NULL-check consistency fixes. 2015-03-24 19:30:16 +01:00
Uwe Hermann a95f142e88 Some more g_try_*alloc() fixes.
As per documented rules in HACKING, we don't check "small" allocations.
2015-03-24 19:30:16 +01:00
Uwe Hermann 1a46cc62e2 Improve readability and clarity of some numbers. 2015-03-24 19:30:16 +01:00
Uwe Hermann f3f19d1131 Fix a bunch of typos. 2015-03-24 18:01:18 +01:00
Uwe Hermann 8249889dfa demo: Fix SR_CONF_DEVICE_OPTIONS variant type. 2015-03-22 02:15:31 +01:00
Uwe Hermann 0f34cb4723 Channel names consistency fixes and simplifications. 2015-03-22 02:15:30 +01:00
Uwe Hermann db24496ac8 Remove unneeded #endif comments. 2015-03-22 02:15:30 +01:00
Uwe Hermann 93b118da4f Consistency and whitespace fixes for switch statements. 2015-03-22 02:15:30 +01:00
Uwe Hermann d0148a506e Make memset() invocations consistent across all files. 2015-03-22 02:15:30 +01:00
Uwe Hermann 0c5f2abc66 Random whitespace and other minor fixes. 2015-03-22 02:15:30 +01:00
Uwe Hermann 421bc3eba0 session_file.c: Use config_*() wrappers. 2015-03-22 02:15:30 +01:00
Uwe Hermann dcd438ee35 Simplify a few config_set() callbacks.
Also, extended logging and random whitespace fixes.
2015-03-22 02:15:30 +01:00
Uwe Hermann 329733d92c Constify a few arrays and variables. 2015-03-21 20:30:53 +01:00
Uwe Hermann 53cda65a6b Remove unneeded explicit array size specification. 2015-03-21 19:40:19 +01:00
Uwe Hermann 1beccaed46 Various minor whitespace fixes. 2015-03-21 19:28:54 +01:00
Uwe Hermann e8be616955 tondaj-sl-814: Add missing SR_PRIV. 2015-03-21 19:01:10 +01:00
Uwe Hermann 145d794fac serial-dmm: Use g_malloc()/g_free(). 2015-03-21 18:46:00 +01:00
Uwe Hermann c35276dd92 vc870: Fix a compiler warning.
src/dmm/vc870.c: In function 'flags_valid':
  src/dmm/vc870.c:380:54: warning: unused parameter 'info'
  [-Wunused-parameter]
   static gboolean flags_valid(const struct vc870_info *info)
2015-03-21 18:43:17 +01:00
Uwe Hermann 1a8639164e Minor cosmetics, cleanups. 2015-03-21 18:28:02 +01:00
Uwe Hermann 8852eb75d1 serial-dmm: Drop obsolete extern declaration. 2015-03-21 13:17:51 +01:00
Martin Ling bcbef5ed70 serial-dmm: Declare each meter type in only one place. 2015-03-21 13:13:34 +01:00
Martin Ling 4f840ce965 Pass driver struct pointer to driver callbacks.
This lays the groundwork for subdrivers to share callbacks without
needing a separate wrapper function for each subdriver.
2015-03-21 13:09:40 +01:00
Martin Ling 9e60a31fb9 Construct driver array at runtime, from an array of per-file arrays.
This lays the groundwork for drivers to define their own array of
subdrivers, rather than having to list each subdriver here.
2015-03-21 13:09:39 +01:00
Martin Ling 702f42e8eb rigol-ds: Add DS1000Z series support.
Tested on an MSO1104Z with firmware 00.04.02.SP4.

The analog channels are captured correctly. For the MSO series, with digital
channels, there are two outstanding issues:

1. Logic data is retrieved per-channel, one byte per sample, with the value
   in the LSB of each byte. The current datafeed logic format doesn't allow
   this format to be passed on directly. I suggest we resolve that rather than
   making the driver buffer and interleave the data.

   As stands, the code will retrieve data for all channels and pass it onto
   the datafeed with unitsize=1. Channel D0 can used correctly if selected
   alone. For other channels, data is passed to the frontend but the API does
   not provide a way to associate it with the correct channel.

2. Channels CH3 and CH4 are multiplexed with D0-7 and D8-15 respectively, so
   enabling these is mutually exclusive. We don't currently have a way to
   express this constraint to the frontend.
2015-03-21 01:55:55 +01:00
Uwe Hermann c36f78f772 Add initial Voltcraft VC-870 support.
There are a few details that have yet to be implemented or
reverse engineered and tested.
2015-03-20 21:27:04 +01:00
Bartosz Golaszewski 350b8b07f0 baylibre-acme: Fix a double free in bl_acme_set_shunt().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-03-20 16:54:02 +01:00
Martin Ling cfcdf57677 scpi-pps: Add profile for Rigol DP821A. 2015-03-20 15:33:49 +01:00
Martin Ling 7d4f1741e3 scpi-pps: Initialise sdi with status SR_ST_INACTIVE.
Without this change a segfault occurs at exit after scan, because
dev_close() is called and the device is believed to be open.
2015-03-20 15:33:49 +01:00
Martin Ling 40c2c9159c rigol-ds: Fix broken channel group check in config_list(). 2015-03-19 23:01:50 +00:00
Martin Ling f579d08bc5 rigol-ds: Data source is a device option, not per channel group. 2015-03-19 23:01:50 +00:00
Martin Ling 98bfc4741f rigol-ds: Use sr_scpi_get_bool(). 2015-03-19 23:01:50 +00:00
Martin Ling bff16ba817 rigol-ds: Fix double free.
std_dev_clear() frees all channel groups, so this one is not required.
2015-03-19 23:01:50 +00:00
Martin Ling 16aca7661b rigol-ds: Fix wrong channel group malloc size. 2015-03-19 23:01:50 +00:00
Martin Ling 6f1346fbd7 Change API of channel accessor functions to take struct sr_channel *. 2015-03-19 21:57:31 +00:00
Martin Ling 837b08660a Add sdi pointer to struct sr_channel. 2015-03-19 21:41:51 +00:00
Martin Ling 5e23fcab88 Simplify channel creation.
We always follow sr_channel_new() with a call to add the channel to the sdi.
Tidy up a bit by adding this functionality to sr_channel_new() instead.
2015-03-19 21:37:33 +00:00
Uwe Hermann bc49777251 fx2lafw: Replace obsoleted strncmp() calls.
The fixed lengths for strncmp() can no longer be used since strings of
various lengths can be passed to match_manuf_prod(). Use strcmp() instead.
2015-03-19 18:25:55 +01:00
eightdot 6fcf3f0a22 Various fixes/updates to make the driver compile.
This patchset was originally done by eightdot <gituser@eightdot.eu> by
manually forward-porting parts of the changes done by Bert Vermeulen (see
previous commits), but then heavily modified by Uwe Hermann to be based on
top off the (git-)rebased patches from Bert Vermeulen instead.

Note: This initial DSLogic code is *not* yet in a working or usable
state. It should be considered as a basis for further work only, for now.
2015-03-19 18:25:55 +01:00
Bert Vermeulen b9d530920f fx2lafw: Basic acquisition support for DSLogic. 2015-03-19 18:25:55 +01:00
Bert Vermeulen a7d7f93c1b fx2lafw: scan/firmware support for DSLogic. 2015-03-19 18:25:55 +01:00
Bartosz Golaszewski c04cf9aa81 output: Accept analog packets in csv output module.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-03-16 13:05:45 +01:00
Uwe Hermann f7ab2f231a ols: Fix a compiler warning (unused variable).
CC       src/hardware/openbench-logic-sniffer/api.lo
  ../src/hardware/openbench-logic-sniffer/api.c: In function 'scan':
  ../src/hardware/openbench-logic-sniffer/api.c:103:10: warning: unused
  variable 'probefd' [-Wunused-variable]
    GPollFD probefd;
            ^
2015-03-13 19:12:47 +01:00
Uwe Hermann ed936ccc7c ols: Fix detection and acquisition on Windows.
Use the more portable sp_input_waiting() instead of g_poll() with FDs.
Thanks to Martin Ling for the hints. This is tested on Linux and Win7
using an OLS; scanning for the device and starting an acquisition works.

Also, add some more debug output.

This fixes bug #562.
2015-03-13 18:08:49 +01:00
Bartosz Golaszewski 5fabeeac6a baylibre-acme: correctly handle channel group options
Split device options into general and channel group settings, and
adjust config_list() callback appropriately.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-03-11 18:23:41 +01:00
Martin Ling bf622e6d00 Rename SR_CONF_NUM_TIMEBASE to SR_CONF_NUM_HDIV. 2015-03-02 12:24:12 +01:00
Uwe Hermann 6df8e239de ut372: Minor cosmetics. 2015-03-02 12:23:32 +01:00
Martin Ling 12318aab96 ut372: Support count mode. 2015-03-01 23:30:48 +00:00
Martin Ling 8c9092b00b ut372: Handle flags correctly.
Packets will now be rejected if the device is not displaying RPM.
2015-03-01 23:26:33 +00:00
Martin Ling 118268a2fe ut372: Break out character-pair decoding to a separate function. 2015-03-01 22:54:45 +00:00
Martin Ling 472bef3990 ut372: Implement initial protocol parser.
For now this only works correctly if the device is in the default
state showing current RPM. The flags are not checked.
2015-03-01 22:36:52 +00:00
Martin Ling f3cde30904 ut372: Initial sub-driver skeleton. 2015-03-01 22:30:57 +00:00
Baruch Even 2cb63065f5 serial-dmm: Add MASTECH MS8250B as a supported DMM.
It is an alias and uses the FS9721 driver.
2015-02-27 15:10:19 +01:00
Uwe Hermann d9c3331d12 asix-sigma: Use the more portable g_usleep(). 2015-02-26 11:15:02 +01:00
Bartosz Golaszewski 380ee96fdf baylibre-acme: don't report ACME as detected if no probes are present
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-20 11:22:26 +01:00
Uwe Hermann 3d14ce49e4 baylibre-acme: Fix vendor/device name. 2015-02-17 17:03:41 +01:00
Uwe Hermann e00b3f5897 Various Doxygen updates. 2015-02-17 15:57:21 +01:00
Uwe Hermann d258022db0 baylibre-acme: Drop unneeded comment.
There's indeed no g_fclose() unfortunately. The g_*() wrappers for file
handling are mainly there to deal with portability issues in file names
(encoding, character sets, etc) on different platforms.
2015-02-16 01:57:35 +01:00
Uwe Hermann 3452785431 baylibre-acme: Fix a compiler warning.
Use PRIu64 to avoid the following compiler warning:

    CC       src/hardware/baylibre-acme/gpio.lo
  protocol.c: In function 'bl_acme_set_shunt':
  protocol.c:341:2: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
    g_fprintf(fd, "%llu\n", MOHM_TO_UOHM(shunt));
    ^
2015-02-16 01:57:35 +01:00
Uwe Hermann 391e23a97f baylibre-acme: Minor coding-style, cosmetics. 2015-02-16 01:57:35 +01:00
Bartosz Golaszewski 740ad48ac8 baylibre-acme: Add support for SR_CONF_POWER_OFF.
Allow to remotely cut the power at ACME probe level.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:08 +01:00
Bartosz Golaszewski 289eebd7ca baylibre-acme: Add Linux-specific GPIO helpers.
These functions allow to export, read and set GPIOs using Linux
sysfs interface.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:08 +01:00
Bartosz Golaszewski 61f2b7f74c baylibre-acme: Add support for probe factor setting.
Implement support for SR_CONF_PROBE_FACTOR setting in BayLibre ACME
driver. Given the channel-group parameter this allows to set the
shunt resistance for each probe.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:08 +01:00
Bartosz Golaszewski d3c81725ae SR_CONF_PROBE_FACTOR: New option.
Add new configuration option allowing to modify the probe factor
for oscilloscopes and power-monitors.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Bartosz Golaszewski 6b80b80dcf baylibre-acme: Driver implementation.
Implement basic functionalities for baylibre-acme. Add support
for common config options, device detection and sample reading.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Bartosz Golaszewski dfaee1de17 baylibre-acme: Initial driver skeleton.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Aurelien Jacobs 96cb7faac3 rigol-ds: fix the smallest supported vdiv for the DS2000 series. 2015-02-15 21:15:27 +01:00
Aurelien Jacobs 81b85663f3 rigol-ds: return the actual hardware num_vdiv and vdiv list. 2015-02-15 21:15:21 +01:00
Aurelien Jacobs c33ff3771b rigol-ds: fix search for the closest vdiv.
We try to find the smallest diff by comparing each diff with
the previously known smallest diff, so initially, this smallest diff
should be INFINITY so that we are sure to find a smaller one.

This fixes the following exception:
sr: rigol-ds: Negative vdiv index: -1.
Caught exception: not applicable
2015-02-15 21:15:04 +01:00
Uwe Hermann f44f7e61a3 rigol-ds: Add missing "break" statements. 2015-02-14 19:32:25 +01:00
Uwe Hermann d50725e012 rigol-ds: Add missing 20/50/100V vdiv entries.
These are available on e.g. Rigol DS1102E (or "upgraded" DS1052E).

Without this, if one of the channels happens to have been set to
one of the missing vdiv settings frontends (e.g. PulseView) will
have some trouble using the scope:

  sr: hwdriver: sr_config_get(): key 30012 (vdiv) sdi 0x11bcb70 cg CH1
  sr: rigol-ds: Negative vdiv index: -1.
  std::exception
2015-02-14 19:32:15 +01:00
Uwe Hermann e1b5b7e735 rigol-ds: Add more debug output. 2015-02-14 18:34:04 +01:00
Aurelien Jacobs d5c4144e2c rigol-ds: handle full word trigger slope in config_get().
Some scope can return POSITIVE/NEGATIVE instead of POS/NEG,
so accept this as well.

This closes bug #558.
2015-02-13 16:37:24 +01:00
Aurelien Jacobs b0c9d1d1c2 rigol-ds: SR_CONF_TRIGGER_SLOPE is actually listable. 2015-02-12 17:58:32 +01:00
Aurelien Jacobs 73931b7cc7 input/vcd: fix parse_header() return value check.
Mixing tests for both a boolean and an SR_ERR at the same time is not
really a good idea.
parse_header() actually returns a boolean so only check if it returns FALSE.

This fixes the following gcc-5 warning:

src/input/vcd.c: In function 'receive':
src/input/vcd.c:506:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
   if (!parse_header(in, in->buf) != SR_OK)
                                  ^
2015-02-12 17:58:06 +01:00
Aurelien Jacobs 2617c81a4b Remove the inline qualification from sr_rational_set().
Inlining can only happen in the same compilation unit where the
function was defined, so there is no sense declaring an inline
function in a header if this function is not defined in this
same header.

This fixes the following gcc-5 warning:

In file included from include/libsigrok/libsigrok.h:1066:0,
                 from src/version.c:21:
include/libsigrok/proto.h:36:20: warning: inline function 'sr_rational_set' declared but never defined
 SR_API inline void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q);
                    ^
2015-02-12 11:24:11 +01:00
Aurelien Jacobs ee29d92e14 Correctly copy sr_datafeed_meta in sr_packet_copy().
Commit 5801d558 replaced g_slist_copy_deep() by some incorrect code
that actually leaks the newly allocated memory, instead of doing
a deep copy.

This new version should be more correct, more concise, and it fixes
the following warning:

src/session.c: In function 'sr_packet_copy':
src/session.c:1025:38: warning: passing argument 2 of 'g_slist_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
   g_slist_foreach(meta_copy->config, (GCopyFunc)copy_src, NULL);
                                         ^
In file included from /usr/include/glib-2.0/glib/gmain.h:26:0,
                 from /usr/include/glib-2.0/glib/giochannel.h:33,
                 from /usr/include/glib-2.0/glib.h:54,
                 from src/session.c:24:
/usr/include/glib-2.0/glib/gslist.h:125:10: note: expected 'GFunc {aka void (*)(void *, void *)}' but argument is of type 'void * (*)(const void *, void *)'
void     g_slist_foreach                 (GSList           *list,
         ^
2015-02-12 11:14:37 +01:00
Uwe Hermann c4f9582714 sr_strerror_name(): Add missing SR_ERR_IO entry. 2015-02-11 16:26:12 +01:00
Bartosz Golaszewski 3c5582595a SR_ERR_IO: new error code
Add new error code which can be used to notify the user about
general input/output errors.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-11 16:25:30 +01:00
Uwe Hermann 187cfc604e backend: Add basic transform module sanity checks. 2015-02-11 15:24:38 +01:00
Uwe Hermann d74d30bb14 transform: Add an "invert" transform module.
This inverts the data values:

 - An analog value of x becomes 1/x.

 - A digital value of 0 becomes 1 (and vice versa).
2015-02-11 15:24:34 +01:00
Uwe Hermann 43caa46623 transform: Add a "scale" transform module. 2015-02-11 15:24:30 +01:00
Uwe Hermann 39f1752eff transform: Add a "nop" transform module.
This doesn't do anything, just passes input packets on unmodified.
2015-02-11 12:23:02 +01:00
Uwe Hermann c0a1e532f5 transform: Hook up transforms. 2015-02-11 12:23:02 +01:00
Uwe Hermann 988357ca2f transform: Add a basic set of API calls. 2015-02-11 12:23:02 +01:00
Uwe Hermann 790320f605 transform: Add struct sr_transform and struct sr_transform_module. 2015-02-11 12:23:02 +01:00
Daniel Elstner 57ba5f3d56 sysclk-lwla: Widen constant to 64 bit before shifting
(lwla_convert_trigger): Fix trigger mask computation bug introduced
by recent change:  Widen constant to 64 bit before shifting so that
channel nunmbers beyond 32 are processed correctly.
2015-01-31 21:09:01 +01:00
Uwe Hermann 5801d558e7 Lower dependency to glib 2.32.
By avoiding g_slist_copy_deep() for now, we can easily allow libsigrok
to build against glib 2.32 (less hassle for users of stable/older
distros or OSes).
2015-01-29 13:55:55 +01:00
Uwe Hermann 8656a71790 output/gnuplot: Use .dat as suggested file extension.
Gnuplot doesn't have any "official" file name extension(s). It uses
(at least) two different types of files basically:

 - "control files": These can have many different somewhat commonly
   used extensions such as .gpi, .gnu, .gnuplot, .gp, .plt, .gih,
   others. These files don't contain data, only Gnuplot commands such
   as 'set yrange [75:105]', 'set ylabel "foo" offset 1', and so on.

 - "data files": This is what libsigrok reads and writes. These files
   contain actual data to be graphed by Gnuplot (with the help of a
   specially-crafted control file, see above). The data is usually in
   a tab-separated format. The common file extension is usually .dat,
   though many others are possible as well.
2015-01-27 18:05:30 +01:00
Uwe Hermann 4fb0a5f8a0 in/out: Minor consistency renames.
- 'struct sr_input *' variables are consistently named 'in'.
 - 'struct sr_input_module *' variables are consistently named 'imod'.

 - 'struct sr_output *' variables are consistently named 'o'.
 - 'struct sr_output_module *' variables are consistently named 'omod'.
2015-01-27 18:05:30 +01:00
Joel Holdsworth a82c83c6a5 output/wav: Improved description 2015-01-27 18:05:30 +01:00
Joel Holdsworth 8a174d2342 output: Added preferred file extension field
This fixes parts of bug #541.
2015-01-27 18:05:29 +01:00
Joel Holdsworth c7bc82ffa1 input: Added preferred file extension field
This fixes parts of bug #541.
2015-01-27 18:05:25 +01:00
Uffe Jakobsen 19643b96e2 Fix FreeBSD issue with libusb_get_port_numbers()
Currently (as of date 20150122) an ioctl problem within the
FreeBSD kernel is preventing libusb_get_port_numbers() from working.
Hence calls to libusb_get_port_numbers() will always return 0.
This makes it impossible to establish a physical path the the usb device.

This problem has existed "forever" -
meaning that libusb_get_port_numbers() has never worked.

A fix is committed to FreeBSD "current" head  -
and will later be merged (MFC'ed) to maintenance branches.
See: https://svnweb.freebsd.org/base?view=revision&revision=277417

Additionally FreeBSD requires that devices prior to calling
libusb_get_port_numbers() have been opened with libusb_open().

The patch is "forwards-compatible".
Currently it acts specificly to libusb_get_port_numbers()
currently returning 0 on FreeBSD.
In these situations it constructs an artificial path to the device.
When FreeBSD kernels appears with proper working ioctl
supporting libusb_get_port_numbers() the code will construct
proper physical paths for newer kernels - while still generating
artificial physical paths for older defective kernels.
2015-01-25 23:36:29 +01:00
Bartosz Golaszewski 7a8a1aba37 demo: implement averaging support
Add support for averaging and avg_samples option to the demo device.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-01-25 18:00:42 +01:00
Bartosz Golaszewski 9ed444e622 new config options: averaging
Add new config options to libsigrok - 'averaging', which allows to
enable averaging of samples and 'avg_samples' for setting the number
of samples to be averaged over in each cycle.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-01-25 18:00:40 +01:00
Uwe Hermann 7a54232ba0 sr_input_new(): Add missing @param comment.
This fixes a Doxygen warning:

  src/input/input.c:209: warning: The following parameters of sr_input_new(const struct sr_input_module *imod, GHashTable *options) are not documented:
    parameter 'imod'
2015-01-19 08:47:40 +01:00
Uwe Hermann 718a9d382f Fix two warnings when libserialport is not used.
CC       src/fallback.lo
  src/fallback.c: In function 'sr_serial_list':
  src/fallback.c:26:59: warning: unused parameter 'driver' [-Wunused-parameter]
   SR_API GSList *sr_serial_list(const struct sr_dev_driver *driver)
                                                             ^
  src/fallback.c: In function 'sr_serial_free':
  src/fallback.c:31:51: warning: unused parameter 'serial' [-Wunused-parameter]
   SR_API void sr_serial_free(struct sr_serial_port *serial)
2015-01-17 21:47:59 +01:00
Mathias Katzer 3b95bd9152 scpi: Fix incomplete data issue for e.g. Hameg HMO1024.
On a Hameg HMO1024 you get incomplete data because the USB transfer takes
longer than the scpi->read_timeout_ms of 1 second that is defined in
scpi_dev_inst_new(). Therefore reset the timeout in sr_scpi_get_string()
whenever the device sends a partial response.
2015-01-11 01:43:13 +01:00
Mathias Katzer f62f595bfc hameg-hmo: Fix double-free issue. 2015-01-11 01:43:12 +01:00
Mathias Katzer a1b61e6e04 hameg-hmo: Set SR_CONF_GET | SR_CONF_SET for frame limit.
Reading analog data from an HMO1024 (Firmware 04.527) failed because the
frame limit could not be set.
2015-01-11 01:43:12 +01:00
Janne Huttunen 787ec9dbd9 Limit frames instead of samples.
Since every individual measurement is represented by a single frame
and a "sample" isn't all that meaningful concept in this context,
it makes more sense to define possible limit in number of frames.
Make the es51919 driver to support setting a frame limit instead of
a sample limit.
2015-01-06 20:10:17 +01:00
Janne Huttunen a6413fa58e Use frames to group a single measurement result together.
In most, but not all, modes the ES51919 reports two separate
analog values for each measurement sample. These values are
mapped to two separate channels and sent in two separate
packets.

A client program needs a way to determine which results are
parts of the same measurement and also know when a complete
measurement is received so it can process the sample. Use
the frame begin and end packets to separate groups that each
represent a single complete measurement.
2015-01-06 20:10:17 +01:00
Janne Huttunen bb983c666a Fix the channel indexes of the es51919 driver.
Set the channel indexes to unique values instead of setting
them all zero.
2015-01-06 20:10:17 +01:00
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
Martin Ling bb27c76513 fluke-dmm: Make serial write calls block, and fix error handling.
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.

Also fix error handling for these calls, which seems to have been retained from
previous direct usage of write() to a serial port fd.
2014-09-24 23:30:30 +02:00
Martin Ling 50276118ca fluke-dmm: Make serial write calls block, and fix error handling.
These calls were previously nonblocking, but have no partial write handling.
They are made from scan and acquisition_start contexts where they are free
to block.

Remove the SERIAL_NONBLOCK at open, which only applied during scan, since all
calls in the scan are now explicitly blocking.

Also fix error handling for these calls, which appears to have been kept
from a previous direct usage of write() on a serial port fd.
2014-09-24 23:30:30 +02:00
Martin Ling 707fa85ad5 fluke-dmm: Mark serial read call as nonblocking.
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. Only one byte is read. The case of 0 being returned
is not handled, but the call is only made if G_IO_IN occurred so in theory,
there should be a byte available. It might be wise to add handling for a
return of 0 nonetheless, as I'm not sure if this is always accurate.
2014-09-24 23:30:23 +02:00
Martin Ling 55e32714f9 conrad-digi-35-cpu: Make serial write call block.
This call was previously nonblocking, but there is no partial write handling.
It is only called from config_set so it is free to block.
2014-09-24 23:30:01 +02:00
Martin Ling 0ac161bba0 conrad-digi-35-cpu: Remove SERIAL_NONBLOCK flag from open at scan time.
This open call is only made to check access, the port is closed immediately
afterwards. The flag therefore has no effect.
2014-09-24 23:30:01 +02:00
Martin Ling c9fc06d7f0 colead-slm: Mark serial read calls as nonblocking.
This is an odd one. These calls are made from a receive handler so should not
block, and appear to be setup correctly to handle partial reads or no data
available. However, the driver was not opening the port with SERIAL_NONBLOCK
so these calls would have been blocking. Make them nonblocking.
2014-09-24 23:30:01 +02:00
Martin Ling 258a23134d center-3xx: Remove SERIAL_NONBLOCK flag.
All serial calls in this driver are now explicitly (non)blocking.
2014-09-24 23:30:00 +02:00
Martin Ling c1da74fc0a center-3xx: 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:00 +02:00
Martin Ling 3582ce8a01 center-3xx: Mark serial read call as nonblocking.
This call was already nonblocking because the driver opens the port with the
SERIAL_NONBLOCK flag. Partial reads are handled.
2014-09-24 23:30:00 +02:00
Martin Ling d7b269da8f cem-dt-885x: Mark serial access as nonblocking, remove SERIAL_NONBLOCK flag.
These calls were already nonblocking since this driver opened the port with
the SERIAL_NONBLOCK flag. Having marked them as such, we can remove the flag.

Also remove an unnecessary reopen of the port to change its blocking status.
2014-09-24 23:30:00 +02:00
Martin Ling ca4266a02f brymen-dmm: Remove SERIAL_NONBLOCK flag.
All serial read/write calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:00 +02:00
Martin Ling 776313d997 brymen-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:00 +02:00
Martin Ling 44be13b1f8 brymen-dmm: Mark serial read calls as nonblocking.
The driver opens the port with SERIAL_NONBLOCK so these were already
nonblocking, and are handled appropriately.
2014-09-24 23:30:00 +02:00
Martin Ling 5305266a28 atten-pps3xxx: Remove SERIAL_NONBLOCK.
All serial read/write calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:00 +02:00
Martin Ling c3116bc311 atten-pps3xxx: 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:00 +02:00
Martin Ling e7b4103697 atten-pps3xxx: Make serial write call block in scan.
This is called at scan time so free to block. There is no partial write
handling and a response is expected afterwards. This should therefore be a
blocking call.
2014-09-24 23:30:00 +02:00
Martin Ling 25dd083128 appa-55ii: Mark serial read nonblocking and remove SERIAL_NONBLOCK.
This is the only read/write call in the driver. It is already non-blocking
and is handled appropriately.
2014-09-24 23:29:49 +02:00
Martin Ling 64c536be52 aglient-dmm: Remove SERIAL_NONBLOCK flag.
All serial calls in this driver are now explicitly (non)blocking.
2014-09-24 23:18:21 +02:00
Martin Ling a5053ddd21 agilent-dmm: Make serial write call block in send.
This call is executed from an event handler context was previously
nonblocking, however there is no handling for a partial write.

The output buffer is unlikely to be full and the commands to be sent
are short, so it should be OK to make this a blocking call.
2014-09-24 23:18:21 +02:00
Martin Ling 485b9ae34d agilent-dmm: Make serial write call block in scan.
This call is executed at scan time so is free to block. There is no
handling for a partial write and a response is expected immediately
afterwards. It should therefore be a blocking call.
2014-09-24 23:18:21 +02:00
Martin Ling e0b781a45b agilent-dmm: Mark serial read call as nonblocking.
This driver opens the port with the SERIAL_NONBLOCK flag, so this call is
already a nonblocking one, and is handled appropriately.
2014-09-24 23:18:21 +02:00
Martin Ling 2e360339f9 serial-dmm: Remove SERIAL_NONBLOCK flag.
All serial read/write calls in this driver are now explicitly
nonblocking so there is no need for this flag.
2014-09-24 23:18:20 +02:00
Martin Ling 4277ac349c serial-dmm: Mark serial read/write calls as nonblocking.
This driver opens the port with the SERIAL_NONBLOCK flag so these calls were
already non-blocking.
2014-09-24 23:18:20 +02:00
Martin Ling 02bd1d0298 colead-slm: Mark serial write call as blocking.
This driver opens the port without the SERIAL_NONBLOCK flag,
so this call was already blocking.
2014-09-24 23:18:20 +02:00
Martin Ling bbff0fe0d2 manson-hcs-3xxx: Mark serial read call as blocking.
This driver opens the port without the SERIAL_NONBLOCK flag, so this call is
already a blocking one.
2014-09-24 23:18:20 +02:00
Martin Ling bf505eed6b serial_readline: Implement using sp_blocking_read. 2014-09-24 23:18:20 +02:00
Martin Ling 18e4d5bc45 serial_stream_detect: Make read nonblocking.
This code implements its own waiting based on baudrate, so the read itself
should be nonblocking. In general it will have been already, since drivers
almost universally use the SERIAL_NONBLOCK flag.
2014-09-24 23:18:20 +02:00
Soeren Apel 2fe6210af6 Add serial_num and connection_id fields to sr_dev_inst 2014-09-24 00:40:03 +02:00
Soeren Apel db156e5409 Add usb_get_port_path() helper function
There is currently no way to uniquely identify USB devices in
libsigrok. It uses the "bus.address" scheme which is only
constant as long as the device remains attached to the bus.
In order to allow USB device persistence in PulseView, devices
need to provide a unique identifier even in absence of a
serial number. This function is the first step as it provides
the ability to query the physical location of a USB device.
2014-09-24 00:40:03 +02:00
Bert Vermeulen f12d997948 demo: Fix pattern mode and amplitude option publishing. 2014-09-23 22:40:47 +02:00
Bert Vermeulen 9a10ce65d6 colead-slm: Properly check acquisition sample limit. 2014-09-23 22:27:34 +02:00
Bert Vermeulen 79f92686c6 session: Don't try to send packets if no session has been set.
This indicates a bug, but let's not segfault if it happens.
2014-09-22 00:47:22 +02:00
Bert Vermeulen 04c2f202f2 input/chronovu_la8: Fix broken I/O loop. 2014-09-22 00:47:22 +02:00
Uwe Hermann af945a6625 Typos and consistency fixes. 2014-09-19 01:03:32 +02:00
Bert Vermeulen d4ccb6bd8f yokogawa-dlm: Don't implement dummy scan options. 2014-09-17 17:41:41 +02:00
Bert Vermeulen 5827f61b64 Publish config key capabilities.
Every driver now publishes its device option config keys, i.e. the
list fetched with sr_config_list(SR_CONF_DEVICE_OPTIONS), with a
set of flags indicating which methods are implemented by the driver
for that key.

The config keys are OR'ed with any combination of SR_CONF_GET,
SR_CONF_SET and SR_CONF_LIST. These are defined as the high bits
of the uint32_t config key. Clients can OR config keys with
SR_CONF_MASK to strip out these bits. This mask will be kept up to
date if other bits are added to the capabilities list; clients MUST
therefore use SR_CONF_MASK for this.

Some keys don't have capability bits added, such as the informative
device type keys (SR_CONF_MULTIMETER, SR_CONF_OSCILLOSCOPE, ...) and
SR_CONF_CONTINUOUS.

Scan options do not have capabilities bits.
2014-09-17 15:36:11 +02:00
Bert Vermeulen 138589b02e beaglelogic: Add missing scan options, and cleanup. 2014-09-16 23:51:38 +02:00
Bert Vermeulen a0e0bb4149 Consistently use 'scanopts' variable across all drivers. 2014-09-16 22:19:02 +02:00
Bert Vermeulen f254bc4bba Consistently use 'devopts' variable across all drivers. 2014-09-16 22:11:39 +02:00
Bert Vermeulen 584560f142 Change type of SR_CONF keys to uint32_t. 2014-09-16 21:22:41 +02:00
Martin Ling 13fef1ed24 hwdriver: Validate types of GVariants passed by user. 2014-09-14 04:47:12 +01:00
Martin Ling edbd09250b scpi: Remove trailing carriage returns. 2014-09-11 17:20:28 +02:00
Bert Vermeulen 25f20faf0d input: Add debug output. 2014-09-10 22:55:50 +02:00
Bert Vermeulen 88189019ac input/binary: Fix broken I/O loop. 2014-09-10 22:53:28 +02:00
Bert Vermeulen 013ec84b83 Don't start session with 0-channel devices.
Drivers aren't really able to deal with that in some cases, and it
denotes a frontend bug.
2014-09-10 18:21:51 +02:00
Bert Vermeulen cfd8ec53ab scpi: Don't return NULL device from unsuccessful scan. 2014-09-09 19:53:55 +02:00
Bert Vermeulen bfc8679937 scpi-pps: Clean up HP 6632B profile. 2014-09-09 13:24:30 +02:00
Bert Vermeulen 331f56543a scpi-pps: Fix compile warning. 2014-09-08 23:31:54 +02:00
Bert Vermeulen fdedbfcdef scpi-pps: Fix config_set checks. 2014-09-08 23:30:21 +02:00
Aurelien Jacobs effb9dd1c2 rigol-ds: replace some magic numbers by appropriate constant or variable
This fixes bug #406.
2014-09-08 12:58:30 +02:00
Bert Vermeulen bc4a2a46ed Add support for HP 6632B. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 01b0257aef scpi-pps: Create one channel per MQ/output combination.
This allows frontends to trivially select which MQs on which channels
they want to see; others won't even be fetched.
2014-09-08 12:45:21 +02:00
Bert Vermeulen 379d260965 Add private storage pointer to struct sr_channel. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 478c8d923e scpi-pps: Simplify SCPI command handling. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 3222ee103d scpi-pps: Add support for Rigol DP831A/DP832A. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 58b77c41ff scpi-pps: Use regex to match model names. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 22c18b0370 scpi-pps: Generalize vendor name cleanup. 2014-09-08 12:45:21 +02:00
Bert Vermeulen d4eabea847 scpi-pps: Add support for Rigol DP832. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 9e45cd41fd scpi-pps: Add basic cross-vendor PPS functionality. 2014-09-08 12:45:21 +02:00
Bert Vermeulen a1eaa9e066 Revamp PPS-related config keys. 2014-09-08 12:45:21 +02:00
Bert Vermeulen ca1a7cb56f scpi-pps: Initial driver skeleton. 2014-09-08 12:45:21 +02:00
Aurelien Jacobs af1e487e3f brymen-bm86x: Add current loop sensor support. 2014-09-06 17:22:03 +02:00
Bert Vermeulen 7343ad1ec7 scpi/gpib: Rename backend to scpi_libgpib.
libgpib is the userspace component to linux-gpib's kernel modules that
implement low-level interface drivers.

When libsigrok gets userspace GPIB interface drivers, that backend will
be the "official" scpi_gpib.
2014-09-05 18:33:48 +02:00
Martin Ling bb2a4ed407 Add GPIB SCPI backend using linux-gpib and libgpib. 2014-09-05 10:34:04 +01:00
Bert Vermeulen e8779db70c input/wav: Now really correctly check supported sample size. 2014-09-02 22:09:17 +02:00
Bert Vermeulen 110fe1b4a2 agilent-dmm: U124xx/U125xx: Add current loop sensor support.
Also fixes frequency support.
2014-09-02 21:55:52 +02:00
Bert Vermeulen e82d34a9c2 scpi/usbtmc: Minor debug output changes. 2014-09-02 21:27:16 +02:00
Bert Vermeulen 73145219c0 input/wav: Correctly check supported sample size. 2014-09-02 21:26:15 +02:00
Marcus Comstedt 28d9df7292 input/wav: Fix broken handling of float32 samples on big endian
Also, make sure that floats are 32 bit even in the case of an
extensible header.
2014-09-02 19:14:25 +02:00
Bert Vermeulen c7f5219e62 agilent-dmm: Add temperature regex to U125xx parser. 2014-09-02 01:01:56 +02:00
Bert Vermeulen a965748ae2 agilent-dmm: U124xx/U125xx: support 5 more modes.
This adds support for resistance, capacitance, frequency, continuity,
and temperature.
2014-09-02 00:55:41 +02:00
Matthias Heidbrink 5791bdf604 gmc-mh-1x-2x-rs232: Completed energy measurement ranges (V, A, W) for Metrahit 29S. 2014-09-01 23:14:56 +02:00
Bert Vermeulen ee2bcdfc44 agilent-dmm: U124x/U125x fixes. 2014-09-01 21:44:37 +02:00
Uwe Hermann 129d5bc961 error.c: Add missing entries. 2014-09-01 00:08:53 +02:00
Soeren Apel ac10a927b5 yokogawa-dlm: Replace g_try_malloc() calls and fix coding style 2014-08-31 00:42:10 +02:00
Soeren Apel 0028d5a1ee yokogawa-dlm: Lower timeout to increase throughput and fix data acq bug 2014-08-31 00:42:10 +02:00
Soeren Apel af3487ec28 yokogawa-dlm: Do not block when receiving and save frame length in scope state 2014-08-31 00:42:10 +02:00
Soeren Apel 8ab929d614 yokogawa-dlm: Flesh out driver with current state of development 2014-08-31 00:42:10 +02:00
Soeren Apel 107639373d yokogawa-dlm: Integrate driver skeleton 2014-08-31 00:42:10 +02:00
Bert Vermeulen 6e8d95a50c input/csv: Use uint64 for samplerate option. 2014-08-30 20:16:45 +02:00
Bert Vermeulen edd28877cc input/chronovu_la8: Use uint64 for samplerate option. 2014-08-30 20:15:30 +02:00
Bert Vermeulen 10288172be input/binary: Use uint64 for samplerate option. 2014-08-30 20:13:13 +02:00
Bert Vermeulen 4edba404b0 agilent-dmm: Add U124xx device IDs. 2014-08-30 19:32:15 +02:00
Bert Vermeulen 173378f0f5 agilent-dmm: Add provisional support for the U124xx. 2014-08-29 23:42:06 +02:00
Bert Vermeulen f857bd928d agilent-dmm: Assume all A and B models are identical on the wire. 2014-08-29 23:42:06 +02:00
Bert Vermeulen 51b92b7da4 agilent-dmm: Add RMS flag to AC voltage modes. 2014-08-29 23:42:06 +02:00
Bert Vermeulen f216eb8699 agilent-dmm: Correctly parse negative overload. 2014-08-29 23:42:06 +02:00
Uwe Hermann e6284bf09f Remove unneeded subdriver debug messages. 2014-08-29 23:02:22 +02:00
Bert Vermeulen 7c03b56443 agilent-dmm: Fix value parser.
This considered 0.0 to be an invalid result for no good reason.
2014-08-28 17:44:24 +02:00
Peter Zotov 6f479a0a72 Add support for mcupro Logic16, a Saleae Logic16 clone.
From sigrok's point of view, this analyzer has two differences:

  * It does not require uploading the firmware.
  * It returns garbage in some registers used for sanity checks.
    Saleae's software ignores that garbage; sigrok only does if it
    specifically detects the mcupro clone.
2014-08-28 14:03:21 +02:00
Bert Vermeulen 4f979115a4 input: sr_input_scan_*() now return a status code.
SR_OK: a match was found.
SR_ERR: no match.
SR_ERR_DATA: a match was found but the module cannot handle the input.
SR_OK_CONTINUE: some module didn't have enough data to be sure.
2014-08-28 00:22:13 +02:00
Bert Vermeulen aad21bd866 Add error string for SR_OK_CONTINUE. 2014-08-28 00:19:36 +02:00
Bert Vermeulen b7f446051c Add SR_ERR_DATA. 2014-08-28 00:19:21 +02:00
Bert Vermeulen cbd9e6e987 input/wav: Support for WAVE_FORMAT_EXTENSIBLE.
This is needed for supporting > 16-bit PCM samples.
2014-08-27 15:55:52 +02:00
Bert Vermeulen 962d43440a input/wav: use our own endian macros.
These should work better on non-aligned memory locations.
2014-08-26 22:48:12 +02:00
Bert Vermeulen 5bf0dd6aff Add RB16S and RB32S (signed) macros.
Also note signedness of all the endian macros.
2014-08-26 22:45:38 +02:00
Bert Vermeulen 06ad20bebf input: Avoid warnings on all-zero static struct entries. 2014-08-26 12:38:41 +02:00
Bert Vermeulen b84cba4dbf input: Convert binary module. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 75cb428f9f input: format_match() is not required in an input module. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 02e24c0ce0 input: Convert chronovu-la8 module. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 5e83cd741f input/vcd: Minor code cleanup. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 33e4303baa input: Only feed scanned header to streams, not scanned files. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 115fbe9410 input: Only use header buffer for modules that need it.
The buffer was leaking into modules that didn't ask for it.
2014-08-26 01:55:41 +02:00
Bert Vermeulen 0a4d68f74b input/wav: Send END packet on cleanup. 2014-08-26 01:55:41 +02:00
Bert Vermeulen c10ef17c23 input/vcd: Send END packet on cleanup. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 41d214f61a input: Convert CSV module. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 57486a7528 input: sr_input_new() always allocates the instance buffer. 2014-08-26 01:55:41 +02:00
Bert Vermeulen fe4fe25bf5 input: Fix option enumeration. 2014-08-26 01:55:41 +02:00
Bert Vermeulen d65fcbcd41 input: Fix internal API docs. 2014-08-26 01:55:41 +02:00
Bert Vermeulen bd0bfaafd8 input: Actually return a NULL-terminated array. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 20e8882106 input: Frontends don't need to see SR_INPUT_META_*. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 7db0639495 input: Fixes and VCD. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 0f3dbc9530 input: Fix up API documentation. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 17bfaca62a input: Introduce new input module API.
This is a work in progress.
2014-08-26 01:55:41 +02:00
Bert Vermeulen d514d35dab input: make sr_input{_module} opaque to clients. 2014-08-26 01:55:41 +02:00
Bert Vermeulen d4c937749a input: s/format/module in all naming. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 81a3497655 fx2lafw: Code cleanup. 2014-08-26 01:49:00 +02:00
Bert Vermeulen 1685c27619 Avoid warnings on all-zero static struct entries. 2014-08-26 01:48:27 +02:00
Bert Vermeulen 84cbaf77b4 pipistrello-ols: Disable unused trigger stages.
Thanks to Magnus Karlsson for this fix.
2014-08-25 01:00:55 +02:00
Bert Vermeulen acc885c755 pipistrello-ols: Preliminary port to current API. 2014-08-25 01:00:55 +02:00
magnuskarlsson b94cff407f DEMUX and RLE fixes 2014-08-25 01:00:55 +02:00
magnuskarlsson 1e0de84608 added edge triggers 2014-08-25 01:00:55 +02:00
magnuskarlsson 1f9bcd0f94 fixed typos 2014-08-25 01:00:55 +02:00
magnuskarlsson 72716f15be fixed a problem with USB defines 2014-08-25 01:00:55 +02:00
magnuskarlsson 4bd80e1228 added pipistrello-ols
Conflicts:
	configure.ac
	src/hwdriver.c
2014-08-25 01:00:55 +02:00
Soeren Apel 562b7ae513 hameg-hmo / rigol-ds: Restore compatibility with std_dev_clear() 2014-08-24 16:54:38 +02:00
Martin Ling 14e1aa6df0 rigol-ds: Fix duplicated vendor string for Agilent devices. 2014-08-22 20:15:32 +01:00
Aurelien Jacobs 01f6e330f8 serial: re-implement sr_serial_find_usb() using new libsp APIs 2014-08-20 17:48:26 +02:00
Bert Vermeulen fdefc40aec output: Fix options enumeration. Again. 2014-08-20 17:33:09 +02:00
Martin Ling aba57f3550 Close zip file at end of sr_session_file_check.
From patch sent to sigrok-devel by jerryxjtu.
2014-08-20 14:48:29 +02:00
Marc Schink 879dd50fb6 output: Allocate additional memory for NULL terminator.
Best regards,
Marc

>From a7228150fdea91a65b5d70359bf51b87d2572edf Mon Sep 17 00:00:00 2001
From: Marc Schink <sigrok-dev@marcschink.de>
Date: Wed, 20 Aug 2014 05:34:57 -0400
Subject: [PATCH] output: Allocate additional memory for NULL terminator.
2014-08-20 14:20:55 +02:00
Marc Schink f817f05aac ikalogic-scanaplus: Free device context to fix memory leak.
Best regards,
Marc

>From 779ef3a1150b3679ab357ceb0e2f50785ad90d28 Mon Sep 17 00:00:00 2001
From: Marc Schink <sigrok-dev@marcschink.de>
Date: Wed, 20 Aug 2014 05:42:07 -0400
Subject: [PATCH] ikalogic-scanaplus: Free device context to fix memory leak.
2014-08-20 14:20:55 +02:00
Bert Vermeulen 9fc318d9ef output: Fix double free. 2014-08-19 00:01:57 +02:00
Bert Vermeulen 499c85dce5 output: Fix output option enumeration. 2014-08-19 00:01:57 +02:00
Marcus Comstedt 7754fb4d93 saleae-logic16: Recognize FPGA FIFO overflow status 2014-08-17 16:24:14 +02:00
Bert Vermeulen af7d656d37 output: Constify module options. 2014-08-15 20:24:00 +02:00
Bert Vermeulen fc74643098 output: Actually return a NULL-terminated array.
This returned an array of structs with an NULL-ed element at the end.
The drivers still do this, but the wrappers now make and free a NULL-
terminated array around it.

sr_output_options_free() now takes the pointer returned by
sr_output_options_get(), instead of the module owning it.
2014-08-15 20:23:52 +02:00
Soeren Apel db81fbb582 hameg-hmo: Make sure the enabled_channels list is empty before populating it
Previous runs of dev_acquisition_start() keep the enabled_channels list
populated if they fail. This means that once an invalid channel
configuration was detected, it will be detected again even if the channel
configuration was changed. With this change, the list will be cleared
before being populated so that any stale entries are removed.
2014-08-14 22:43:57 +02:00
Bert Vermeulen 3c1cafebb3 session: Remove irrelevant logging. 2014-08-13 14:34:55 +02:00
Bert Vermeulen 441e9eae58 output/wav: Minor code cleanup. 2014-08-13 14:34:55 +02:00
Bert Vermeulen 63f6df68c6 output: Deal properly with NULL (no) options on a new output instance. 2014-08-13 14:34:55 +02:00
Uwe Hermann 41de54ffb1 sr_session_new(): Return SR_ERR_ARG upon invalid argument.
(instead of segfaulting)
2014-08-11 13:15:43 +02:00
Uwe Hermann 508ddda2a3 session_file.c: Drop left-over extern. 2014-08-11 12:31:01 +02:00
Uwe Hermann 9fcc286604 trigger.c: Add Doxygen @file and @defgroup tags. 2014-08-10 18:59:16 +02:00
Uwe Hermann 7efe889e7a Doxygen: Add a few missing @param lines for sessions.
This fixes a bunch of Doxygen warnings.
2014-08-10 17:31:33 +02:00
Soeren Apel b4e31d2aac Fix typo in the Hameg HMO driver and add some error message for when the float comparison breaks 2014-08-08 17:12:58 +02:00
Bert Vermeulen e336c0413c output/vcd: Drop obsolete string. 2014-08-03 14:09:04 +02:00
Bert Vermeulen 226363c4e8 hameg-hmo: Implement SR_CONF_SCAN_OPTIONS. 2014-08-03 14:00:07 +02:00
Bert Vermeulen 706f482a95 output: Check options hash before destroying. 2014-08-03 01:24:30 +02:00
Bert Vermeulen dcc55fe91a output: Move option checks to the wrapper.
Output modules are now guaranteed:
  - Every option is always given, with the default value if not supplied
    by the user, and is the right GVariantType.
  - No invalid options are ever passed.
2014-08-03 01:16:03 +02:00
Bert Vermeulen 950043c30e output: Modules can keep track of option resources without wrapper help. 2014-08-02 19:20:00 +02:00
Bert Vermeulen 7ea75009d1 output/wav: Add 'scale' option.
Audio tools processing WAV failes generally need the samples to be in
the range -1 to +1. The scale option adds postprocessing to any samples
going into a WAV file, by dividing the sample values by the given factor.
2014-08-02 03:50:27 +02:00
Janne Huttunen a24c3f4a89 Implement Brymen BM25x series as a serial DMM.
The Brymen BM25x series supports the BC-20X that is an opto-isolated
serial cable. The link seems to be unidirectional i.e. when activated
the DMM periodically sends updates to the host while the host cannot
control the DMM in any way.

The protocol is documented in "6000-count-digital-multimeters-r1.pdf"
that is available from the manufacturer. Every 15 byte packet consists
of a bitmap where the bits correspond to segments or symbols on the
LCD display i.e. the DMM essentially sends the contents of its screen
to the host in every update. This driver then decodes the measured
quantity, unit and its value from the bitmap.
2014-08-01 20:31:26 +02:00
Bert Vermeulen 2f6f0e9187 input/vcd: Make less noise in format match failure. 2014-08-01 12:04:20 +02:00
Bert Vermeulen b866fc095d input/csv: Match format on .csv extension in filename. 2014-08-01 12:03:42 +02:00
Bert Vermeulen cb41a838a7 input/wav: Deal with IEEE float samples in WAV files.
This also skips chunks before the 'data' chunk in WAV files, as
this is quite common.
2014-08-01 12:02:09 +02:00
Bert Vermeulen 364859ac73 output/wav: Fix channel deinterleaving. 2014-08-01 12:00:51 +02:00
Bert Vermeulen 6e6babb9d5 output/analog: Fix channel deinterleaving. 2014-08-01 11:57:59 +02:00
Bert Vermeulen 0605f87475 output/wav: Initial module implementation. 2014-07-29 15:46:26 +02:00
Bert Vermeulen afaa75b98c output/wav: Initial module skeleton. 2014-07-29 02:47:10 +02:00
Bert Vermeulen 49224c2853 demo: Attach analog generator to channel, not channel group.
This also adds a new channel group "Analog", which has all analog
channels in it.
2014-07-29 02:00:57 +02:00
Bert Vermeulen d686c5ec46 output: Rename instance private storage pointer to priv.
This makes it consistent with other libsigrok fields used for this purpose.
2014-07-28 16:02:21 +02:00
Bert Vermeulen dddabe3705 demo: Support changing the amplitude of analog channels. 2014-07-28 15:40:26 +02:00
Bert Vermeulen cff7d8d60d Add config key for amplitude.
This is intended for setting (or getting) the amplitude of a source
which doesn't really have an MQ associated with it, such as the demo
driver's analog channels.
2014-07-28 15:40:19 +02:00
Bert Vermeulen a755b0e122 output: Finish output module API wrappers.
The sr_output and sr_output_module structs are now no longer accessible
from the client.
2014-07-26 03:57:17 +02:00
Bert Vermeulen ed0b7fed10 demo: Free analog channel groups when done with them.
This fixes a memory leak.
2014-07-24 21:01:39 +02:00
Bert Vermeulen 886413b6d2 std: Free channel groups from device instances as well. 2014-07-24 21:01:08 +02:00
Bert Vermeulen 4d7b36a0b5 fx2lafw: Check for valid samplerate before setting. 2014-07-23 12:32:35 +02:00
Bert Vermeulen b62bb97afb demo: Support continuous acquisition. 2014-07-23 04:53:25 +02:00
Bert Vermeulen 2f663c826a fx2lafw: Fix continuous mode. 2014-07-23 00:24:39 +02:00
Uwe Hermann b88c3e4923 Drop references to obsolete sigrok-commits mailing list. 2014-07-23 00:04:07 +02:00
Uwe Hermann f4d2042d3c session*.c: Remove some unneeded lines. 2014-07-22 23:25:24 +02:00
Bert Vermeulen 155b680da4 Reorganize project tree. 2014-07-22 18:19:29 +02:00