]> sigrok.org Git - libsigrok.git/log
libsigrok.git
6 years agosession_driver: Quickfix to prevent looped analog data reads.
Uwe Hermann [Thu, 19 Apr 2018 21:23:35 +0000 (23:23 +0200)]
session_driver: Quickfix to prevent looped analog data reads.

A local buffer was too small, snprintf() was used to write the
name of the analog-1-1-xxx ZIP archive names in that buffer.

Due to the limited size, only 3 characters were usable for the last
number component, i.e. the code would loop around from analog-1-1-999
to analog-1-1-100 (instead of analog-1-1-1000).

As a quickfix, increase the buffer size by a large margin, a nicer
fix should be used later on.

6 years agoinput/null: Add a null module that discards all data.
Uwe Hermann [Thu, 19 Apr 2018 20:15:54 +0000 (22:15 +0200)]
input/null: Add a null module that discards all data.

This is useful for testing purposes.

6 years agooutput/null: Add a null module that discards all data.
Uwe Hermann [Thu, 19 Apr 2018 18:10:50 +0000 (20:10 +0200)]
output/null: Add a null module that discards all data.

This is useful for testing purposes.

6 years agoinput/output: Slightly improved module descriptions.
Uwe Hermann [Thu, 19 Apr 2018 16:19:44 +0000 (18:19 +0200)]
input/output: Slightly improved module descriptions.

6 years agoinput modules: Increase chunk size to 4MB for all modules.
Uwe Hermann [Wed, 18 Apr 2018 21:22:38 +0000 (23:22 +0200)]
input modules: Increase chunk size to 4MB for all modules.

This reduces overhead and can slightly increase performance, depending
on the module.

6 years agoinput modules: Name chunk size #defines CHUNK_SIZE consistently.
Uwe Hermann [Wed, 18 Apr 2018 21:29:28 +0000 (23:29 +0200)]
input modules: Name chunk size #defines CHUNK_SIZE consistently.

6 years agoinput/trace32_ad: Drop unused #define.
Uwe Hermann [Wed, 18 Apr 2018 21:28:45 +0000 (23:28 +0200)]
input/trace32_ad: Drop unused #define.

6 years agoinput/wav: Put internal buffer on the heap instead of the stack.
Uwe Hermann [Wed, 18 Apr 2018 21:25:25 +0000 (23:25 +0200)]
input/wav: Put internal buffer on the heap instead of the stack.

Increasing the buffer/chunk size could cause issues when trying to put
large arrays on the stack.

6 years agoinput/binary: Increase chunk size from 4KB to 4MB.
Uwe Hermann [Sat, 14 Apr 2018 19:38:07 +0000 (21:38 +0200)]
input/binary: Increase chunk size from 4KB to 4MB.

This can slightly increase performance when loading larger files.

6 years agoinput/binary: Only calculate unitsize once.
Uwe Hermann [Sat, 14 Apr 2018 17:46:43 +0000 (19:46 +0200)]
input/binary: Only calculate unitsize once.

6 years agoinput modules: Improve option names and descriptions.
Uwe Hermann [Sat, 14 Apr 2018 16:47:49 +0000 (18:47 +0200)]
input modules: Improve option names and descriptions.

These should be slightly more useful and contain more information
(should also work reasonably well for 'sigrok-cli --show' and as
tooltips in UIs).

6 years agozketech-ebd-usb: Drop unneeded log message.
Uwe Hermann [Sun, 8 Apr 2018 18:56:34 +0000 (20:56 +0200)]
zketech-ebd-usb: Drop unneeded log message.

The number of bytes sent is already logged by the libsigrok serial code.

6 years agoconfigure.ac: zketech-ebd-usb driver needs libserialport.
Uwe Hermann [Tue, 3 Apr 2018 16:05:37 +0000 (18:05 +0200)]
configure.ac: zketech-ebd-usb driver needs libserialport.

6 years agozketech-ebd-usb: Shorten function name prefix for better readability.
Uwe Hermann [Tue, 3 Apr 2018 14:55:14 +0000 (16:55 +0200)]
zketech-ebd-usb: Shorten function name prefix for better readability.

6 years agozketech-ebd-usb: Make a few functions static.
Uwe Hermann [Tue, 3 Apr 2018 10:52:38 +0000 (12:52 +0200)]
zketech-ebd-usb: Make a few functions static.

6 years agozketech-ebd-usb: Add some underscores to #defines.
Uwe Hermann [Tue, 3 Apr 2018 10:23:02 +0000 (12:23 +0200)]
zketech-ebd-usb: Add some underscores to #defines.

6 years agozketech-ebd-usb: First version of the driver.
Sven Bursch-Osewold [Sun, 1 Apr 2018 13:12:46 +0000 (15:12 +0200)]
zketech-ebd-usb: First version of the driver.

6 years agozketech-ebd-usb: Initial driver skeleton.
Sven Bursch-Osewold [Thu, 8 Feb 2018 17:01:23 +0000 (18:01 +0100)]
zketech-ebd-usb: Initial driver skeleton.

6 years agousbtmc: Silence some overly verbose log messages.
Uwe Hermann [Sun, 8 Apr 2018 17:47:00 +0000 (19:47 +0200)]
usbtmc: Silence some overly verbose log messages.

These trigger quite often with unrelated devices and confuse people.

  scpi_usbtmc: Failed to get configuration descriptor: LIBUSB_ERROR_NOT_FOUND, ignoring device.

6 years agordtech-dps: User ternary operator.
Uwe Hermann [Thu, 29 Mar 2018 06:45:25 +0000 (08:45 +0200)]
rdtech-dps: User ternary operator.

6 years agordtech-dps: New driver for RDTech DPS/DPH series PSUs.
James Churchill [Tue, 20 Feb 2018 01:42:56 +0000 (11:42 +1000)]
rdtech-dps: New driver for RDTech DPS/DPH series PSUs.

6 years agordtech-dps: Initial driver skeleton.
James Churchill [Tue, 20 Feb 2018 01:28:38 +0000 (11:28 +1000)]
rdtech-dps: Initial driver skeleton.

6 years agomodbus: Return explicit SR_ERR values as required by modbus.c
James Churchill [Sun, 18 Feb 2018 06:54:01 +0000 (16:54 +1000)]
modbus: Return explicit SR_ERR values as required by modbus.c

The Modbus RTU implementation was inappropriately returning lengths
from the serial functions when the calling functions expect only an
sr_error_code value.

6 years agomodbus: Increase modbus reply timeout to 500ms.
James Churchill [Sun, 18 Feb 2018 06:29:01 +0000 (16:29 +1000)]
modbus: Increase modbus reply timeout to 500ms.

Needed by rdtech-dps driver, 100ms is too short.

6 years agoresource.c: Fix firmware loading bug (#1140)
Soeren Apel [Tue, 20 Mar 2018 08:41:51 +0000 (09:41 +0100)]
resource.c: Fix firmware loading bug (#1140)

6 years agobackend: Emit firmware search paths in a log message.
Uwe Hermann [Sun, 18 Mar 2018 17:16:26 +0000 (18:16 +0100)]
backend: Emit firmware search paths in a log message.

6 years agoIntroduce sr_resourcepaths_get()
Soeren Apel [Sat, 17 Mar 2018 20:21:32 +0000 (21:21 +0100)]
Introduce sr_resourcepaths_get()

This provides an interface to fix #1128.

6 years agokorad-kaxxxxp: Korad OEM: RND KA3005P
Axel Hinrichs [Fri, 9 Mar 2018 21:23:35 +0000 (22:23 +0100)]
korad-kaxxxxp: Korad OEM: RND KA3005P

6 years agooutput/csv: fix out-of-bounds array access in process_analog()
Gerhard Sittig [Sun, 4 Mar 2018 18:12:29 +0000 (19:12 +0100)]
output/csv: fix out-of-bounds array access in process_analog()

Make sure to not exceed the ctx->analog_samples[] array bounds. Don't
use the (huge) channel's index in the device's(!) channel list, instead
use the zero-based and dense index into the array of analog samples in
the accumulation buffer, before writing to the external file.

This fixes the segfault reported in bug #1124.

6 years agooutput/csv: use longer names for iteration variables
Gerhard Sittig [Sun, 4 Mar 2018 17:19:38 +0000 (18:19 +0100)]
output/csv: use longer names for iteration variables

The process_analog() logic is rather complex, dealing with the total
list of channels in the device (which can be of different types), and a
number of submitted samples for a specified list of channels. Replace
the rather short variable names for i, j, c (and num_channels) with
something longer that hopefully increases readability of the complex
loop bodies.

Note that this change merely renames identifiers, and does not change
behaviour.

6 years agooutput/csv: reduce indentation in process_analog()
Gerhard Sittig [Sun, 4 Mar 2018 16:51:29 +0000 (17:51 +0100)]
output/csv: reduce indentation in process_analog()

Instead of nesting indentation levels upon equality of a value, skip
iterations upon inequality. This reduces indentation, and might improve
readability.

[ Indentation changes, see 'diff -w -b' for the essence. ]

6 years agohp-3478a: Remove unnecessary curly brackets.
Frank Stettner [Tue, 6 Mar 2018 16:44:28 +0000 (17:44 +0100)]
hp-3478a: Remove unnecessary curly brackets.

6 years agohp-3478a: Set correct number of digits
Frank Stettner [Tue, 6 Mar 2018 14:10:13 +0000 (15:10 +0100)]
hp-3478a: Set correct number of digits

6 years agohp-3478a: spec_digits must be parsed before range parsing.
Frank Stettner [Tue, 6 Mar 2018 13:11:29 +0000 (14:11 +0100)]
hp-3478a: spec_digits must be parsed before range parsing.

6 years agoarachnid-labs-re-load-pro: Replace C++-style comments with C-style comments.
Frank Stettner [Tue, 6 Mar 2018 15:56:42 +0000 (16:56 +0100)]
arachnid-labs-re-load-pro: Replace C++-style comments with C-style comments.

6 years agometex14: Fix wrong measurement modes
Frank Stettner [Thu, 22 Feb 2018 14:30:43 +0000 (15:30 +0100)]
metex14: Fix wrong measurement modes

6 years agometex14: Add power factor measurement mode
Frank Stettner [Thu, 22 Feb 2018 14:16:15 +0000 (15:16 +0100)]
metex14: Add power factor measurement mode

6 years agolibsigrok.h: Fix SR_CONF_UNDER_VOLTAGE_CONDITION_THRESHOLD order.
Uwe Hermann [Sat, 3 Mar 2018 18:25:57 +0000 (19:25 +0100)]
libsigrok.h: Fix SR_CONF_UNDER_VOLTAGE_CONDITION_THRESHOLD order.

This has to be the last entry in its "category", otherwise it'll mean an
ABI breakage.

6 years agoarachnid-labs-re-load-pro: Simplify a code chunk.
Uwe Hermann [Sat, 3 Mar 2018 18:24:35 +0000 (19:24 +0100)]
arachnid-labs-re-load-pro: Simplify a code chunk.

6 years agoarachnid-labs-re-load-pro: Add encoding.digits to analog packet
Frank Stettner [Thu, 18 Jan 2018 17:41:26 +0000 (18:41 +0100)]
arachnid-labs-re-load-pro: Add encoding.digits to analog packet

6 years agoarachnid-labs-re-load-pro: Index for channel "I"
Frank Stettner [Fri, 5 Jan 2018 19:07:20 +0000 (20:07 +0100)]
arachnid-labs-re-load-pro: Index for channel "I"

6 years agoarachnid-labs-re-load-pro: Get a response when in acquision mode.
Frank Stettner [Mon, 11 Dec 2017 15:06:16 +0000 (16:06 +0100)]
arachnid-labs-re-load-pro: Get a response when in acquision mode.

6 years agoarachnid-labs-re-load-pro: Make SR_CONF_REGULATION listable
Frank Stettner [Thu, 7 Dec 2017 09:41:32 +0000 (10:41 +0100)]
arachnid-labs-re-load-pro: Make SR_CONF_REGULATION listable

6 years agoarachnid-labs-re-load-pro: Add SR_CONF_UNDER_VOLTAGE_THRESHOLD.
Frank Stettner [Mon, 20 Nov 2017 14:20:58 +0000 (15:20 +0100)]
arachnid-labs-re-load-pro: Add SR_CONF_UNDER_VOLTAGE_THRESHOLD.

6 years agoarachnid-labs-re-load-pro: Setting correct current limit.
Frank Stettner [Mon, 20 Nov 2017 12:48:53 +0000 (13:48 +0100)]
arachnid-labs-re-load-pro: Setting correct current limit.

Use round() instead of just truncate the value.

6 years agoarachnid-labs-re-load-pro: Change serial read in acquisition mode.
Frank Stettner [Sat, 11 Nov 2017 17:29:19 +0000 (18:29 +0100)]
arachnid-labs-re-load-pro: Change serial read in acquisition mode.

Use serial_readline in acquisition mode, otherwise data from the
Re:load Pro could get lost.
Use reloadpro_receive_data() for all commands when in acquisition
mode. When not using a single point of receiving data, data could get
lost.

6 years agopipistrello-ols: style nit, replace DIY endianess conversion
Gerhard Sittig [Wed, 21 Feb 2018 17:13:36 +0000 (18:13 +0100)]
pipistrello-ols: style nit, replace DIY endianess conversion

6 years agolink-mso19: improve endianess conversion, avoid mem access alignment issue
Gerhard Sittig [Wed, 21 Feb 2018 17:04:29 +0000 (18:04 +0100)]
link-mso19: improve endianess conversion, avoid mem access alignment issue

Prefer sigrok's endianess conversion helper over the inet htons()
routine which is harder to read (is "network order" little or big?).

Writing the conversion results in units of bytes also avoids misaligned
memory access. The header length is odd, each payload item got written
as an uint16_t item to an odd address.

6 years agouni-t-dmm: style nits, copy loop vs memmove
Gerhard Sittig [Wed, 21 Feb 2018 17:03:11 +0000 (18:03 +0100)]
uni-t-dmm: style nits, copy loop vs memmove

6 years agosaleae-logic-pro: style nits, copy loop vs memcpy
Gerhard Sittig [Wed, 21 Feb 2018 17:01:41 +0000 (18:01 +0100)]
saleae-logic-pro: style nits, copy loop vs memcpy

6 years agopce-322a: style nits, copy loop vs memmove
Gerhard Sittig [Wed, 21 Feb 2018 16:59:33 +0000 (17:59 +0100)]
pce-322a: style nits, copy loop vs memmove

6 years agomic-985xx: style nits, var decl vs assignment, copy loop vs memmove
Gerhard Sittig [Wed, 21 Feb 2018 16:58:41 +0000 (17:58 +0100)]
mic-985xx: style nits, var decl vs assignment, copy loop vs memmove

6 years agokern-scale: style nits, var decl vs assignment, copy loop vs memmove
Gerhard Sittig [Wed, 21 Feb 2018 16:56:50 +0000 (17:56 +0100)]
kern-scale: style nits, var decl vs assignment, copy loop vs memmove

6 years agocenter-3xx: style nits, var decl vs assignment, copy loop vs memmove
Gerhard Sittig [Wed, 21 Feb 2018 16:55:07 +0000 (17:55 +0100)]
center-3xx: style nits, var decl vs assignment, copy loop vs memmove

6 years agosiglent-sds: Drop superfluous log message.
Uwe Hermann [Sat, 3 Mar 2018 17:45:58 +0000 (18:45 +0100)]
siglent-sds: Drop superfluous log message.

This information is already emitted by other layers.

6 years agosiglent-sds: Added trigger position to device config code
marchelh [Sun, 25 Feb 2018 08:28:39 +0000 (09:28 +0100)]
siglent-sds: Added trigger position to device config code

6 years agosiglent-sds: Fixed issue with hard coded vdiv.
marchelh [Sun, 25 Feb 2018 08:20:53 +0000 (09:20 +0100)]
siglent-sds: Fixed issue with hard coded vdiv.

6 years agosiglent-sds: Drop unused variable from siglent_sds_read_header function
marchelh [Sun, 25 Feb 2018 08:20:53 +0000 (09:20 +0100)]
siglent-sds: Drop unused variable from siglent_sds_read_header function

6 years agosiglent-sds: Added averaging function.
marchelh [Sun, 25 Feb 2018 08:14:57 +0000 (09:14 +0100)]
siglent-sds: Added averaging function.

6 years agosiglent-sds: Fixed timebase problem where NS could not be selected
marchelh [Sun, 25 Feb 2018 07:48:22 +0000 (08:48 +0100)]
siglent-sds: Fixed timebase problem where NS could not be selected

This fixes bug #1120.

6 years agotests: Fix incomplete fail message for locale tests.
Frank Stettner [Mon, 19 Feb 2018 14:31:30 +0000 (15:31 +0100)]
tests: Fix incomplete fail message for locale tests.

6 years agohp-3478a: Fix compiler warning.
Frank Stettner [Mon, 19 Feb 2018 12:30:13 +0000 (13:30 +0100)]
hp-3478a: Fix compiler warning.

6 years agoCheck usb_get_port_path() return value
Romain Tartière [Tue, 28 Nov 2017 19:07:29 +0000 (20:07 +0100)]
Check usb_get_port_path() return value

This function can fail. If so, do not ignore the failure.

6 years agoEnsure device is closed before usb_get_port_path()
Romain Tartière [Tue, 28 Nov 2017 18:43:50 +0000 (19:43 +0100)]
Ensure device is closed before usb_get_port_path()

The usb_get_port_path() function opens the passed device on FreeBSD,
which fails if the device has already been open.

This fixes bug #1109.

6 years agobindings/ruby: include config.h before any other header file
Gerhard Sittig [Mon, 19 Feb 2018 15:45:32 +0000 (16:45 +0100)]
bindings/ruby: include config.h before any other header file

6 years agobindings/python: include config.h before any other header file
Gerhard Sittig [Mon, 19 Feb 2018 15:44:09 +0000 (16:44 +0100)]
bindings/python: include config.h before any other header file

6 years agobindings/cxx: include config.h as early as possible
Gerhard Sittig [Mon, 19 Feb 2018 15:42:18 +0000 (16:42 +0100)]
bindings/cxx: include config.h as early as possible

Move the inclusion of <config.h> before any other source code.

6 years agopce-322a: include config.h before any other header file
Gerhard Sittig [Mon, 19 Feb 2018 15:41:06 +0000 (16:41 +0100)]
pce-322a: include config.h before any other header file

6 years agobeaglelogic: Use UINT64_MAX instead of (uint64_t)-1.
Uwe Hermann [Tue, 20 Feb 2018 19:02:30 +0000 (20:02 +0100)]
beaglelogic: Use UINT64_MAX instead of (uint64_t)-1.

6 years agobeaglelogic: Drop unneeded uint64_t cast.
Uwe Hermann [Tue, 20 Feb 2018 19:01:55 +0000 (20:01 +0100)]
beaglelogic: Drop unneeded uint64_t cast.

6 years agolecroy-xstream: Fix potential issue by adding UINT64_C.
Uwe Hermann [Tue, 20 Feb 2018 19:00:10 +0000 (20:00 +0100)]
lecroy-xstream: Fix potential issue by adding UINT64_C.

6 years agoUse UINT64_C instead of "ULL" number suffix.
Uwe Hermann [Tue, 20 Feb 2018 18:59:16 +0000 (19:59 +0100)]
Use UINT64_C instead of "ULL" number suffix.

Avoid hardcoding a "ULL" number suffix, use the more portable and more
correct UINT64_C.

6 years agoRandom whitespace/cosmetic fixes.
Uwe Hermann [Tue, 20 Feb 2018 18:34:55 +0000 (19:34 +0100)]
Random whitespace/cosmetic fixes.

6 years agosiglent-sds: Fix two memory leaks.
Uwe Hermann [Sun, 18 Feb 2018 22:36:17 +0000 (23:36 +0100)]
siglent-sds: Fix two memory leaks.

6 years agosiglent-sds: Drop incorrect glib includes.
Uwe Hermann [Sun, 18 Feb 2018 22:29:14 +0000 (23:29 +0100)]
siglent-sds: Drop incorrect glib includes.

6 years agohp-3478a: Shorten some functions.
Uwe Hermann [Sun, 18 Feb 2018 22:14:51 +0000 (23:14 +0100)]
hp-3478a: Shorten some functions.

6 years agohp-3478a: Drop superfluous log message prefixes.
Uwe Hermann [Sun, 18 Feb 2018 22:12:46 +0000 (23:12 +0100)]
hp-3478a: Drop superfluous log message prefixes.

6 years agohp-3478a: Initial HP 3478A diver
Frank Stettner [Mon, 2 Oct 2017 10:50:04 +0000 (12:50 +0200)]
hp-3478a: Initial HP 3478A diver

6 years agohp-3478a: Initial driver skeleton.
Frank Stettner [Sun, 17 Sep 2017 13:04:06 +0000 (15:04 +0200)]
hp-3478a: Initial driver skeleton.

6 years agooutput/analog: Fix a compiler warning on Mac OS X.
Uwe Hermann [Sun, 18 Feb 2018 20:23:28 +0000 (21:23 +0100)]
output/analog: Fix a compiler warning on Mac OS X.

Apparently PRIu64 and G_GUINT64_FORMAT differ on some systems for
unknown reasons. Use G_GUINT64_FORMAT to get rid of the warning
for now.

6 years agoFix two compiler warnings on MinGW/MSYS2.
Uwe Hermann [Sun, 18 Feb 2018 20:13:56 +0000 (21:13 +0100)]
Fix two compiler warnings on MinGW/MSYS2.

The config.h file must always be included as first file.

  src/output/csv.c: In function 'gen_header':
  src/output/csv.c:64:20: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "output/csv"
                      ^
  ./src/libsigrok-internal.h:753:42: note: in expansion of macro 'LOG_PREFIX'
   #define sr_info(...) sr_log(SR_LOG_INFO, LOG_PREFIX ": " __VA_ARGS__)
                                            ^
  src/output/csv.c:244:3: note: in expansion of macro 'sr_info'
     sr_info("Set sample period to %" PRIu64 " %s",
     ^
  src/output/csv.c: In function 'dump_saved_values':
  src/output/csv.c:462:34: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
       g_string_append_printf(*out, "%" PRIu64 "%s",
                                    ^

  In file included from src/hardware/ftdi-la/protocol.c:21:0:
  src/hardware/ftdi-la/protocol.c: In function 'send_samples':
  src/hardware/ftdi-la/protocol.h:28:20: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "ftdi-la"
                      ^
  ./src/libsigrok-internal.h:751:42: note: in expansion of macro 'LOG_PREFIX'
   #define sr_spew(...) sr_log(SR_LOG_SPEW, LOG_PREFIX ": " __VA_ARGS__)
                                            ^
  src/hardware/ftdi-la/protocol.c:29:2: note: in expansion of macro 'sr_spew'
    sr_spew("Sending %" PRIu64 " samples.", samples_to_send);
    ^

6 years agosiglent-sds: Fix multiple compiler warnings.
Uwe Hermann [Sun, 18 Feb 2018 16:40:59 +0000 (17:40 +0100)]
siglent-sds: Fix multiple compiler warnings.

6 years agosiglent-sds: Remove unused variable.
Uwe Hermann [Sun, 18 Feb 2018 16:14:08 +0000 (17:14 +0100)]
siglent-sds: Remove unused variable.

6 years agodmm: Remove unnecessary casts
Frank Stettner [Wed, 14 Feb 2018 20:04:09 +0000 (21:04 +0100)]
dmm: Remove unnecessary casts

6 years agometex14: Add missing modes and set correct digits value.
Frank Stettner [Wed, 14 Feb 2018 11:49:04 +0000 (12:49 +0100)]
metex14: Add missing modes and set correct digits value.

6 years agoserial-dmm, metex14: add support for multiple channels per DMM
Gerhard Sittig [Wed, 7 Feb 2018 21:09:14 +0000 (22:09 +0100)]
serial-dmm, metex14: add support for multiple channels per DMM

Optionally create multiple analog channels in serial-dmm's scan()
routine. Allow the meters' parse routines to fill in more than one
analog value from the inspection of a single packet.

Use "large" (4 times 14 bytes) packets for the Metex M-3860M and the
PeakTech 4390A meters, and have those large packets parsed by wrapping
the routines for regular 14-byte Metex packets, and sending four values
to the session bus after reception of one large packet.

Thanks to Frank Stettner <redacted> for testing and
fixing the initial implementation of this extension.

6 years agoserial-dmm: style nit (init vs assign, memmove(3))
Gerhard Sittig [Wed, 7 Feb 2018 21:34:35 +0000 (22:34 +0100)]
serial-dmm: style nit (init vs assign, memmove(3))

Move the initial assignment to the 'offset' variable to the very spot
where it gets evaluated and subsequently manipulated.

Replace a DIY copy loop with the corresponding memmove(3) call.

6 years agosiglent-sds: Bring driver up-to-date with current code conventions.
Uwe Hermann [Sat, 17 Feb 2018 18:08:07 +0000 (19:08 +0100)]
siglent-sds: Bring driver up-to-date with current code conventions.

Use ARRAY_AND_SIZE where possible, use std.c helpers where possible,
make scanopts/drvopts/devopts consistent with other drivers.

6 years agosiglent-sds: Drop obsolete SR_ST_ACTIVE checks.
Uwe Hermann [Sat, 17 Feb 2018 16:47:28 +0000 (17:47 +0100)]
siglent-sds: Drop obsolete SR_ST_ACTIVE checks.

These are now done in the wrapper functions.

6 years agosiglent-sds: Random cosmetics, drop unused stuff.
Uwe Hermann [Sat, 17 Feb 2018 16:18:32 +0000 (17:18 +0100)]
siglent-sds: Random cosmetics, drop unused stuff.

6 years agosiglent-sds: Use PRIu64 for uint64_t variables.
Uwe Hermann [Sat, 17 Feb 2018 15:01:58 +0000 (16:01 +0100)]
siglent-sds: Use PRIu64 for uint64_t variables.

This fixes various compiler warnings on some systems.

6 years agosiglent-sds: Fix SR_CONF_TRIGGER_SLOPE config_set() code.
Uwe Hermann [Fri, 16 Feb 2018 23:44:55 +0000 (00:44 +0100)]
siglent-sds: Fix SR_CONF_TRIGGER_SLOPE config_set() code.

Also use "r" and "f" as trigger slope values for now, since that's
what most other drivers do currently.

This also fixes two scan-build issues:

  api.c:559:3: warning: Value stored to 'tmp_str' is never read
                  tmp_str = g_variant_get_string(data, NULL);
                  ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  api.c:561:9: warning: Use of memory after it is freed
                  ret = siglent_sds_config_set(sdi, "%s:TRSL %s",
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

6 years agoudev: Add entries for Siglent USBTMC devices.
Uwe Hermann [Fri, 16 Feb 2018 22:40:15 +0000 (23:40 +0100)]
udev: Add entries for Siglent USBTMC devices.

6 years agosiglent-sds: Add 100s timebase (seen on e.g. SDS1202X-E).
Uwe Hermann [Fri, 16 Feb 2018 23:00:31 +0000 (00:00 +0100)]
siglent-sds: Add 100s timebase (seen on e.g. SDS1202X-E).

6 years agosiglent-sds: Add SDS1052DL+ model.
Uwe Hermann [Fri, 16 Feb 2018 22:24:33 +0000 (23:24 +0100)]
siglent-sds: Add SDS1052DL+ model.

6 years agosiglent-sds: Various cosmetics and coding-style fixes.
Uwe Hermann [Fri, 16 Feb 2018 19:33:44 +0000 (20:33 +0100)]
siglent-sds: Various cosmetics and coding-style fixes.

Also, drop some unneeded comments and log messages.

6 years agohantek-4032l: Minor cosmetics.
Uwe Hermann [Thu, 15 Feb 2018 21:45:35 +0000 (22:45 +0100)]
hantek-4032l: Minor cosmetics.

6 years agostd.c: Add missing <sys/time.h> #include and _XOPEN_SOURCE.
Uwe Hermann [Tue, 13 Feb 2018 20:54:46 +0000 (21:54 +0100)]
std.c: Add missing <sys/time.h> #include and _XOPEN_SOURCE.

This is required for gettimeofday() to be available (at least on
FreeBSD), causes compiler warnings otherwise.

6 years agosiglent-sds: Replace non-portable strcasestr() with g_strstr_len().
Uwe Hermann [Tue, 13 Feb 2018 21:37:01 +0000 (22:37 +0100)]
siglent-sds: Replace non-portable strcasestr() with g_strstr_len().

The strcasestr() function is non-portable (e.g. not available on
MinGW, possibly elsewhere). Replace it with g_strstr_len() for the time
being. While the latter is not case-insensitive it appears that
that property doesn't matter here ("." should not be relevant anyway,
and e.g. an SDS1202X-E does indeed report "Mpts" as such).

Should it become necessary to have this code be case-insensitive,
we'll have to find a more portable solution than strcasestr().

6 years agosiglent-sds: Drop currently unused <rpc/rpc.h> #include.
Uwe Hermann [Tue, 13 Feb 2018 20:52:25 +0000 (21:52 +0100)]
siglent-sds: Drop currently unused <rpc/rpc.h> #include.

This causes some compile errors on platforms where RPC is not available, e.g.

  siglent-sds/api.c:25:21: fatal error: rpc/rpc.h: No such file or directory

Surrounding the #include (and later code) with "#if HAVE_RPC" should avoid
these compile errors, but since it's not used at all for now, drop it.