]> sigrok.org Git - libsigrok.git/log
libsigrok.git
2 months agobindings/python: Add __repr__() to 'Channel' class
Marc Schink [Fri, 29 Mar 2024 12:41:40 +0000 (13:41 +0100)]
bindings/python: Add __repr__() to 'Channel' class

The following lines show the class string representation before and
after this patch:

<sigrok.core.classes.Channel; proxy of <Swig Object of type 'std::shared_ptr< sigrok::Channel > *' at 0x7fdf4b29ff00> >
Channel (type=ChannelType.LOGIC, name='D0', index=0, enabled=True)

Signed-off-by: Marc Schink <redacted>
2 months agobindings/python: Add __repr__() to 'Driver' class
Marc Schink [Fri, 29 Mar 2024 12:41:19 +0000 (13:41 +0100)]
bindings/python: Add __repr__() to 'Driver' class

The following lines show the class string representation before and
after this patch:

<sigrok.core.classes.Driver; proxy of <Swig Object of type 'std::shared_ptr< sigrok::Driver > *' at 0x7fdf4b29cff0> >
Driver (name='demo', long_name='Demo driver and pattern generator')

Signed-off-by: Marc Schink <redacted>
2 months agobindings/python: More user-friendly class string representation
Marc Schink [Fri, 29 Mar 2024 12:38:23 +0000 (13:38 +0100)]
bindings/python: More user-friendly class string representation

Add a function to generate a more descriptive and user-friendly class
string representation using class attributes.

Signed-off-by: Marc Schink <redacted>
2 months agoDrop Python 2 support
Marc Schink [Wed, 21 Aug 2024 07:42:52 +0000 (09:42 +0200)]
Drop Python 2 support

Python 2 reached its official end-of-life in 2020 and is no longer
supported. Use the oldest but still maintained Python 3 version as
minimum requirement.

Signed-off-by: Marc Schink <redacted>
2 months agoBump minimum libzip requirement to 0.11
Marc Schink [Tue, 18 Nov 2025 16:14:44 +0000 (17:14 +0100)]
Bump minimum libzip requirement to 0.11

The commit 3406d671 ("output/srzip: Replace deprecated libzip calls")
makes use of new libzip API calls but does not bump the libzip version
requirements, fix this.

According to [1], the minimum required libzip version is now 0.11.

[1] https://github.com/nih-at/libzip/blob/main/API-CHANGES.md

Signed-off-by: Marc Schink <redacted>
2 months agomaynuo-m97: Synchronize read and write operations
François Revol [Mon, 25 Aug 2025 15:12:01 +0000 (17:12 +0200)]
maynuo-m97: Synchronize read and write operations

This patch is for thread safety when the library is used by SmuView
and should fix https://github.com/knarfS/smuview/issues/27

2 months agofluke-dmm: Set the SR_MQFLAG_(AC|DC) flags for sums
Andreas Sandberg [Sun, 13 Oct 2024 16:08:20 +0000 (17:08 +0100)]
fluke-dmm: Set the SR_MQFLAG_(AC|DC) flags for sums

The VAC_PLUS_DC and AAC_PLUS_DC units measure the sum of the AC and DC
components. Set both the SR_MQFLAG_AC and SR_MQFLAG_DC flags in these
cases.

Signed-off-by: Andreas Sandberg <redacted>
2 months agofluke-dmm: Fix Fluke 28x unit mappings
Andreas Sandberg [Sun, 13 Oct 2024 16:03:20 +0000 (17:03 +0100)]
fluke-dmm: Fix Fluke 28x unit mappings

The Fluke 28x unit mapping has a couple of bugs: 'dBm' incorrectly
maps to SQ_MQ_VOLTAGE and 'AAC_PLUS_DC' incorrectly maps to
SR_MQ_VOLTAGE. Fix these issues.

Signed-off-by: Andreas Sandberg <redacted>
2 months agofluke-dmm: Declare tables as constants
Andreas Sandberg [Sun, 13 Oct 2024 15:52:04 +0000 (16:52 +0100)]
fluke-dmm: Declare tables as constants

There is no need to modify the various lookup tables at
runtime. Declare these as const to avoid surprises.

Signed-off-by: Andreas Sandberg <redacted>
2 months agoscpi-pps: Add support for Elektro-Automatik PS 20xx
Nicolas Labriet [Fri, 8 Nov 2024 15:35:20 +0000 (16:35 +0100)]
scpi-pps: Add support for Elektro-Automatik PS 20xx

Signed-off-by: Nicolas Labriet <redacted>
2 months agogwinstek-psp: Only build if serial_comm is enabled
Daniel Trnka [Sun, 24 Nov 2024 13:11:46 +0000 (14:11 +0100)]
gwinstek-psp: Only build if serial_comm is enabled

2 months agoraspberrypi-pico: Don't derive channel type from name
Shawn Walker [Mon, 2 Dec 2024 06:00:04 +0000 (23:00 -0700)]
raspberrypi-pico: Don't derive channel type from name

2 months agotcp: Avoid blocking in sr_fd_is_readable if using poll
Charlie Birks [Sat, 7 Dec 2024 18:11:08 +0000 (18:11 +0000)]
tcp: Avoid blocking in sr_fd_is_readable if using poll

This is consistent with the select path and the function description.

2 months agoinput/protocoldata: Check if lookup_protocol_name is valid
Yann Sionneau [Sun, 16 Mar 2025 14:11:42 +0000 (15:11 +0100)]
input/protocoldata: Check if lookup_protocol_name is valid

As of today, the code does not crash because all protocols have names.
But the name of the first element is not checked to be non-NULL
before calling strcmp(). This can result in a future crash if the
code logic changes.

This is mostly a change to robustify the lookup_protocol_name() function.

Also, this commit simplifies the indexing logic of the protocols array.

2 months agomaynuo-m97: Enable support for the M9710
François Revol [Tue, 26 Aug 2025 22:08:19 +0000 (00:08 +0200)]
maynuo-m97: Enable support for the M9710

The reported model number is 28 on this one.

2 months agobindings/python: Add support for SR_T_MQ in Python bindings
vzuevskiy [Mon, 8 Sep 2025 07:10:14 +0000 (10:10 +0300)]
bindings/python: Add support for SR_T_MQ in Python bindings

2 months agotests: Replace remaining deprecated check calls
J. Neuschäfer [Tue, 13 May 2025 20:54:54 +0000 (22:54 +0200)]
tests: Replace remaining deprecated check calls

These were not caught by coccinelle.

2 months agotests: Replace deprecated fail(_unless) calls
J. Neuschäfer [Tue, 13 May 2025 20:30:49 +0000 (22:30 +0200)]
tests: Replace deprecated fail(_unless) calls

A new API (ck_assert) to replace fail_* was introduced in check
0.9.6 (released in 2008), and fail_* has been deprecated since at least
0.9.10 (released in 2013).

This patch was automated with coccinelle:

  spatch --sp-file patch.coc --in-place tests/*.c

@@
expression msg;
@@
 <...
- fail(msg);
+ ck_abort_msg(msg);
  ...>

@@
expression msg, arg1;
@@
 <...
- fail(msg, arg1);
+ ck_abort_msg(msg, arg1);
  ...>

@@
expression msg, arg1, arg2;
@@
 <...
- fail(msg, arg1, arg2);
+ ck_abort_msg(msg, arg1, arg2);
  ...>

@@
expression expr;
@@

  <...
- fail_unless(expr);
+ ck_assert(expr);
  ...>

@@
expression expr, msg;
@@

  <...
- fail_unless(expr, msg);
+ ck_assert_msg(expr, msg);
  ...>

@@
expression expr, msg, arg1;
@@

  <...
- fail_unless(expr, msg, arg1);
+ ck_assert_msg(expr, msg, arg1);
  ...>

@@
expression expr, msg, arg1, arg2;
@@

  <...
- fail_unless(expr, msg, arg1, arg2);
+ ck_assert_msg(expr, msg, arg1, arg2);
  ...>

@@
expression expr, msg, arg1, arg2, arg3;
@@

  <...
- fail_unless(expr, msg, arg1, arg2, arg3);
+ ck_assert_msg(expr, msg, arg1, arg2, arg3);
  ...>

@@
expression expr, msg, arg1, arg2, arg3, arg4;
@@

  <...
- fail_unless(expr, msg, arg1, arg2, arg3, arg4);
+ ck_assert_msg(expr, msg, arg1, arg2, arg3, arg4);
  ...>

@@
expression expr, msg, arg1, arg2, arg3, arg4, arg5;
@@

  <...
- fail_unless(expr, msg, arg1, arg2, arg3, arg4, arg5);
+ ck_assert_msg(expr, msg, arg1, arg2, arg3, arg4, arg5);
  ...>

2 months agooutput/srzip: Replace deprecated libzip calls
J. Neuschäfer [Tue, 13 May 2025 20:08:05 +0000 (22:08 +0200)]
output/srzip: Replace deprecated libzip calls

zip_add/replace/rename all gained an additional `flags` argument, which
can be set to zero to get the old behavior.

2 months agobindings/cxx: support SWIG 4.2 and later
Klaus Kämpf [Sun, 3 Nov 2024 16:07:29 +0000 (17:07 +0100)]
bindings/cxx: support SWIG 4.2 and later

otherwise building sigrok fails with
bindings/swig/enums.i:1: Error: Unknown directive '%attribute'.

Also indicate that bindings/swig/enums.i is a generated file.

Signed-off-by: Klaus Kämpf <redacted>
2 months agoREADME.devices: Mention raspberrypi-pico firmware requirement
J. Neuschäfer [Sat, 25 Oct 2025 08:53:45 +0000 (10:53 +0200)]
README.devices: Mention raspberrypi-pico firmware requirement

2 months agoraspberrypi-pico: Add link to firmware repo
J. Neuschäfer [Wed, 14 May 2025 13:27:07 +0000 (15:27 +0200)]
raspberrypi-pico: Add link to firmware repo

Since the Raspberry Pi Pico is a programmable device with a myriad of
use-cases, it needs specific firmware to implement the same protocol as
the driver in src/hardware/raspberrypi-pico.

Add a link to make it easier to find the right firmware.

2 months agohardware/beaglelogic: Don't include incorrect header <sys/errno.h>
J. Neuschäfer [Wed, 14 May 2025 12:27:47 +0000 (12:27 +0000)]
hardware/beaglelogic: Don't include incorrect header <sys/errno.h>

The libc's errno API[1] comes from <errno.h>, not <sys/errno.h>.
On musl-libc, a warning is produced when the latter is used:

In file included from src/hardware/beaglelogic/beaglelogic.h:26,
                 from src/hardware/beaglelogic/protocol.c:33:
/usr/include/sys/errno.h:1:2: warning: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Wcpp]
    1 | #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
      |  ^~~~~~~

Is it not necessary to change <sys/errno.h> to <errno.h>, because
individual C files in the beaglelogic driver already include <errno.h>.

[1]: https://en.cppreference.com/w/c/error/errno

2 months agoREADME.devices: Fix typo
J. Neuschäfer [Tue, 13 May 2025 19:25:59 +0000 (21:25 +0200)]
README.devices: Fix typo

2 months agoconfigure: Fix bashism in _SR_DRIVER
Chris Mayo [Tue, 13 May 2025 18:27:55 +0000 (19:27 +0100)]
configure: Fix bashism in _SR_DRIVER

2 months agodmm/vc96: Style fixes
Soeren Apel [Sat, 8 Nov 2025 22:10:45 +0000 (23:10 +0100)]
dmm/vc96: Style fixes

2 months agodmm/vc96: Fixed wrong detection and calculation.
schuma-gta02 [Fri, 24 Nov 2023 15:56:25 +0000 (16:56 +0100)]
dmm/vc96: Fixed wrong detection and calculation.

- check against "  " (two spaces) for info->is_unitless (line 137)
- introduced the handling of the returncode of sr_atof_ascii (line 73)
- explanation for ignoring case in line 132 added

3 months agoinput/trace32_ad: Minor header documentation addition
Soeren Apel [Mon, 3 Nov 2025 22:35:26 +0000 (23:35 +0100)]
input/trace32_ad: Minor header documentation addition

15 months agoconfigure: Also test for new "check" option
Soeren Apel [Sun, 20 Oct 2024 20:10:56 +0000 (22:10 +0200)]
configure: Also test for new "check" option

When configure was called without any --enable-... parameters, the HAVE_DRIVERS
define would be undefined, leading to the driver list being empty:

https://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=configure.ac;h=f846fcdc12171bb487596bf92e398d197a6b74dc;hb=HEAD#l304

https://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=src/drivers.c;h=6dc2c55cbd18785813186a5e814d0a7d020d1583;hb=HEAD#l50

This was masked when configure is called with --enable-all-drivers as this
parameter is counted as an enabled driver (even though it technically isn't).

15 months agoconfigure: Make dependency error message more explicit
Soeren Apel [Sat, 19 Oct 2024 11:00:31 +0000 (13:00 +0200)]
configure: Make dependency error message more explicit

15 months agoconfigure: differ between check and yes/no
Erik Schilling [Fri, 12 Jan 2024 13:38:31 +0000 (14:38 +0100)]
configure: differ between check and yes/no

So far one could only specify yes/no (optionally for all drivers through
--enable-all-drivers={yes,no}). However, even when stating a =yes, the
dependency check would override it to a =no if the dependencies are
missing.

This is a bit annoying for scripts since a script may specify
--enable-foo-driver=yes but in fact the build may not contain
`foo-driver` due to missing build dependencies. This is especially
problematic for distro's which look like they currently do not build a
defined driver set - which results in random drivers missing [1].

This fixes that by following the autoconf examples [2] that allow a third
state `check`. With that `no` means no, `yes` means yes (raise an error
if deps are unavailable) and `check` gracefully disables drivers with
unavailable dependencies.

With that --enable-all-drivers can be used to ensure that all drivers are
built in. Certain drivers can still be explicitly disabled by overriding
the individual driver setting.

This way distros can specify --enable-all-drivers and new drivers with
unmet dependencies will cause an error rather than silently getting
dropped of the build.

[1] https://sigrok.org/bugzilla/show_bug.cgi?id=1699
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/External-Software.html#External-Software

To: sigrok-devel@lists.sourceforge.net
Cc: Daniel Thompson <redacted>
15 months agoinput/vcd: Add parsing support for SV 'logic' type
7FM [Thu, 13 Jan 2022 21:33:51 +0000 (22:33 +0100)]
input/vcd: Add parsing support for SV 'logic' type

logic is a SystemVerilog data type which is an extension of Verilog.
The relevant specification is contained in IEEE 1800-2017.

15 months agoinput/vcd: Add option to manually specify & enforce a samplerate
7FM [Thu, 13 Jan 2022 22:53:06 +0000 (23:53 +0100)]
input/vcd: Add option to manually specify & enforce a samplerate

15 months agobkprecision-1856d: Add implementation
Daniel Anselmi [Sun, 29 Aug 2021 18:54:41 +0000 (20:54 +0200)]
bkprecision-1856d: Add implementation

15 months agobkprecision-1856d: Initial driver skeleton
Daniel Anselmi [Sun, 29 Aug 2021 18:54:41 +0000 (20:54 +0200)]
bkprecision-1856d: Initial driver skeleton

15 months agolibsigrok.h: Add config keys SR_CONF_GATE_TIME and SR_CONF_FREQUENCY_COUNTER
Daniel Anselmi [Sat, 12 Oct 2024 21:20:27 +0000 (23:20 +0200)]
libsigrok.h: Add config keys SR_CONF_GATE_TIME and SR_CONF_FREQUENCY_COUNTER

15 months agolink-mso19: Refactor to remove TRIG_UPDATE_* macros
Paul Kasemir [Tue, 13 Dec 2022 00:25:15 +0000 (17:25 -0700)]
link-mso19: Refactor to remove TRIG_UPDATE_* macros

We now calculate the trigger register on the fly like threshold value.

15 months agolink-mso19: Make mso_calc_trigger_threshold() static
Paul Kasemir [Mon, 12 Dec 2022 23:57:28 +0000 (16:57 -0700)]
link-mso19: Make mso_calc_trigger_threshold() static

It's only used in protocol.c so there's no need to export it.

15 months agolink-mso19: Refactor mso_limit_trigger_level to mso_set_trigger_level
Paul Kasemir [Mon, 12 Dec 2022 18:54:25 +0000 (11:54 -0700)]
link-mso19: Refactor mso_limit_trigger_level to mso_set_trigger_level

Function acts as a setter now, instead of updating devc based on
existing settings.

Min and max limits are now easier to understand.

15 months agolink-mso19: Change update functions to setter functions
Paul Kasemir [Mon, 12 Dec 2022 22:14:43 +0000 (15:14 -0700)]
link-mso19: Change update functions to setter functions

mso_update_trigger_pos(devc) -> mso_set_trigger_pos(devc, pos)
mso_update_offset_value(devc) -> mso_set_offset_value(devc, offset)

15 months agolink-mso19: Add comments and macros for magic numbers
Paul Kasemir [Mon, 12 Dec 2022 21:19:28 +0000 (14:19 -0700)]
link-mso19: Add comments and macros for magic numbers

Also make the code mso_calc_trigger_threshold easier to understand.

15 months agolink-mso19: Style changes to keep lines less than 80 chars
Paul Kasemir [Mon, 12 Dec 2022 21:11:59 +0000 (14:11 -0700)]
link-mso19: Style changes to keep lines less than 80 chars

15 months agolink-mso19: Refactor code style to declare variables first
Paul Kasemir [Mon, 12 Dec 2022 19:04:12 +0000 (12:04 -0700)]
link-mso19: Refactor code style to declare variables first

Variables are now declared without any value, and then set later in
the code.

15 months agolink-mso19: Rename variables to be more descriptive
Paul Kasemir [Mon, 12 Dec 2022 19:00:18 +0000 (12:00 -0700)]
link-mso19: Rename variables to be more descriptive

15 months agolink-mso19: Remove update function mso_update_logic_threshold_value
Paul Kasemir [Mon, 12 Dec 2022 18:54:25 +0000 (11:54 -0700)]
link-mso19: Remove update function mso_update_logic_threshold_value

15 months agolink-mso19: Use upper case CG_IS_DIGITAL/CG_IS_ANALOG macro names
Paul Kasemir [Mon, 12 Dec 2022 18:49:36 +0000 (11:49 -0700)]
link-mso19: Use upper case CG_IS_DIGITAL/CG_IS_ANALOG macro names

15 months agolink-mso19: Use correct value for 5MHz sample rate
Paul Kasemir [Wed, 9 Jun 2021 03:14:02 +0000 (21:14 -0600)]
link-mso19: Use correct value for 5MHz sample rate

15 months agolink-mso19: Add offset config option
Paul Kasemir [Sun, 27 Dec 2020 04:28:10 +0000 (21:28 -0700)]
link-mso19: Add offset config option

15 months agolink-mso19: Add logic_threshold config option
Paul Kasemir [Sat, 26 Dec 2020 04:18:05 +0000 (21:18 -0700)]
link-mso19: Add logic_threshold config option

15 months agolink-mso19: Fixup horiz_triggerpos and add trigger location
Paul Kasemir [Fri, 18 Dec 2020 07:42:07 +0000 (00:42 -0700)]
link-mso19: Fixup horiz_triggerpos and add trigger location

15 months agolink-mso19: Add trigger_level config option
Paul Kasemir [Wed, 16 Dec 2020 09:59:34 +0000 (02:59 -0700)]
link-mso19: Add trigger_level config option

15 months agolink-mso19: Add probe_factor config option
Paul Kasemir [Mon, 14 Dec 2020 04:32:57 +0000 (21:32 -0700)]
link-mso19: Add probe_factor config option

15 months agolink-mso19: Setup triggers to basic working state
Paul Kasemir [Wed, 9 Dec 2020 08:05:47 +0000 (01:05 -0700)]
link-mso19: Setup triggers to basic working state

15 months agolink-mso19: Add coupling config option
Paul Kasemir [Sat, 5 Dec 2020 07:18:18 +0000 (00:18 -0700)]
link-mso19: Add coupling config option

15 months agolink-mso19: Rework avoid unnecessary endian conversion
Paul Kasemir [Sat, 5 Dec 2020 06:06:58 +0000 (23:06 -0700)]
link-mso19: Rework avoid unnecessary endian conversion

Utilizing compile time endian correction instead of using
runtime macros.

15 months agolink-mso19: Fixup code to get basic analog and digital data working
Paul Kasemir [Fri, 4 Dec 2020 04:45:37 +0000 (21:45 -0700)]
link-mso19: Fixup code to get basic analog and digital data working

15 months agolink-mso19: Remove unused (and invalid) LED function
Paul Kasemir [Fri, 4 Dec 2020 04:49:35 +0000 (21:49 -0700)]
link-mso19: Remove unused (and invalid) LED function

15 months agolink-mso19: Fixup the scan function to work properly
Paul Kasemir [Mon, 16 Nov 2020 08:58:40 +0000 (01:58 -0700)]
link-mso19: Fixup the scan function to work properly

This device depends on libserialport to collect the usb serial number
which contains device specific parameters.

15 months agolink-mso19: Re-enable building this hardware
Paul Kasemir [Sat, 14 Nov 2020 06:18:27 +0000 (23:18 -0700)]
link-mso19: Re-enable building this hardware

15 months agolink-mso19: Remove stale code to get driver to compile
Paul Kasemir [Sat, 14 Nov 2020 08:18:54 +0000 (01:18 -0700)]
link-mso19: Remove stale code to get driver to compile

serial_write() doesn't exist anymore, for example.

15 months agolink-mso19: Update files to match new driver templates better
Paul Kasemir [Sat, 14 Nov 2020 06:23:13 +0000 (23:23 -0700)]
link-mso19: Update files to match new driver templates better

15 months agogwinstek-psp: Initial implementation
ettom [Tue, 24 Oct 2023 19:43:06 +0000 (22:43 +0300)]
gwinstek-psp: Initial implementation

15 months agogwinstek-psp: Initial driver skeleton
ettom [Mon, 30 Oct 2023 20:00:58 +0000 (22:00 +0200)]
gwinstek-psp: Initial driver skeleton

15 months agosiglent-sdl10x0: Fix compile warning
Bert Vermeulen [Thu, 10 Oct 2024 20:35:04 +0000 (22:35 +0200)]
siglent-sdl10x0: Fix compile warning

16 months agolecroy-xstream: Fix memory leak
Bert Vermeulen [Fri, 4 Oct 2024 08:12:16 +0000 (10:12 +0200)]
lecroy-xstream: Fix memory leak

Inspired by https://github.com/sigrokproject/libsigrok/pull/162
Thanks Lucien Murray-Pitts.

16 months agosiglent-sdl10x0: Implement Siglent SDL10x0 electronic load driver
Timo Boettcher [Fri, 27 Sep 2024 22:20:32 +0000 (00:20 +0200)]
siglent-sdl10x0: Implement Siglent SDL10x0 electronic load driver

16 months agosiglent-sdl10x0: Initial driver skeleton
Timo Boettcher [Thu, 19 Sep 2024 20:37:53 +0000 (22:37 +0200)]
siglent-sdl10x0: Initial driver skeleton

16 months agolibsigrok.h: Add SR_CONF_OVER_POWER_PROTECTION_* and SR_CONF_RESISTANCE
Timo Boettcher [Fri, 27 Sep 2024 22:19:33 +0000 (00:19 +0200)]
libsigrok.h: Add SR_CONF_OVER_POWER_PROTECTION_* and SR_CONF_RESISTANCE

These are used for electronic loads like the Siglent SDL10x0.

16 months agofluke-dmm: Move device-specific DM handling
Andreas Sandberg [Thu, 3 Oct 2024 22:51:58 +0000 (23:51 +0100)]
fluke-dmm: Move device-specific DM handling

With the exception of the Fluke 28x series, device-specific DM
handling is currently handled in protocol.c. Move this to separate
files for clarity.

Signed-off-by: Andreas Sandberg <redacted>
16 months agofluke-dmm: Remove device-specific float precision helper
Andreas Sandberg [Thu, 3 Oct 2024 16:40:12 +0000 (17:40 +0100)]
fluke-dmm: Remove device-specific float precision helper

The Fluke DMM driver has a helper function that determines the
precision of a float. This functionality is now provided by strutil.

Signed-off-by: Andreas Sandberg <redacted>
16 months agofluke-dmm: Cleanup Fluke 28x QM handling
Andreas Sandberg [Sun, 29 Sep 2019 21:48:52 +0000 (22:48 +0100)]
fluke-dmm: Cleanup Fluke 28x QM handling

The code that parses QM responses from Fluke 28x DMMs uses a long
series of if-else statements to determine the type of measurement
reported by the device. Rewrite this to use a conversion table that
contains a mapping between DMM units and Sigrok's internal units.

Signed-off-by: Andreas Sandberg <redacted>
16 months agostrutil: Add a atof variant that determines precision
Andreas Sandberg [Thu, 3 Oct 2024 16:35:53 +0000 (17:35 +0100)]
strutil: Add a atof variant that determines precision

There is already a helper to convert a string to a double and
determine its precision. Add a helper that does this for floats as
well.

Signed-off-by: Andreas Sandberg <redacted>
16 months agostrutil: Add a helper to get the precision of a float
Andreas Sandberg [Thu, 3 Oct 2024 16:34:43 +0000 (17:34 +0100)]
strutil: Add a helper to get the precision of a float

There are a few different instruments where the precision of a
measurement can be determined from the number of decimals in the
reported floats. Add a helper to determine this.

The implemented version of sr_count_digits performs more stringent
error checking than the original version in
sr_atod_ascii_digits. There are two reasons for this: First, we can no
longer rely on atod failing if the provided value is invalid. Second,
there are exotic float formats accepted by atod that we don't support
and we don't want to be in a situation where atod accepts a value and
count digits returns an incorrect value.

Signed-off-by: Andreas Sandberg <redacted>
16 months agobindings/python: Use implicit namespaces
Marc Schink [Thu, 12 Sep 2024 12:18:20 +0000 (14:18 +0200)]
bindings/python: Use implicit namespaces

The use of 'namespace_packages' is deprecated [1] and for Python >= 3.3,
implicit/native namespaces should be used. There are no incompatibilities
as we require Python >= 3.8. More details can be found in [2] and [3].

[1] https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
[2] https://packaging.python.org/en/latest/guides/packaging-namespace-packages/
[3] https://peps.python.org/pep-0420/

16 months agoscpi-pps: Minor style fix
Soeren Apel [Sat, 28 Sep 2024 23:23:34 +0000 (01:23 +0200)]
scpi-pps: Minor style fix

16 months agoscpi-pps: Add Keysight E36300A
Kota Ando [Tue, 5 Jul 2022 12:10:33 +0000 (21:10 +0900)]
scpi-pps: Add Keysight E36300A

- Add E36311AE36312A, and E36313A
- Tested using E36312A via LAN and smuview

16 months agorigol-dg: Announce counter channels for dg1000z only
Ralf [Fri, 23 Oct 2020 18:15:12 +0000 (20:15 +0200)]
rigol-dg: Announce counter channels for dg1000z only

16 months agorigol-dg: Read back parameters for MSO5000
Ralf [Fri, 23 Oct 2020 17:49:29 +0000 (19:49 +0200)]
rigol-dg: Read back parameters for MSO5000

16 months agorigol-dg: Reduce unnecessary conversions between waveform and string repr
Ralf [Fri, 23 Oct 2020 14:57:31 +0000 (16:57 +0200)]
rigol-dg: Reduce unnecessary conversions between waveform and string repr

16 months agorigol-dg: Use user name in waveform spec for rigol_dg_waveform_to_string
Ralf [Fri, 23 Oct 2020 10:00:02 +0000 (12:00 +0200)]
rigol-dg: Use user name in waveform spec for rigol_dg_waveform_to_string

16 months agorigol-dg: Add user name to waveform spec to allow consistent mapping functions
Ralf [Fri, 23 Oct 2020 05:19:38 +0000 (07:19 +0200)]
rigol-dg: Add user name to waveform spec to allow consistent mapping functions

16 months agorigol-dg: Add some more waveforms for MSO5000
Ralf [Thu, 22 Oct 2020 16:37:21 +0000 (18:37 +0200)]
rigol-dg: Add some more waveforms for MSO5000

Known issue: Read-back of parameters does not work.
Caused by changing :SOUR:APPL to :SOUR:FUNC, because APPL only
supports NOIS, PULS, RAMP, SIN, SQU, USER.
When MSO5000 is configured to a different waveform, there is no answer at all.
sr: [00:00.051760] scpi_vxi: Successfully sent SCPI command: 'SOUR1:APPL?'.
sr: [00:02.056361] scpi_vxi: Device read failed for 192.168.1.250 with error 15

16 months agorigol-dg: Move string to waveform mapping into separate function
Ralf [Thu, 22 Oct 2020 15:45:09 +0000 (17:45 +0200)]
rigol-dg: Move string to waveform mapping into separate function

16 months agorigol-dg: Add basic commands for MSO5000 models
Ralf [Wed, 21 Oct 2020 17:31:16 +0000 (19:31 +0200)]
rigol-dg: Add basic commands for MSO5000 models

16 months agorigol-dg: Handle unknown waveform types and abort gracefully
Ralf [Tue, 20 Oct 2020 18:19:03 +0000 (20:19 +0200)]
rigol-dg: Handle unknown waveform types and abort gracefully

16 months agoconfigure: quote argument to SR_APPEND
Sven Wegener [Sat, 31 Aug 2024 19:11:58 +0000 (21:11 +0200)]
configure: quote argument to SR_APPEND

./configure: line 19086: zlib: command not found

because of

sr_deps_avail=${sr_deps_avail}${sr_deps_avail:+' '}crc32 zlib

Signed-off-by: Sven Wegener <redacted>
16 months agoinput/isf: Minor style fixes
Soeren Apel [Thu, 26 Sep 2024 20:38:20 +0000 (22:38 +0200)]
input/isf: Minor style fixes

16 months agoinput/isf: make WFMTYPE an optional header item
Filip Kosecek [Fri, 9 Feb 2024 11:56:34 +0000 (12:56 +0100)]
input/isf: make WFMTYPE an optional header item

16 months agoinput: add import module for Tektronix ISF file format
Filip Kosecek [Tue, 6 Feb 2024 13:22:01 +0000 (14:22 +0100)]
input: add import module for Tektronix ISF file format

Tektronix devices use ISF format to store captured data.
The format varies depending on the device, so the module
tries to be as general as possible.

17 months agozeroplus-logic-cube: Add external clock settings
g-user [Tue, 8 Feb 2022 21:24:32 +0000 (22:24 +0100)]
zeroplus-logic-cube: Add external clock settings

Enables the "external clock mode" in the Zeroplus LAP-C Logic
Cube driver (falling and rising edge) so that this mode also can be used in
sigrok-cli and pulseview

17 months agoserial-dmm: Add support for Digitech QM1576 serial protocol parser
Mike McCauley [Tue, 28 Jun 2022 00:51:29 +0000 (10:51 +1000)]
serial-dmm: Add support for Digitech QM1576 serial protocol parser

The protocol is described at https://www.airspayce.com/mikem/QM1578/protocol.txt

You can use this decoder with libsigrok and Digitech QM1578 via ESP32 Bluetooth-Serial converter available from the author at: https://www.airspayce.com/mikem/QM1578/QM1578BluetoothClient.ino which connects to the QM1578 over Bluetooth LE, fetches the data stream and sends it on the serial port to the host, where this driver can read it with this command for example:

sigrok-cli --driver digitech-qm1578:conn=/dev/ttyUSB1 --continuous

17 months agoopenbench-logic-sniffer: Properly set samplerate range
Ken Taylor [Sat, 7 Oct 2023 09:02:12 +0000 (02:02 -0700)]
openbench-logic-sniffer: Properly set samplerate range

Driver does query max_samplerate from SUMP metadata,
but previously replied to SR_CONF_SAMPLERATE with fixed
1Hz-200MHz range. Update to use max_samplerate as top
of range.

May fix http://sigrok.org/bugzilla/show_bug.cgi?id=1465

17 months agoopenbench-logic-sniffer: Close serial port if device scan fails
Ken Taylor [Sun, 8 Oct 2023 08:07:05 +0000 (01:07 -0700)]
openbench-logic-sniffer: Close serial port if device scan fails

17 months agoopenbench-logic-sniffer/protocol: Fix hardcoded unitsize
Pavel Fedin [Tue, 21 Nov 2023 20:11:38 +0000 (23:11 +0300)]
openbench-logic-sniffer/protocol: Fix hardcoded unitsize

Some output modules, like srzip, calculate unitsize from maximum number of
channels in the session; and throw an error if the actual datastream uses
bigger size. Remove hardcoded value of 4 and calculate it from maximum number
of channels, supported by the device. Other driver seem to do the same.

This fixes "Unexpected unit size" saving a capture, made by an OLS device with
small number of channels.

The bug was found by using gillham's Arduino analyzer
(https://github.com/gillham/logic_analyzer), which supports a maximum of 8
channels. According to the error message, srzip expected unitsize == 1.

Signed-off-by: Pavel Fedin <redacted>
17 months agobindings/swig: Make Device::connection_id() an attribute
Marc Schink [Fri, 29 Mar 2024 14:11:08 +0000 (15:11 +0100)]
bindings/swig: Make Device::connection_id() an attribute

Signed-off-by: Marc Schink <redacted>
17 months agobindings/swig: Make Device::serial_number() an attribute
Marc Schink [Wed, 20 Mar 2024 14:00:06 +0000 (15:00 +0100)]
bindings/swig: Make Device::serial_number() an attribute

Convert Device::serial_number() to an attribute string as for other
functions such as vendor() and model().

Signed-off-by: Marc Schink <redacted>
17 months agoAdd SR_CONF_DELAY_GENERATOR
Marc Schink [Wed, 31 Jan 2024 10:09:54 +0000 (11:09 +0100)]
Add SR_CONF_DELAY_GENERATOR

Signed-off-by: Marc Schink <redacted>
17 months agoAdd SR_CONF_INVERTED
Marc Schink [Wed, 7 Feb 2024 15:15:31 +0000 (16:15 +0100)]
Add SR_CONF_INVERTED

Many device such as oscilloscopes, signal and delay generators are
capable to invert signals or change their polarity.

Add a new configuration to implement such a feature. The term 'inverted'
is chosen in favor of 'polarity' because the former can be unambiguously
represented by a boolean value.

Signed-off-by: Marc Schink <redacted>
17 months agobackend: Add missing #ifdef for zlib
Marc Schink [Tue, 20 Feb 2024 17:19:54 +0000 (18:19 +0100)]
backend: Add missing #ifdef for zlib

Add #ifdef statement since zlib is optional. At the moment an empty
version string is used when zlib is not available:

backend: Libs: glib 2.72.4 (rt: 2.72.4/7204:4), zlib , libzip 1.7.3,

Signed-off-by: Marc Schink <redacted>
17 months agotcp: Fix memory leak in sr_tcp_dev_inst_free()
Marc Schink [Wed, 20 Mar 2024 08:12:41 +0000 (09:12 +0100)]
tcp: Fix memory leak in sr_tcp_dev_inst_free()

Signed-off-by: Marc Schink <redacted>