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.
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.
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.
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().
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.
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 <bgolaszewski@baylibre.com>
Standard integer types may differ in size on different targets. Use fixed-size
types instead.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
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.
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().
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.
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.