Commit Graph

3508 Commits

Author SHA1 Message Date
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
Hannu Vuolasaho d708304275 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.
2015-10-13 23:18:49 +02:00
Hannu Vuolasaho e75ee7de25 korad-kdxxxxp: Initial driver skeleton. 2015-10-13 23:15:33 +02:00
Bartosz Golaszewski a7da85f529 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 <bgolaszewski@baylibre.com>
2015-10-09 15:52:28 +02:00
Bartosz Golaszewski 4c3a4bca32 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 <bgolaszewski@baylibre.com>
2015-10-09 14:55:14 +02:00
Bartosz Golaszewski 453a0c2ece 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 <bgolaszewski@baylibre.com>
2015-10-09 14:55:14 +02:00
Daniel Elstner 7f4d69305b C++: Remove leftover Context::begin_save() method 2015-10-04 22:11:39 +02:00
Daniel Elstner 655b116cc1 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.
2015-10-03 14:08:32 +02:00
Daniel Elstner 127c9cec82 resource: Make definition of FIRMWARE_DIR optional 2015-10-03 13:58:50 +02:00
Daniel Elstner 2c38a41a60 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().
2015-10-02 20:09:46 +02:00
Daniel Elstner 5eff221e8c usb: Skip add/remove of FD on destroyed source
This avoids nasty GLib-CRITICALs on Windows with some drivers.
2015-10-02 01:13:16 +02:00
Daniel Elstner e2eaf8580a C++: Wrap resource access API
Introduce a ResourceReader delegate class with virtual methods
corresponding to the C callback functions.
2015-10-01 15:44:55 +02:00
Daniel Elstner 8e2d6c9db7 drivers: Load firmware via new resource API 2015-10-01 15:44:55 +02:00
Daniel Elstner 7d89fd60e5 resource: Move sr_file_get_size() to resource.c 2015-10-01 15:44:55 +02:00
Daniel Elstner bee246665b 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.
2015-10-01 15:44:55 +02:00
Daniel Elstner 98654c99da 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.
2015-10-01 15:44:55 +02:00
Daniel Elstner 5e1fb33469 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.
2015-10-01 15:44:55 +02:00
Daniel Elstner 8d4097ffa6 virtual-session: Plug ZIP archive leak
Refactor a bit to keep the code manageable. Also allow
stopping of a running acquisition.
2015-10-01 15:44:55 +02:00
Daniel Elstner 02e49ae5d2 virtual-session: Advertise all config keys 2015-10-01 15:44:55 +02:00
Daniel Elstner 4619fab47a 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.
2015-10-01 15:44:55 +02:00
Daniel Elstner 5e364d4fe0 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.
2015-10-01 15:44:55 +02:00
Uwe Hermann ff85d65ec6 drivers.c: Fix HAVE_HW_GWINSTEK_GDS_800 position. 2015-09-30 19:54:58 +02:00
Martin Lederhilger b11afbb142 gwinstek-gds-800: Initial driver implementation. 2015-09-30 19:54:58 +02:00
Martin Lederhilger 7c198f968b gwinstek-gds-800: Initial driver skeleton. 2015-09-30 19:22:27 +02:00
Uwe Hermann 6e799d0799 manson-hcs-3xxx: Fix use-after-free and memory leaks.
Thanks to Hannu Vuolasaho for the report!
2015-09-25 12:19:08 +02:00
Uwe Hermann e57057aee7 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;
        ^     ~~~~~~~~~
2015-09-25 12:02:42 +02:00