Uwe Hermann [Mon, 26 Jan 2015 14:26:15 +0000 (15:26 +0100)]
cxx: Fix a linking issue.
Fix "undefined reference to `sigrok::EnumValue<sigrok::LogLevel,
sr_loglevel>::_values'", which happens at least when using clang(++),
e.g. on Linux, Mac OS X, or FreeBSD.
This fixes bug #534.
Thanks to Uffe Jakobsen and Martin Ling for reporting and investigating!
Uffe Jakobsen [Thu, 22 Jan 2015 00:11:22 +0000 (01:11 +0100)]
Fix FreeBSD issue with libusb_get_port_numbers()
Currently (as of date 20150122) an ioctl problem within the
FreeBSD kernel is preventing libusb_get_port_numbers() from working.
Hence calls to libusb_get_port_numbers() will always return 0.
This makes it impossible to establish a physical path the the usb device.
This problem has existed "forever" -
meaning that libusb_get_port_numbers() has never worked.
A fix is committed to FreeBSD "current" head -
and will later be merged (MFC'ed) to maintenance branches.
See: https://svnweb.freebsd.org/base?view=revision&revision=277417
Additionally FreeBSD requires that devices prior to calling
libusb_get_port_numbers() have been opened with libusb_open().
The patch is "forwards-compatible".
Currently it acts specificly to libusb_get_port_numbers()
currently returning 0 on FreeBSD.
In these situations it constructs an artificial path to the device.
When FreeBSD kernels appears with proper working ioctl
supporting libusb_get_port_numbers() the code will construct
proper physical paths for newer kernels - while still generating
artificial physical paths for older defective kernels.
Add new config options to libsigrok - 'averaging', which allows to
enable averaging of samples and 'avg_samples' for setting the number
of samples to be averaged over in each cycle.
Uwe Hermann [Sun, 18 Jan 2015 15:02:54 +0000 (16:02 +0100)]
sr_input_new(): Add missing @param comment.
This fixes a Doxygen warning:
src/input/input.c:209: warning: The following parameters of sr_input_new(const struct sr_input_module *imod, GHashTable *options) are not documented:
parameter 'imod'
Uwe Hermann [Sat, 17 Jan 2015 18:53:44 +0000 (19:53 +0100)]
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.
Mathias Katzer [Sun, 11 Jan 2015 00:40:28 +0000 (01:40 +0100)]
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.
Janne Huttunen [Sat, 20 Dec 2014 15:33:24 +0000 (17:33 +0200)]
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.
Janne Huttunen [Sat, 20 Dec 2014 15:32:26 +0000 (17:32 +0200)]
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.
Jiří Pinkava [Sun, 23 Nov 2014 16:38:28 +0000 (17:38 +0100)]
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.
Vincent Palatin [Mon, 10 Nov 2014 16:17:07 +0000 (08:17 -0800)]
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.
Tim Hatch [Sun, 2 Nov 2014 23:29:38 +0000 (15:29 -0800)]
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
Uwe Hermann [Sat, 22 Nov 2014 21:06:02 +0000 (22:06 +0100)]
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.
Uwe Hermann [Fri, 21 Nov 2014 18:02:10 +0000 (19:02 +0100)]
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.
Bert Vermeulen [Tue, 18 Nov 2014 14:51:38 +0000 (15:51 +0100)]
output/analog: Add option to restrict number of decimal digits printed.
This is a feature restricted to the new analog struct.
By default all the digits available in the encoding struct are printed.
The option "digits", when set to "spec", changes this to print the
number given in the spec struct.
Aurelien Jacobs [Thu, 13 Nov 2014 23:50:46 +0000 (00:50 +0100)]
Add a sr_analog_init() API to initialize sr_datafeed_analog2 struct.
It fills the fields with reasonable default values that should suit
most of the drivers. Drivers are obviously free to override the fields
they want after initializing.
Uwe Hermann [Fri, 14 Nov 2014 23:41:10 +0000 (00:41 +0100)]
autogen.sh: Also warn if AX_CXX_COMPILE_STDCXX_11 is not available.
This fixes an error message when the file is not installed at all:
./autogen.sh: 67: [: Illegal number:
Turn the AX_CXX_COMPILE_STDCXX_11 errors into warnings though, since
it is (and should be) possible to build libsigrok (just the C library)
just fine, even without that macro or with an older version of it.