Commit Graph

3633 Commits

Author SHA1 Message Date
Daniel Elstner 15914cdb0f C++: Use noexcept instead of throw()
Runtime-checked exception specifications via throw() are
deprecated in C++11.
2015-10-26 06:45:56 +01:00
Daniel Elstner c6e18e007a 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.
2015-10-26 06:45:56 +01:00
Daniel Elstner 6c11b49607 C++: Make most constructors explicit
Unless implicit conversion is desired, constructors that can be
called with one argument should be marked as "explicit".
2015-10-26 06:45:56 +01:00
Daniel Elstner ce3e1e6132 C++: Do not use C-style casts
Never ever.
2015-10-26 06:45:56 +01:00
Daniel Elstner 58e21229dd C++: Consistently use nullptr instead of NULL 2015-10-26 04:06:12 +01:00
Daniel Elstner d370545d60 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.
2015-10-26 04:06:12 +01:00
Uwe Hermann 211cc97471 tests: Drop another obsolete sr_analog_float_to_string() test. 2015-10-25 23:05:49 +01:00
Martin Ling a00106b7f8 scpi: Move closing of discovered devices to sr_scpi_scan_resource(). 2015-10-25 22:40:35 +01:00
Martin Ling b7b873cea3 rigol-ds: After successfully finding a device, close it properly. 2015-10-24 22:50:37 +02:00
Martin Ling d0fa4ac1e7 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.
2015-10-24 22:12:41 +02:00
Martin Ling d4db558810 java: Remove overrides for overloaded methods.
These are now wrapped correctly without needing this.
2015-10-24 22:12:41 +02:00
Martin Ling f3095e7e2e java: Remove need for conversion methods on container wrappers. 2015-10-24 22:12:41 +02:00
Martin Ling c7855def61 SWIG: Declare template specialisations for containers before typemaps.
It seems this is necessary to correctly apply typemaps involving
these template specialisations.
2015-10-24 22:12:41 +02:00
Aurelien Jacobs 7977054d61 scpi_usbtmc_libusb: remove libusb_clear_halt() hack which is not useful anymore 2015-10-24 22:11:38 +02:00
Uwe Hermann a73665a3fa transform/scale: Fix g_variant_new() argument. 2015-10-24 21:44:20 +02:00
Aurelien Jacobs 938bdc25b7 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
2015-10-24 21:32:13 +02:00
Aurelien Jacobs e40e9ca28d 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.
2015-10-24 21:32:13 +02:00
Uwe Hermann 222fdfd526 Drop unneeded sr_analog_float_to_string().
A simple g_strdup_printf() is sufficient, no need for an extra
libsigrok API call here.
2015-10-24 21:21:50 +02:00
Tilman Sauerbeck a5c38703ee 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.
2015-10-24 21:10:29 +02:00
Uwe Hermann 087c4d59c0 fx2lafw: Drop obsolete macro usage. 2015-10-24 20:55:40 +02:00
Uwe Hermann 3e91de2bd6 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
2015-10-22 19:19:40 +02:00
Uwe Hermann 22fb1bffc3 analog.c: Various Doxygen additions and improvements. 2015-10-21 00:29:29 +02:00
Uwe Hermann 5cee3d08e4 analog.c: Return SR_ERR_ARG upon invalid arguments.
(instead of segfaulting)
2015-10-21 00:29:29 +02:00
Uwe Hermann 8ea0c90268 sr_analog_float_to_string(): Make 'digits' argument unsigned. 2015-10-21 00:29:29 +02:00
Uwe Hermann 6b71bf1ba0 Add a few unit tests for the analog conversion functions. 2015-10-21 00:29:29 +02:00
Uwe Hermann dd13d47a9e 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.
2015-10-21 00:29:29 +02:00
Uwe Hermann edb691fced 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'.
2015-10-20 23:32:45 +02:00
Uwe Hermann 5faebab290 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'.
2015-10-20 23:32:45 +02:00
Martin Ling ca79993bba session: Convert from SR_DF_ANALOG to SR_DF_ANALOG2 automatically.
This fixes bus #640.
2015-10-20 23:32:45 +02:00
Martin Ling 453629c137 output/csv: Support SR_DF_ANALOG2. 2015-10-20 23:32:45 +02:00
Martin Ling b73cac758e output/wav: Support SR_DF_ANALOG2. 2015-10-20 23:32:45 +02:00
Martin Ling 0662a7d083 transform/invert: Support SR_DF_ANALOG2. 2015-10-20 23:32:45 +02:00
Martin Ling b1aa4f34bc transform/scale: Support SR_DF_ANALOG2. 2015-10-20 23:32:45 +02:00
Martin Ling 2d237f3ce8 transform/scale: Use a rational rather than floating point factor. 2015-10-20 23:32:45 +02:00
Martin Ling 85aa1b599f 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.
2015-10-20 21:12:29 +01:00
Martin Ling e66728886f 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.
2015-10-20 21:12:29 +01:00
Daniel Elstner fa72105fe6 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.
2015-10-17 17:40:42 +02:00
Daniel Elstner 2c3c9b999c python: Wrap session stop callback 2015-10-17 17:40:42 +02:00
Daniel Elstner ee9953ef12 session: Make event source injection API private
Also remove the corresponding functionality from the bindings.
2015-10-17 17:40:42 +02:00
Daniel Elstner f91cf612df C++: Add bindings for session stop notification 2015-10-17 17:40:42 +02:00
Daniel Elstner 2e5e3df4e4 session: Keep reference to main context while running 2015-10-17 17:40:42 +02:00
Daniel Elstner 5de0fc55a6 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().
2015-10-17 17:40:42 +02:00
Daniel Elstner 45d835edc7 resource: Do not require size to stay valid after close
Chalk one up for uber-correctness, just in case.
2015-10-17 17:40:42 +02:00
Uwe Hermann 0a4549ff18 Add support for the Tenma 77-7732 multimeter. 2015-10-17 00:11:32 +02:00
Uwe Hermann 20f9f1fbaa Add support for the Tenma 77-9380A multimeter. 2015-10-17 00:11:32 +02:00
Daniel Elstner 896fc9c723 build: Require libzip 0.11
This is needed for zip_discard().
2015-10-17 00:07:57 +02:00
Daniel Elstner eaa6a7a3e8 srzip: Avoid recent-ish zip_file_add() 2015-10-16 21:29:28 +02:00
Daniel Elstner ef2bcf114f korad-kdxxxxp: Use PRIi64 format for int64_t 2015-10-16 21:28:07 +02:00
Karl Palsson b1cadcfbef drivers: Add support for Tenma 72-7730 multimeter
Tested with a 72-7730 device.

Signed-off-by: Karl Palsson <karlp@remake.is>
2015-10-14 17:00:30 +02:00
Uwe Hermann 739a1ec4f8 configure.ac: Korad KDxxxxP depends on libserialport. 2015-10-13 23:26:40 +02:00