Commit Graph

5267 Commits

Author SHA1 Message Date
Gerhard Sittig 8c381a353c hameg-hmo: use common helper to setup description of an analog value
Replace an open coded sequence of assignments to an aggregate of several
related structures. Prefer the common sr_analog_init() routine instead.
2020-05-02 17:01:39 +02:00
Gerhard Sittig 00f3c94386 uni-t-ut32x: drop redundant close and free at end of scan
The UT32x driver requires a user spec for the connection. The device
cannot get identified, that's why successful open/close for the port
will suffice. Lack of an input spec as well as failure in the early
scan phase will terminate the scan routine early.

When we reach the end of the scan which creates the device instance
and registers it with the list of found devices, the port already
is closed and the list of devices will never be empty. Remove the
redundant close call and the dead branch which frees the serial port.
2020-05-02 17:01:39 +02:00
Gerhard Sittig ff5fb18526 scpi-dmm: fix glib variant ref count in SET MQ request 2020-05-02 17:01:39 +02:00
Uwe Hermann 6cfc6c5c7a Fix compiler warnings related to -Wcast-function-type.
This fixes bug #1297.
2020-05-02 17:01:39 +02:00
Uwe Hermann 4c5ac0cf5b siglent-sds: Fix various compiler warnings.
src/hardware/siglent-sds/protocol.c: In function 'siglent_sds_get_digital':
  src/hardware/siglent-sds/protocol.c:382:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          if (data_low_channels->len <= samples_index) {
                                     ^
  src/hardware/siglent-sds/protocol.c:391:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          if (data_high_channels->len <= samples_index) {
                                      ^
  src/hardware/siglent-sds/protocol.c:417:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (long index = 0; index < tmp_samplebuf->len; index++) {
                                  ^
  In file included from src/hardware/siglent-sds/protocol.c:37:0:
  src/hardware/siglent-sds/protocol.c: In function 'siglent_sds_receive':
  src/hardware/siglent-sds/protocol.h:28:20: warning: format '%li' expects argument of type 'long int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "siglent-sds"
                      ^
  ./src/libsigrok-internal.h:815:41: note: in expansion of macro 'LOG_PREFIX'
   #define sr_dbg(...) sr_log(SR_LOG_DBG,  LOG_PREFIX ": " __VA_ARGS__)
                                           ^
  src/hardware/siglent-sds/protocol.c:564:6: note: in expansion of macro 'sr_dbg'
        sr_dbg("Requesting: %li bytes.", devc->num_samples - devc->num_block_bytes);
        ^
  src/hardware/siglent-sds/protocol.c: In function 'siglent_sds_get_dev_cfg_horizontal':
  src/hardware/siglent-sds/protocol.h:28:20: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "siglent-sds"
                      ^
  ./src/libsigrok-internal.h:815:41: note: in expansion of macro 'LOG_PREFIX'
   #define sr_dbg(...) sr_log(SR_LOG_DBG,  LOG_PREFIX ": " __VA_ARGS__)
                                           ^
  src/hardware/siglent-sds/protocol.c:933:2: note: in expansion of macro 'sr_dbg'
    sr_dbg("Current memory depth: %lu.", devc->memory_depth_analog);
    ^
2020-05-02 15:48:26 +02:00
Andreas Sandberg 4704f64551 bt/bt_bluez: Implement retry if rfcomm sockets are busy
There are cases where the connect() call returns EBUSY when trying to
connect to a device. This has been observed when sampling an RDTech
UM24C. In this case, scanning the device works fine. However, when
sampling the device, Sigrok first scans the device, then closes the
connection and re-opens it to sample the device. If the close/open
calls happen in close successions, the Bluetooth stack sometimes
returns EBUSY.

Work around this issue by retrying if the connect() returns EBUSY.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-04-11 16:00:52 +02:00
v1ne 1d657f47be modbus: Close device after scan
Since the device should be closed after the scan, close it in sr_modbus_scan.
Alternatively, every single driver could close the device after calling
sr_modbus_scan. This causes duplicated code, is prone to forgetting it and it
wasn't the calling driver who opened the device in the first place.

This change unbreaks maynuo-m97 and rdtech-dps.
2020-04-11 15:55:35 +02:00
Florian Schmidt 8f3c77db26 scpi-pps: fixed out-of-bounds array access...
when accessing devc->device->channels in config_list().
this array has to be accessed via the "hw_output_idx"

This fixes bug #1533.
2020-04-11 15:52:13 +02:00
Uwe Hermann f0aec55605 center-3xx: Fix incorrect values due to endianness issue.
Replace RL16S with RB16S, the values are big-endian.

This is related to the recently-fixed bug #1463.
2020-04-09 23:51:16 +02:00
Uwe Hermann 4c5f70063a Use std_session_send_df_frame_begin()/_end() where possible. 2020-04-08 23:54:25 +02:00
Uwe Hermann 7f7702b81b std: Rename std_session_send_frame_begin/_end(). 2020-04-08 23:35:44 +02:00
Uwe Hermann 0fa71943e3 Use std_session_send_df_trigger() where possible. 2020-04-08 23:21:39 +02:00
Uwe Hermann 447c4216fc std: Factor out send_df_without_payload() helper. 2020-04-08 23:11:15 +02:00
Uwe Hermann 10cf811385 std: Add std_session_send_df_trigger(). 2020-04-08 23:02:04 +02:00
Uwe Hermann 148cf8bea1 zeroplus-logic-cube: Fix an issue when changing triggers.
Changing triggers (e.g. from low to high) would sometimes cause the
acquisition to seemingly "hang" due to missing variable initializations
(in reality the device would wait for incorrect triggers and/or on
incorrect channels).

This fixes bug #1535.
2020-04-08 22:58:02 +02:00
Jan Metzger 88daa0536c zeroplus-logic-cube: Enable edge-triggering capabilities.
This fixes bug #1334.
2020-04-08 22:57:02 +02:00
Christian Fruth c8dcd3ab72 korad-kaxxxxp: Add support for RND KA3005P V5.5 power supply 2020-04-07 00:54:18 +02:00
Peter van der Perk 082ca8d8bc korad-kaxxxxp: Add support for TENMA 72-2540 V5.2 power supply 2020-04-07 00:54:18 +02:00
Uwe Hermann 78d78afb57 udev: Add TIAO USB Multi Protocol Adapter (TUMPA) VID/PID. 2020-04-07 00:54:18 +02:00
Tom Matthews 3ff6cfeebe ftdi-la: add TUMPA VID:PID and JTAG pin names 2020-04-07 00:54:18 +02:00
v1ne 69c5d959e7 rdtech-dps: Make it work in SmuView
Without the mutex, concurrent reception from the ModBus port leads to CRC
errors.
2020-04-04 23:25:25 +02:00
Gerhard Sittig 56a1bf7b4b center-3xx: use common signed LE16 conversion for temperature value
Prefer the common conversion helper for little endian 16bit signed data.
The previous local implementation only worked for positive values, and
yielded incorrect results for negative temperatures.

This fixes bug #1463.
2020-04-04 23:25:25 +02:00
Elen Eisendle ca7d442692 serial-dmm/uni-t-dmm: Add UNI-T UT804 DMM definitions 2020-04-04 23:25:09 +02:00
Andreas Sandberg 35037b1d8b input/trace32_ad: Fix pod_data uninitialised warning
Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-04-04 22:25:03 +02:00
Andreas Sandberg 5ff772410b gwinstek-gpd: Fix use of uninitialized variable
Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-04-04 22:24:26 +02:00
Juan M. Bello-Rivas 5652085a4e bindings/cxx: Include missing header file
Including the `functional` header is necessary in order to use `std::function` in the definition of `LogCallbackFunction` when compiling with gcc 7.3.0.
2020-04-04 22:24:21 +02:00
Uwe Hermann 49d130200d bindings/ruby: Disable Ruby bindings until we have a fix for #1526.
The Ruby bindings currently don't build (at least with Ruby 2.7
and/or SWIG 4.x). Disable them as a temporary workaround until we
have a more permanent fix.
2020-04-04 22:24:05 +02:00
Uwe Hermann c9901879f6 configure.ac: Also check for "swig4.0". 2020-04-04 22:24:05 +02:00
Uwe Hermann e803574173 bindings/java: Fix build issue with SWIG 4.x.
Tested with SWIG 3.x and SWIG 4.x.

This fixes bug #1527.
2020-04-04 22:24:05 +02:00
Uwe Hermann 6762401d2b Doxygen: Fix various warnings.
src/resource.c:414: warning: unbalanced grouping commands

  conversion.c:81: warning: argument 'lo_thr' from the argument list of sr_a2l_schmitt_trigger has multiple @param documentation sections

  src/analog.c:611: warning: return value 'SR_ERR_ARG' of sr_rational_div has multiple documentation sections

  src/device.c:205: warning: explicit link request to 'TRUE' could not be resolved
  src/device.c:205: warning: explicit link request to 'FALSE' could not be resolved
  src/device.c:231: warning: explicit link request to 'TRUE' could not be resolved
  src/device.c:231: warning: explicit link request to 'FALSE' could not be resolved

  src/serial.c:246: warning: explicit link request to 'NULL' could not be resolved

  src/strutil.c:602: warning: explicit link request to 'NULL' could not be resolved

  src/device.c:94: warning: unable to resolve reference to 'sr_channel_free()' for \ref command

  src/strutil.c:597: warning: unable to resolve reference to 'sr_hexdump_free()' for \ref command
  src/strutil.c:622: warning: unable to resolve reference to 'sr_hexdump_new()' for \ref command

  src/device.c:430: warning: The following parameters of sr_dev_inst_channel_add(struct sr_dev_inst *sdi, int index, int type, const char *name) are not documented: parameter 'sdi'

  src/session.c:163: warning: The following parameters of fd_source_new(struct sr_session *session, void *key, gintptr fd, int events, int timeout_ms) are not documented: parameter 'events'
2020-03-25 20:27:57 +01:00
Uwe Hermann 82b9f3d116 Doxygen: Properly mark a few symbols as private.
(otherwise these end up in the API docs)

Remove all @internal markings, only use @private where needed.
2020-03-25 20:10:24 +01:00
Uwe Hermann deaaebb28d bindings/python/Doxyfile: Set OPTIMIZE_OUTPUT_JAVA to NO. 2020-03-25 19:38:48 +01:00
Uwe Hermann b4066aa80e Doxyfile_internal: Fix various settings and paths. 2020-03-25 19:38:48 +01:00
Uwe Hermann 4e9e767be0 Doxyfile: Predefine HAVE_SERIAL_COMM for serial docs.
Without this, src/serial.c API docs won't be generated.
2020-03-25 19:38:19 +01:00
Uwe Hermann b07a07fec2 Doxyfile: Fix/update path and file references. 2020-03-25 19:35:20 +01:00
Uwe Hermann 2faa1db033 Doxyfile: Bring back the workaround for bug #1422. 2020-03-24 21:15:15 +01:00
Uwe Hermann e2bd01f4a7 All Doxyfile files: Update file template to doxygen 1.8.16.
This is done semi-automatically by running "doxygen -u Doxyfile".
2020-03-24 21:15:15 +01:00
Uwe Hermann d7357ebbb6 All Doxyfile files: Set CREATE_SUBDIRS to NO. 2020-03-24 21:15:15 +01:00
Uwe Hermann 20680f58ff manson-hcs-3xxx: Support device IDs with and without "HCS-" prefix.
Since we've now seen lots of devices in the wild that come with the
"HCS-" prefix in the ID, it's probably safe to assume all of them
could have it.

This fixes bug #1530.
2020-03-24 21:10:27 +01:00
Uwe Hermann bfa79fbdb6 asix-sigma: Drop duplicate error message prefixes.
The sr_err() call automatically adds a prefix to all messages, in
this specific case "asix-sigma: " will be added.
2020-03-24 19:22:11 +01:00
Daniel Trnka 440810958c asix-sigma: move DRAM line buffer allocation closer to its use
Move the allocation of the DRAM line buffer in the sample download code
path closer to the location where that buffer is used and gets released.
2020-03-24 19:20:40 +01:00
Daniel Trnka f73b00b647 asix-sigma: check for successful register access in sample download
The previous implementation got stuck in an infinite loop when data
acquisition started, but the device got disconnected before the data
acquisition terminates. An implementation detail ignored communication
errors, and never saw the expected condition that was required to
continue in the sample download sequence. Unbreak that code path.
2020-03-24 19:20:40 +01:00
Uwe Hermann f5c863e572 korad-kaxxxxp: Fix max. possible current for all devices.
Even though the devices/websites/manuals usually say 0..30V, the
hardware actually accepts up to 31V, both via serial as well as by
simply rotating the knob on the device (and our driver already
reflects that).

The same is true for current, it's usually 0..5A as per docs, but many
(probably all) devices accept 5.1A via serial and knob.

Thus, set the max current of all devices to 5.1A (or 3.1A for 3A
devices). We're assuming they all have this property, and we've seen
this in practice on at least three different versions of the device.
2020-03-22 16:58:54 +01:00
David Sastre Medina 7415217ede korad-kaxxxxp: Add a new ID for KORAD KA3005P V4.2 power supply
On a recently acquired Korad KA3005P power supply, the ID supplied by the
device is not known by libsigrok.

$ sigrok-cli --driver=korad-kaxxxxp:conn=/dev/ttyACM0 --scan
sr: korad-kaxxxxp: Unknown model ID 'KORAD KA3005P V4.2' detected, aborting.

This fixes bug #1522.

Thanks to bitaround@gmail.com for the amperage fix.
2020-03-22 15:52:16 +01:00
jirjirjir c4a46475a6 rigol-ds: Rigol DS1152E-EDU support fix 2020-03-16 23:44:25 +01:00
Soeren Apel 781ae4484d Fix #1509 by providing alternate sample format scales 2020-02-28 23:26:20 +01:00
Martin Ling 8491cf7cad python: Apply typemap for VariantBase to VariantContainerBase.
Fixes #1480.
2020-01-05 18:25:13 +00:00
Uwe Hermann f0362f595a agilent-dmm: Add Agilent U1237AX (completely untested). 2019-12-27 22:08:41 +01:00
Uwe Hermann e47e23355f agilent-dmm: U127x: Fix mode switch event handling.
The DMMs report as an event to which mode the user switched (by turning the
rotary switch): "*0", "*1", etc.

Most other DMMs have few modes, but the U127x DMMs have up to 11 different
modes (i.e., "*10" is a valid event).
2019-12-27 20:59:04 +01:00
Uwe Hermann 4c660b46c1 Makefile.am: Add missing src/serial_hid.h. 2019-12-24 16:39:01 +01:00