]> sigrok.org Git - libsigrok.git/log
libsigrok.git
8 years agopython: Give all enum values __doc__ strings.
Martin Ling [Sun, 25 Oct 2015 14:04:49 +0000 (14:04 +0000)]
python: Give all enum values __doc__ strings.

8 years agopython: Add docstrings for enum constants.
Martin Ling [Sun, 25 Oct 2015 12:06:20 +0000 (12:06 +0000)]
python: Add docstrings for enum constants.

8 years agojava: Add docstrings for enum constants.
Martin Ling [Sun, 25 Oct 2015 03:01:30 +0000 (03:01 +0000)]
java: Add docstrings for enum constants.

8 years agoC++: Include enum classes when generating documentation.
Martin Ling [Sun, 25 Oct 2015 02:07:35 +0000 (02:07 +0000)]
C++: Include enum classes when generating documentation.

8 years agoC++: Declare namespace in enums.hpp so it can be used independently.
Martin Ling [Sun, 25 Oct 2015 01:57:26 +0000 (01:57 +0000)]
C++: Declare namespace in enums.hpp so it can be used independently.

8 years agojava: Make enum values available as normal constants.
Martin Ling [Sun, 25 Oct 2015 01:39:16 +0000 (01:39 +0000)]
java: Make enum values available as normal constants.

8 years agoJava: Remove obsolete SourceCallback interface
Daniel Elstner [Mon, 26 Oct 2015 06:11:20 +0000 (07:11 +0100)]
Java: Remove obsolete SourceCallback interface

8 years agoC++: Avoid const ref args to appease Java bindings
Daniel Elstner [Mon, 26 Oct 2015 06:04:10 +0000 (07:04 +0100)]
C++: Avoid const ref args to appease Java bindings

The Java bindings currently have some weird problem with function
arguments passed by const reference. Not all types are affected,
but the collection types that involve custom typemaps are.

For now, revert back to pass-by-value for the problematic types.

8 years agoC++: Use C++98 syntax for default arguments to appease SWIG
Daniel Elstner [Mon, 26 Oct 2015 04:18:06 +0000 (05:18 +0100)]
C++: Use C++98 syntax for default arguments to appease SWIG

Looks like SWIG silently ignores default arguments specified via
aggregate initialization. This is rather unfortunate, especially
if the argument types are complex.

8 years agoC++: Replace custom deleters with std::default_delete
Daniel Elstner [Thu, 15 Oct 2015 17:21:28 +0000 (19:21 +0200)]
C++: Replace custom deleters with std::default_delete

Replace custom Deleter classes with std::default_delete<>, declared
as friend so it can invoke the private destructor. Inexplicably,
std::shared_ptr<> does not use default_delete<> by default, so it
is still necessary to explicitly specify the deleter when creating
shared_ptr instances.

With this, unique_ptr and shared_ptr instances now use the same
default delete mechanism.

8 years agoC++: Use smart pointers instead of manual delete
Daniel Elstner [Thu, 15 Oct 2015 16:32:44 +0000 (18:32 +0200)]
C++: Use smart pointers instead of manual delete

Make use of std::unique_ptr<> to manage the lifetime of members
or container elements, so that manual invocations of delete can
be avoided. This also provides for exception safety.

Since std::unique_ptr<> is only movable but not copyable, adapt
the code to avoid copies and assignments of these pointers.

8 years agoC++: Move C struct pointers out of ownership classes
Daniel Elstner [Sun, 11 Oct 2015 15:57:30 +0000 (17:57 +0200)]
C++: Move C struct pointers out of ownership classes

Reduce needless over-generalization. There is no design need
for the ParentOwned and UserOwned classes to contain the C base
struct pointer. Instead, just make the _structure pointer a
private member of each class that needs one.

8 years agoC++: Rename get_shared_pointer() to share_owned_by()
Daniel Elstner [Sun, 11 Oct 2015 15:11:37 +0000 (17:11 +0200)]
C++: Rename get_shared_pointer() to share_owned_by()

This makes it clearer that this method assigns the parent
(owner) reference.

8 years agoC++: Use shared_from_this() exclusively on this
Daniel Elstner [Sun, 11 Oct 2015 15:01:05 +0000 (17:01 +0200)]
C++: Use shared_from_this() exclusively on this

Never call shared_from_this() on any object other than "this".
Adapt the API so that it can be made protected.

8 years agoC++: Make most members private instead of protected
Daniel Elstner [Sun, 11 Oct 2015 12:51:51 +0000 (14:51 +0200)]
C++: Make most members private instead of protected

Use protected only for members which are actually needed by
sub-classes. Declare all the rest private.

8 years agoSWIG: Hack around SWIG segfault on private destructors
Daniel Elstner [Sun, 11 Oct 2015 12:31:18 +0000 (14:31 +0200)]
SWIG: Hack around SWIG segfault on private destructors

Apparently this problem has been fixed in SWIG 3.0.6. However,
until we can require that version, define "private" as "protected"
when running the SWIG parser.

8 years agoC++: Make value get accessors const
Daniel Elstner [Sun, 11 Oct 2015 11:57:42 +0000 (13:57 +0200)]
C++: Make value get accessors const

Declare accessor methods that return value members const. For now,
skip all cases where constness would have to be applied transitively
to shared objects.

8 years agoC++: Make some methods static to match the C API
Daniel Elstner [Sun, 11 Oct 2015 10:35:01 +0000 (12:35 +0200)]
C++: Make some methods static to match the C API

Context::package_version() and Context::lib_version() do not access
context state and should be static. However, leave the logging
related methods alone for now, as making them static would entail
making the callback data a global static, since the C API lacks
destroy notification callbacks.

8 years agoC++: Declare all callbacks invoked from C noexcept
Daniel Elstner [Wed, 14 Oct 2015 18:56:51 +0000 (20:56 +0200)]
C++: Declare all callbacks invoked from C noexcept

If one of these functions does throw an exception, std::terminate()
will be called. Without this, the behavior is undefined since the C
stack is not prepared to deal with exceptions.

8 years agoC++: Use noexcept instead of throw()
Daniel Elstner [Sun, 11 Oct 2015 10:19:27 +0000 (12:19 +0200)]
C++: Use noexcept instead of throw()

Runtime-checked exception specifications via throw() are
deprecated in C++11.

8 years agoSWIG: Define "noexcept" empty to work around SWIG bug
Daniel Elstner [Sun, 11 Oct 2015 10:12:28 +0000 (12:12 +0200)]
SWIG: Define "noexcept" empty to work around SWIG bug

The SWIG 2.0.12 on my system bails out with a syntax error on the
"noexcept" keyword in C++11 code. Define "noexcept" to nothing (for
the SWIG parser only) to work around this problem.

8 years agoC++: Make most constructors explicit
Daniel Elstner [Sun, 11 Oct 2015 09:39:07 +0000 (11:39 +0200)]
C++: Make most constructors explicit

Unless implicit conversion is desired, constructors that can be
called with one argument should be marked as "explicit".

8 years agoC++: Do not use C-style casts
Daniel Elstner [Sun, 11 Oct 2015 08:48:12 +0000 (10:48 +0200)]
C++: Do not use C-style casts

Never ever.

8 years agoC++: Consistently use nullptr instead of NULL
Daniel Elstner [Sun, 11 Oct 2015 01:38:19 +0000 (03:38 +0200)]
C++: Consistently use nullptr instead of NULL

8 years agoC++: Use move() and avoid passing containers by value
Daniel Elstner [Sun, 11 Oct 2015 01:12:02 +0000 (03:12 +0200)]
C++: Use move() and avoid passing containers by value

Make use of std::move() to transfer arguments passed in by value.
Take complex container arguments by const reference, as passing
those by value is rather unorthodox even for C++11 style code.

8 years agotests: Drop another obsolete sr_analog_float_to_string() test.
Uwe Hermann [Sun, 25 Oct 2015 22:05:49 +0000 (23:05 +0100)]
tests: Drop another obsolete sr_analog_float_to_string() test.

8 years agoscpi: Move closing of discovered devices to sr_scpi_scan_resource().
Martin Ling [Sat, 24 Oct 2015 21:27:45 +0000 (22:27 +0100)]
scpi: Move closing of discovered devices to sr_scpi_scan_resource().

8 years agorigol-ds: After successfully finding a device, close it properly.
Martin Ling [Sat, 24 Oct 2015 20:33:34 +0000 (21:33 +0100)]
rigol-ds: After successfully finding a device, close it properly.

8 years agojava: Don't use SWIG attribute mechanism.
Martin Ling [Tue, 20 Oct 2015 23:29:50 +0000 (00:29 +0100)]
java: Don't use SWIG attribute mechanism.

Using the attribute mechanism results in badly named wrappers like
getLog_level(), as well as incompletely applied typemaps for templated
container types. If we just avoid this mechanism entirely, we get the
same foo() and set_foo() accessors as we have in the C++ API.

8 years agojava: Remove overrides for overloaded methods.
Martin Ling [Tue, 20 Oct 2015 23:20:18 +0000 (00:20 +0100)]
java: Remove overrides for overloaded methods.

These are now wrapped correctly without needing this.

8 years agojava: Remove need for conversion methods on container wrappers.
Martin Ling [Tue, 20 Oct 2015 23:18:03 +0000 (00:18 +0100)]
java: Remove need for conversion methods on container wrappers.

8 years agoSWIG: Declare template specialisations for containers before typemaps.
Martin Ling [Tue, 20 Oct 2015 22:14:45 +0000 (23:14 +0100)]
SWIG: Declare template specialisations for containers before typemaps.

It seems this is necessary to correctly apply typemaps involving
these template specialisations.

8 years agoscpi_usbtmc_libusb: remove libusb_clear_halt() hack which is not useful anymore
Aurelien Jacobs [Tue, 22 Sep 2015 22:30:06 +0000 (00:30 +0200)]
scpi_usbtmc_libusb: remove libusb_clear_halt() hack which is not useful anymore

8 years agotransform/scale: Fix g_variant_new() argument.
Uwe Hermann [Sat, 24 Oct 2015 19:36:20 +0000 (21:36 +0200)]
transform/scale: Fix g_variant_new() argument.

8 years agoscpi_usbtmc_libusb: set_configuration only if it is not already set
Aurelien Jacobs [Thu, 24 Sep 2015 19:43:06 +0000 (21:43 +0200)]
scpi_usbtmc_libusb: set_configuration only if it is not already set

This avoids the issues described here:
http://libusb.sourceforge.net/api-1.0/caveats.html#configsel

8 years agoscpi_usbtmc_libusb: add Rigol DS2000 to the RL1 blacklist
Aurelien Jacobs [Tue, 22 Sep 2015 22:24:54 +0000 (00:24 +0200)]
scpi_usbtmc_libusb: add Rigol DS2000 to the RL1 blacklist

The Rigol DS2000 series also give a USB timeout when trying to apply
RL1 lock or unlock.

8 years agoDrop unneeded sr_analog_float_to_string().
Uwe Hermann [Sat, 24 Oct 2015 19:14:50 +0000 (21:14 +0200)]
Drop unneeded sr_analog_float_to_string().

A simple g_strdup_printf() is sufficient, no need for an extra
libsigrok API call here.

8 years agodrivers: Fix behaviour when trying to set an invalid capture ratio.
Tilman Sauerbeck [Thu, 15 Oct 2015 20:38:12 +0000 (22:38 +0200)]
drivers: Fix behaviour when trying to set an invalid capture ratio.

Trying to configure an invalid capture ratio would reset the
previously configured value. Instead, we should just reject the
new value and keep the original one.

8 years agofx2lafw: Drop obsolete macro usage.
Uwe Hermann [Sat, 24 Oct 2015 18:51:13 +0000 (20:51 +0200)]
fx2lafw: Drop obsolete macro usage.

8 years agofx2lafw: Add the official fx2lafw sigrok VID/PID pairs.
Uwe Hermann [Wed, 21 Oct 2015 21:41:50 +0000 (23:41 +0200)]
fx2lafw: Add the official fx2lafw sigrok VID/PID pairs.

As supported by sigrok-firmware-fx2lafw >= 0.1.3:

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

 - 1D50:608D: fx2lafw-sigrok-fx2-16ch.fw

8 years agoanalog.c: Various Doxygen additions and improvements.
Uwe Hermann [Thu, 15 Oct 2015 17:49:57 +0000 (19:49 +0200)]
analog.c: Various Doxygen additions and improvements.

8 years agoanalog.c: Return SR_ERR_ARG upon invalid arguments.
Uwe Hermann [Thu, 15 Oct 2015 17:40:59 +0000 (19:40 +0200)]
analog.c: Return SR_ERR_ARG upon invalid arguments.

(instead of segfaulting)

8 years agosr_analog_float_to_string(): Make 'digits' argument unsigned.
Uwe Hermann [Thu, 15 Oct 2015 17:38:02 +0000 (19:38 +0200)]
sr_analog_float_to_string(): Make 'digits' argument unsigned.

8 years agoAdd a few unit tests for the analog conversion functions.
Uwe Hermann [Thu, 15 Oct 2015 10:13:43 +0000 (12:13 +0200)]
Add a few unit tests for the analog conversion functions.

8 years agobindings: Use SR_DF_ANALOG, drop SR_DF_ANALOG_OLD support.
Uwe Hermann [Fri, 2 Oct 2015 14:18:35 +0000 (16:18 +0200)]
bindings: Use SR_DF_ANALOG, drop SR_DF_ANALOG_OLD support.

All SR_DF_ANALOG_OLD packets are automatically converted to SR_DF_ANALOG
in the session already.

8 years agoSR_DF_ANALOG2 and sr_datafeed_analog2 renames.
Uwe Hermann [Tue, 29 Sep 2015 16:34:55 +0000 (18:34 +0200)]
SR_DF_ANALOG2 and sr_datafeed_analog2 renames.

Rename SR_DF_ANALOG2 to SR_DF_ANALOG, and 'struct sr_datafeed_analog2'
to 'struct sr_datafeed_analog'.

8 years agoSR_DF_ANALOG_OLD and sr_datafeed_analog_old renames.
Uwe Hermann [Tue, 29 Sep 2015 11:55:46 +0000 (13:55 +0200)]
SR_DF_ANALOG_OLD and sr_datafeed_analog_old renames.

Rename SR_DF_ANALOG to SR_DF_ANALOG_OLD, and 'struct sr_datafeed_analog'
to 'struct sr_datafeed_analog_old'.

8 years agosession: Convert from SR_DF_ANALOG to SR_DF_ANALOG2 automatically.
Martin Ling [Wed, 9 Sep 2015 23:34:53 +0000 (00:34 +0100)]
session: Convert from SR_DF_ANALOG to SR_DF_ANALOG2 automatically.

This fixes bus #640.

8 years agooutput/csv: Support SR_DF_ANALOG2.
Martin Ling [Wed, 9 Sep 2015 23:19:23 +0000 (00:19 +0100)]
output/csv: Support SR_DF_ANALOG2.

8 years agooutput/wav: Support SR_DF_ANALOG2.
Martin Ling [Wed, 9 Sep 2015 23:03:18 +0000 (00:03 +0100)]
output/wav: Support SR_DF_ANALOG2.

8 years agotransform/invert: Support SR_DF_ANALOG2.
Martin Ling [Wed, 9 Sep 2015 22:57:18 +0000 (23:57 +0100)]
transform/invert: Support SR_DF_ANALOG2.

8 years agotransform/scale: Support SR_DF_ANALOG2.
Martin Ling [Wed, 9 Sep 2015 22:49:01 +0000 (23:49 +0100)]
transform/scale: Support SR_DF_ANALOG2.

8 years agotransform/scale: Use a rational rather than floating point factor.
Martin Ling [Wed, 9 Sep 2015 22:39:15 +0000 (23:39 +0100)]
transform/scale: Use a rational rather than floating point factor.

8 years agojava: Fix SWIG warnings due to dodgy %extend redefinitions.
Martin Ling [Tue, 20 Oct 2015 20:05:36 +0000 (21:05 +0100)]
java: Fix SWIG warnings due to dodgy %extend redefinitions.

If we're going to %extend these methods, we need to firstly ignore the
originals, and secondly implement all possible argument combinations.

This fixes the rest of bug #417.

8 years agopython: Prevent warning about deprecated NumPy API.
Martin Ling [Tue, 20 Oct 2015 19:38:37 +0000 (20:38 +0100)]
python: Prevent warning about deprecated NumPy API.

Without this we get:

/usr/include/python2.7/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning
"Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API
NPY_1_7_API_VERSION" [-Wcpp]

As far as I'm aware we're not using any deprecated NumPy C API features.

This fixes part of bug #417.

8 years agopython: Fix PyObject_CallMethod() arguments
Daniel Elstner [Sat, 10 Oct 2015 02:45:13 +0000 (04:45 +0200)]
python: Fix PyObject_CallMethod() arguments

Pass nullptr instead of the empty string for format, and remove
the excess varargs argument. Also, avoid NULL in favor of nullptr.

8 years agopython: Wrap session stop callback
Daniel Elstner [Sat, 10 Oct 2015 02:38:54 +0000 (04:38 +0200)]
python: Wrap session stop callback

8 years agosession: Make event source injection API private
Daniel Elstner [Fri, 9 Oct 2015 17:46:14 +0000 (19:46 +0200)]
session: Make event source injection API private

Also remove the corresponding functionality from the bindings.

8 years agoC++: Add bindings for session stop notification
Daniel Elstner [Fri, 9 Oct 2015 17:24:51 +0000 (19:24 +0200)]
C++: Add bindings for session stop notification

8 years agosession: Keep reference to main context while running
Daniel Elstner [Fri, 9 Oct 2015 13:49:12 +0000 (15:49 +0200)]
session: Keep reference to main context while running

8 years agosession: Make sr_session_run() optional
Daniel Elstner [Fri, 9 Oct 2015 00:35:47 +0000 (02:35 +0200)]
session: Make sr_session_run() optional

Introduce a new API function sr_session_stopped_callback_set()
which can be used to receive notification when a session stops
running. This allows applications to integrate libsigrok event
processing with their own main loop, instead of blocking in
sr_session_run().

8 years agoresource: Do not require size to stay valid after close
Daniel Elstner [Thu, 8 Oct 2015 18:51:55 +0000 (20:51 +0200)]
resource: Do not require size to stay valid after close

Chalk one up for uber-correctness, just in case.

8 years agoAdd support for the Tenma 77-7732 multimeter.
Uwe Hermann [Fri, 16 Oct 2015 17:48:13 +0000 (19:48 +0200)]
Add support for the Tenma 77-7732 multimeter.

8 years agoAdd support for the Tenma 77-9380A multimeter.
Uwe Hermann [Fri, 16 Oct 2015 17:38:52 +0000 (19:38 +0200)]
Add support for the Tenma 77-9380A multimeter.

8 years agobuild: Require libzip 0.11
Daniel Elstner [Fri, 16 Oct 2015 18:45:43 +0000 (20:45 +0200)]
build: Require libzip 0.11

This is needed for zip_discard().

8 years agosrzip: Avoid recent-ish zip_file_add()
Daniel Elstner [Fri, 16 Oct 2015 18:35:32 +0000 (20:35 +0200)]
srzip: Avoid recent-ish zip_file_add()

8 years agokorad-kdxxxxp: Use PRIi64 format for int64_t
Daniel Elstner [Fri, 16 Oct 2015 19:28:07 +0000 (21:28 +0200)]
korad-kdxxxxp: Use PRIi64 format for int64_t

8 years agodrivers: Add support for Tenma 72-7730 multimeter
Karl Palsson [Tue, 13 Oct 2015 16:19:24 +0000 (16:19 +0000)]
drivers: Add support for Tenma 72-7730 multimeter

Tested with a 72-7730 device.

Signed-off-by: Karl Palsson <redacted>
8 years agoconfigure.ac: Korad KDxxxxP depends on libserialport.
Uwe Hermann [Tue, 13 Oct 2015 21:26:40 +0000 (23:26 +0200)]
configure.ac: Korad KDxxxxP depends on libserialport.

8 years agoInitial driver for Korad KDxxxxP (Velleman LABPS3005D)
Hannu Vuolasaho [Fri, 25 Sep 2015 14:43:17 +0000 (16:43 +0200)]
Initial driver for Korad KDxxxxP (Velleman LABPS3005D)

With this driver it is possible to set voltage target and current
limit. Also enabling and disabling the output is possible.

Analog output sends read back values from output. If output is
disabled analog outputs 0.00.

In protocol.c there is a g_usleep() call. This gives almost
every time enough time for PSU to parse and process input.

Multichannel devices aren't supported.

8 years agokorad-kdxxxxp: Initial driver skeleton.
Hannu Vuolasaho [Thu, 24 Sep 2015 19:58:38 +0000 (21:58 +0200)]
korad-kdxxxxp: Initial driver skeleton.

8 years agobaylibre-acme: Fix EEPROM fields endianness.
Bartosz Golaszewski [Fri, 9 Oct 2015 13:52:28 +0000 (15:52 +0200)]
baylibre-acme: Fix EEPROM fields endianness.

Use RB32 instead of RL32 since integer types in probe EEPROM are in network
byte order.

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Read EEPROM contents into buffer before processing.
Bartosz Golaszewski [Fri, 25 Sep 2015 21:48:30 +0000 (14:48 -0700)]
baylibre-acme: Read EEPROM contents into buffer before processing.

Instead of using a non-standard packed attribute, read the contents of the
probe EEPROM into a buffer and then process it using the R* macros.

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Use fixed-size integer types in struct probe_eeprom.
Bartosz Golaszewski [Sat, 19 Sep 2015 18:08:26 +0000 (20:08 +0200)]
baylibre-acme: Use fixed-size integer types in struct probe_eeprom.

Standard integer types may differ in size on different targets. Use fixed-size
types instead.

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agoC++: Remove leftover Context::begin_save() method
Daniel Elstner [Sun, 4 Oct 2015 20:11:39 +0000 (22:11 +0200)]
C++: Remove leftover Context::begin_save() method

8 years agobuild: Do not define FIRMWARE_DIR on Windows
Daniel Elstner [Sat, 3 Oct 2015 12:08:32 +0000 (14:08 +0200)]
build: Do not define FIRMWARE_DIR on Windows

The hard-coded location is bound to be wrong anyway. Instead, rely
on the new resource lookup code to find the firmware files in a
location relative to the library or executable.

8 years agoresource: Make definition of FIRMWARE_DIR optional
Daniel Elstner [Sat, 3 Oct 2015 11:58:50 +0000 (13:58 +0200)]
resource: Make definition of FIRMWARE_DIR optional

8 years agosession-file: Use 32-bit int for channel count
Daniel Elstner [Fri, 2 Oct 2015 18:09:46 +0000 (20:09 +0200)]
session-file: Use 32-bit int for channel count

SR_CONF_NUM_LOGIC_CHANNELS is defined as SR_T_INT32. Create the
GVariant with the correct type to avoid a type mismatch error in
sr_variant_type_check().

8 years agousb: Skip add/remove of FD on destroyed source
Daniel Elstner [Thu, 1 Oct 2015 22:36:10 +0000 (00:36 +0200)]
usb: Skip add/remove of FD on destroyed source

This avoids nasty GLib-CRITICALs on Windows with some drivers.

8 years agoC++: Wrap resource access API
Daniel Elstner [Sat, 26 Sep 2015 22:03:21 +0000 (00:03 +0200)]
C++: Wrap resource access API

Introduce a ResourceReader delegate class with virtual methods
corresponding to the C callback functions.

8 years agodrivers: Load firmware via new resource API
Daniel Elstner [Sat, 26 Sep 2015 20:41:05 +0000 (22:41 +0200)]
drivers: Load firmware via new resource API

8 years agoresource: Move sr_file_get_size() to resource.c
Daniel Elstner [Sat, 26 Sep 2015 16:10:28 +0000 (18:10 +0200)]
resource: Move sr_file_get_size() to resource.c

8 years agoresource: New internal API for accessing resource files
Daniel Elstner [Sat, 26 Sep 2015 11:38:30 +0000 (13:38 +0200)]
resource: New internal API for accessing resource files

The resource API provides a generic means for accessing resources
that are bundled with sigrok, such as device firmware files. Since
the manner of resource bundling is platform-dependent, users of
libsigrok may override the functions used to open, close and read
a resource. The default implementation accesses resources as files
located in one of the XDG data directories or a directory defined
at compile time.

8 years agosrzip: Avoid low-level FD-based I/O
Daniel Elstner [Sun, 20 Sep 2015 18:32:03 +0000 (20:32 +0200)]
srzip: Avoid low-level FD-based I/O

Use in-memory buffers instead of temporary files. This avoids
the need for low-level I/O on the FD returned by g_mkstemp().
Refactor the code accordingly. Also plug a number of leaks and
tighten the error checking.

8 years agosession-file: Remove old session save API
Daniel Elstner [Sun, 20 Sep 2015 12:10:42 +0000 (14:10 +0200)]
session-file: Remove old session save API

Completely remove the old session save code that has been
superseded by the srzip output module. Also refactor a bit,
plug a number of leaks and tighten the error checking.

8 years agovirtual-session: Plug ZIP archive leak
Daniel Elstner [Sun, 20 Sep 2015 12:07:01 +0000 (14:07 +0200)]
virtual-session: Plug ZIP archive leak

Refactor a bit to keep the code manageable. Also allow
stopping of a running acquisition.

8 years agovirtual-session: Advertise all config keys
Daniel Elstner [Sun, 20 Sep 2015 12:06:06 +0000 (14:06 +0200)]
virtual-session: Advertise all config keys

8 years agoinput: Use fseeko/ftello to get the size of a file
Daniel Elstner [Sat, 19 Sep 2015 18:43:25 +0000 (20:43 +0200)]
input: Use fseeko/ftello to get the size of a file

Introduce the sr_file_get_size() utility function to retrieve the
size of an open FILE stream. This is based on fseeko() followed by
ftello(), which are POSIX functions but quite portable in practice.
Since these calls operate on FILE streams instead of filenames, the
issue of filename encoding no longer arises.

8 years agoinput: Clean up input file scanning
Daniel Elstner [Fri, 18 Sep 2015 22:24:50 +0000 (00:24 +0200)]
input: Clean up input file scanning

Do not use Unix low-level I/O for reading a regular input file.
Read in the file header once and re-use the buffer for all input
modules participating in the scan. Also re-use a prefilled metadata
table instead of creating it anew for each input module tried.

8 years agodrivers.c: Fix HAVE_HW_GWINSTEK_GDS_800 position.
Uwe Hermann [Wed, 30 Sep 2015 17:42:19 +0000 (19:42 +0200)]
drivers.c: Fix HAVE_HW_GWINSTEK_GDS_800 position.

8 years agogwinstek-gds-800: Initial driver implementation.
Martin Lederhilger [Sun, 16 Aug 2015 17:52:02 +0000 (19:52 +0200)]
gwinstek-gds-800: Initial driver implementation.

8 years agogwinstek-gds-800: Initial driver skeleton.
Martin Lederhilger [Sun, 16 Aug 2015 12:52:49 +0000 (14:52 +0200)]
gwinstek-gds-800: Initial driver skeleton.

8 years agomanson-hcs-3xxx: Fix use-after-free and memory leaks.
Uwe Hermann [Fri, 25 Sep 2015 07:00:05 +0000 (09:00 +0200)]
manson-hcs-3xxx: Fix use-after-free and memory leaks.

Thanks to Hannu Vuolasaho for the report!

8 years agoFix a few "value never read" scan-build warnings.
Uwe Hermann [Fri, 25 Sep 2015 06:52:58 +0000 (08:52 +0200)]
Fix a few "value never read" scan-build warnings.

This fixes parts of bug #423.

The list of fixed warnings:

src/output/srzip.c:285:3: warning: Value stored to 'ret' is never read
                ret = zip_append(o, logic->data, logic->unitsize, logic->length);
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/scpi/scpi.c:610:2: warning: Value stored to 'ret' is never read
        ret = SR_OK;
        ^     ~~~~~
src/scpi/scpi.c:667:2: warning: Value stored to 'ret' is never read
        ret = SR_OK;
        ^     ~~~~~
src/dmm/vc870.c:410:2: warning: Value stored to 'info_local' is never read
        info_local = (struct vc870_info *)info;
        ^            ~~~~~~~~~~~~~~~~~~~~~~~~~
src/hardware/conrad-digi-35-cpu/api.c:130:2: warning: Value stored to 'ret' is never read
        ret = SR_OK;
        ^     ~~~~~
src/hardware/fx2lafw/api.c:658:2: warning: Value stored to 'timeout' is never read
        timeout = fx2lafw_get_timeout(devc);
        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~
src/hardware/gmc-mh-1x-2x/protocol.c:941:3: warning: Value stored to 'retc' is never read
                retc = SR_ERR_ARG;
                ^      ~~~~~~~~~~
src/hardware/gmc-mh-1x-2x/api.c:168:2: warning: Value stored to 'model' is never read
        model = METRAHIT_NONE;
        ^       ~~~~~~~~~~~~~
src/hardware/ikalogic-scanalogic2/api.c:325:2: warning: Value stored to 'ret' is never read
        ret = SR_OK;
        ^     ~~~~~
src/hardware/openbench-logic-sniffer/api.c:185:3: warning: Value stored to 'devc' is never read
                devc = sdi->priv;
                ^      ~~~~~~~~~
src/hardware/rigol-ds/api.c:813:3: warning: Value stored to 'devc' is never read
                devc = sdi->priv;
                ^      ~~~~~~~~~
src/hardware/scpi-pps/api.c:405:2: warning: Value stored to 'ret' is never read
        ret = SR_OK;
        ^     ~~~~~
src/hardware/yokogawa-dlm/api.c:239:2: warning: Value stored to 'ret' is never read
        ret = SR_ERR_NA;
        ^     ~~~~~~~~~

8 years agodemo: Strictly round up the number of samples to send
Daniel Elstner [Tue, 22 Sep 2015 14:12:01 +0000 (16:12 +0200)]
demo: Strictly round up the number of samples to send

This avoids getting stuck when the time limit is less than
half of the sampling interval.

8 years agodemo: Increase timer interval to 100 ms
Daniel Elstner [Tue, 22 Sep 2015 04:54:33 +0000 (06:54 +0200)]
demo: Increase timer interval to 100 ms

Timer intervals shorter than about 100 ms are unnecessarily taxing
on system resources. Also, on systems like Windows the smallest
resolvable time unit without using high precision timers is about
15 ms. Regular timer intervals should be well above that value to
avoid being dominated by noise and round-off.

8 years agodemo: Fix continuous mode and honor time limit
Daniel Elstner [Tue, 22 Sep 2015 04:49:17 +0000 (06:49 +0200)]
demo: Fix continuous mode and honor time limit

Also deal more gracefully with changes to the samplerate while
running.

8 years agoscpi/usbtmc: Add Agilent DSO1000 series to RL1 blacklist.
Bert Vermeulen [Mon, 21 Sep 2015 22:53:28 +0000 (00:53 +0200)]
scpi/usbtmc: Add Agilent DSO1000 series to RL1 blacklist.

These are rebadged Rigol DS1000 scopes, and suffer from the same USBTMC
implementation.

8 years agoscpi/usbtmc: Implement Rigol DS1000 workaround on any firmware version.
Bert Vermeulen [Mon, 21 Sep 2015 11:45:36 +0000 (13:45 +0200)]
scpi/usbtmc: Implement Rigol DS1000 workaround on any firmware version.

Firmware versions starting with 00.02.04 apparently cause the in and out
bulk endpoints to end up in a HALT state. This is likely related to the
larger transfer size quirk implemented in the Linux kernel for the Rigol
DS1000: this USBTMC implementation does not have that workaround.

Instead, if the firmware version is >= 00.02.04, both endpoints have the HALT
condition cleared on device close.

This fixes bug #354.

8 years agoscpi: Pass SCPI device instance to open and close callbacks.
Bert Vermeulen [Mon, 21 Sep 2015 11:41:03 +0000 (13:41 +0200)]
scpi: Pass SCPI device instance to open and close callbacks.

Only close() really needs this (for access to a Rigol firmware quirk),
but do the same in open() for consistency.