Commit Graph

3528 Commits

Author SHA1 Message Date
Uwe Hermann e0e6aecc20 libsigrok.hpp: Fix incorrect glibmm.h #include.
As per upstream docs "#include <glibmm.h>" is the correct usage,
the "glibmm-2.4" directory is handled correctly via pkg-config:

 $ pkg-config --cflags glibmm-2.4
 -I/usr/include/glibmm-2.4 [...]
2015-01-17 19:59:44 +01:00
Uwe Hermann afba88adb5 libsigrokcxx: Drop Requires.private entry.
libsigrokcxx.pc has a "Requires" field listing "libsigrok" which
will cause libsigrok's "Requires.private" entries to be used/inherited
when 'pkg-config --libs --static libsigrokcxx' is used.
2015-01-17 19:53:44 +01:00
Uwe Hermann 52ff4f6a04 Rename libsigrokxx to the more common libsigrokcxx. 2015-01-17 18:52:43 +01:00
Uwe Hermann f3256bb706 Makefile.am: Use $(MKDIR_P) everywhere. 2015-01-12 01:19:12 +01:00
Mathias Katzer 3b95bd9152 scpi: Fix incomplete data issue for e.g. Hameg HMO1024.
On a Hameg HMO1024 you get incomplete data because the USB transfer takes
longer than the scpi->read_timeout_ms of 1 second that is defined in
scpi_dev_inst_new(). Therefore reset the timeout in sr_scpi_get_string()
whenever the device sends a partial response.
2015-01-11 01:43:13 +01:00
Mathias Katzer f62f595bfc hameg-hmo: Fix double-free issue. 2015-01-11 01:43:12 +01:00
Mathias Katzer a1b61e6e04 hameg-hmo: Set SR_CONF_GET | SR_CONF_SET for frame limit.
Reading analog data from an HMO1024 (Firmware 04.527) failed because the
frame limit could not be set.
2015-01-11 01:43:12 +01:00
Jiří Pinkava 6ae5362589 Python bindings: respect DESTDIR.
Thanks Aurelien Jacobs <aurel@gnuage.org> for a suggested
fix/improvement.
2015-01-09 16:17:36 +01:00
Janne Huttunen 787ec9dbd9 Limit frames instead of samples.
Since every individual measurement is represented by a single frame
and a "sample" isn't all that meaningful concept in this context,
it makes more sense to define possible limit in number of frames.
Make the es51919 driver to support setting a frame limit instead of
a sample limit.
2015-01-06 20:10:17 +01:00
Janne Huttunen a6413fa58e Use frames to group a single measurement result together.
In most, but not all, modes the ES51919 reports two separate
analog values for each measurement sample. These values are
mapped to two separate channels and sent in two separate
packets.

A client program needs a way to determine which results are
parts of the same measurement and also know when a complete
measurement is received so it can process the sample. Use
the frame begin and end packets to separate groups that each
represent a single complete measurement.
2015-01-06 20:10:17 +01:00
Janne Huttunen bb983c666a Fix the channel indexes of the es51919 driver.
Set the channel indexes to unique values instead of setting
them all zero.
2015-01-06 20:10:17 +01:00
Rene Hopf 3e2f04cf26 fix autogen.sh on OS X. This fixes bug #516. 2015-01-06 19:38:42 +01:00
Uffe Jakobsen 15eea61a47 Fix compile error on FreeBSD 2015-01-05 22:16:48 +01:00
Uwe Hermann b1a7ca3b60 serial.c: Cosmetics/consistency/documentation fixes. 2015-01-03 18:03:50 +01:00
Aurelien Jacobs 24287ea9e3 Add a public API to list available serial ports. 2015-01-03 17:51:51 +01:00
Uwe Hermann 3fc66eda9f Mention the Building#FAQ wiki page for common issues. 2015-01-03 17:38:06 +01:00
Jiří Pinkava cd5623ca86 fix numpy include path 2014-12-29 23:34:42 +01:00
Uwe Hermann e26f5af359 README: Require SWIG >= 2.0.0.
We use %shared_ptr for example, which was introduced in SWIG 2.0.0.
2014-12-06 22:27:47 +01:00
Aurelien Jacobs 5e1b68c6e7 Only save enabled channels to a session file.
This reverts bc96d5f08f which is not
needed anymore since we have a better fix for #410 and #495.
2014-12-05 01:14:22 +01:00
Aurelien Jacobs a160a0c344 session_file: Enable only the probes that are actually listed in metadata.
This is a better fix for #410 and #495.
2014-12-05 01:14:22 +01:00
Uwe Hermann 0d6478d7aa README: Improve and update the requirements list. 2014-12-03 15:10:02 +01:00
Bert Vermeulen 974fb0fffa saleae-logic16: Show libusb transfer status name instead of code. 2014-11-28 00:21:56 +01:00
Uwe Hermann a11e10ec91 saleae-logic16: Change two errors into warnings.
Related to #466, convert two more sanity checks from errors into warnings.
This may allow more devices to work with libsigrok.
2014-11-27 23:22:05 +01:00
Bert Vermeulen 5cfcab6603 saleae-logic16: Clearer error message. 2014-11-27 01:01:13 +01:00
Aurelien Jacobs e743a47d6d beaglelogic: Add SR_CONF_CAPTURE_RATIO support. 2014-11-25 22:13:36 +01:00
Aurelien Jacobs 5a971f66a3 saleae-logic16: Add SR_CONF_CAPTURE_RATIO support. 2014-11-25 22:13:36 +01:00
Aurelien Jacobs 7bfcb25cf1 fx2lafw: Add SR_CONF_CAPTURE_RATIO support. 2014-11-25 16:56:34 +01:00
Aurelien Jacobs fe5a735553 soft-trigger: Add support for pre-triggering. 2014-11-25 16:56:34 +01:00
Bert Vermeulen bc96d5f08f Always save all channels to a session file.
This works around limitations of the current API that screw up saving
only enabled channels. See bug 410. And bug 495.
2014-11-24 02:21:52 +01:00
Uwe Hermann e835e8080b bindings: Session::set_trigger(): Fix segfault condition.
sr_session_trigger_set(sess, NULL) is a valid thing to do, meaning that
any trigger shall be removed from the session.

This closes bugs #491 and #496.
2014-11-24 01:11:17 +01:00
Uwe Hermann 9f42e2e6be sr_session_trigger_{get,set}: Document, add error checks. 2014-11-24 00:50:11 +01:00
Uwe Hermann c8965e5459 Add a few unit tests for sr_session_trigger_{get,set}. 2014-11-24 00:49:38 +01:00
Uwe Hermann b6085eb179 manson-hcs-3xxx: Fix incorrect SR_CONF_SCAN_OPTIONS handling.
The SR_CONF_SCAN_OPTIONS key must be listable with or without sdi,
otherwise the device will not be detected by frontends.
2014-11-23 21:13:16 +01:00
Jiří Pinkava 84b448ee06 Do not check for JDK headers if Java bindings are disabled.
This removes an unnecessary build dependency on JDK and fixes
build troubles on systems where javac is present but JDK is not
installed and Java bindings are disabled by ./configure --disable-java.
2014-11-23 17:58:21 +01:00
Vincent Palatin 2f004b4bc1 usb_get_port_path(): fix libusb error checking
When libusb cannot access a device, libusb_get_port_numbers() will return
an error. Check the return code rather than doing invalid pointer
operations (out-of-bound read).

Avoid segfaults at sigrok-cli startup on my setup where some USB devices are
not accessible and also make Valgrind happier.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
2014-11-23 17:58:21 +01:00
Bert Vermeulen 68ac991dba Publish config key capabilities on session driver. 2014-11-23 17:48:29 +01:00
Bert Vermeulen 90cefe0cc7 Add sr_rational_set() convenience function. 2014-11-23 17:48:29 +01:00
Tim Hatch cd3c4df35a saleae-logic16: Downgrade error during capture to a message.
Some clone doesn't set this to the exact same value, and both bits in 0x48 are
marked as unknown at
http://sigrok.org/wiki/Saleae_Logic16/Firmware#FPGA_variables

This fixes bug #466.
2014-11-23 13:47:45 +01:00
Uwe Hermann 372c041bd8 unit tests: Disable timeout for one of the test cases.
This one can take a while, thus disable the timeout.
2014-11-23 13:10:32 +01:00
Uwe Hermann 5fcc5909cc python: Silence some warnings via -Wno-uninitialized.
Silence some warnings when building the Python bindings:

  sigrok/core/classes_wrap.cpp: In function ‘PyObject* _wrap_new_OutputFormatMap(PyObject*, PyObject*)’:
  sigrok/core/classes_wrap.cpp:5232:4: warning: ‘argv[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<map_type>(),0);
      ^
  sigrok/core/classes_wrap.cpp:14383:13: note: ‘argv[0]’ was declared here
     PyObject *argv[2];
               ^
  sigrok/core/classes_wrap.cpp: In function ‘PyObject* _wrap_new_ChannelGroupMap(PyObject*, PyObject*)’:
  sigrok/core/classes_wrap.cpp:5232:4: warning: ‘argv[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<map_type>(),0);
      ^
  sigrok/core/classes_wrap.cpp:23356:13: note: ‘argv[0]’ was declared here
     PyObject *argv[2];
               ^

We add -Wno-uninitialized since the warnings are harmless and we really
don't care about them in the generated classes_wrap.cpp.

This fixes parts of #417.
2014-11-22 22:06:02 +01:00
Uwe Hermann 47af616fd7 Fix a bug causing one of the unit tests not being run. 2014-11-22 21:07:48 +01:00
Uwe Hermann cc8be68f22 trigger: Add some more error handling.
All of these error conditions are checked via the unit tests.

Also, add the following missing entries (analog trigger types):

 - SR_TRIGGER_RISING
 - SR_TRIGGER_EDGE
2014-11-22 21:03:39 +01:00
Uwe Hermann c8412d6c69 Add a few unit tests for sr_trigger_*(). 2014-11-22 21:03:13 +01:00
Uwe Hermann a445f8aa08 trigger: Add API documentation. 2014-11-22 19:32:28 +01:00
Uwe Hermann 54ab1dcdc4 Add missing entries to sr_config_info_data[].
Newly added keys:

 - SR_CONF_SAMPLE_INTERVAL
 - SR_CONF_NUM_TIMEBASE
 - SR_CONF_NUM_VDIV
 - SR_CONF_CENTER_FREQUENCY
 - SR_CONF_DEVICE_MODE
 - SR_CONF_SCAN_OPTIONS
 - SR_CONF_DEVICE_OPTIONS
 - SR_CONF_DEVICE_MODE
 - SR_CONF_TEST_MODE

Also, keep the same ordering and grouping as in libsigrok.h.
2014-11-22 17:02:57 +01:00
Uwe Hermann 91219afc75 Use g_malloc0() consistently, simplify error handling.
Use g_malloc0() for small allocations and assume they always
succeed. Simplify error handling in a few places accordingly.

Don't always sanity-check parameters for non-public (SR_PRIV)
functions, we require the developers to invoke them correctly.
This allows further error handling simplifications.
2014-11-22 17:02:57 +01:00
Uwe Hermann c368e6f3d2 Don't check sr_channel_new() return value (always succeeds).
We now use g_malloc0() for the allocation and assume the allocation
will always succeed, thus sr_channel_new() will always return a
valid new channel.
2014-11-21 12:10:05 +01:00
Uwe Hermann f57d8ffe66 Consistently use g_malloc0() for allocating devc.
We assume the allocation will always succeed, hence no need for
checking the returned value.
2014-11-21 12:09:01 +01:00
Uwe Hermann aac29cc192 Eliminate sr_dev_inst_new(). 2014-11-21 02:01:36 +01:00
Bert Vermeulen a9b2283fd0 Fix invalid pointer dereference. 2014-11-20 03:08:55 +01:00