Commit Graph

3136 Commits

Author SHA1 Message Date
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
Aurelien Jacobs cf0280fa1b yokogawa-dlm: Publish driver options. 2014-11-19 23:54:01 +01:00
Aurelien Jacobs 413f1944d1 motech-lps-30x: Publish driver options. 2014-11-19 23:53:35 +01:00
Aurelien Jacobs f3ba3c119c manson-hcs-3xxx: Publish driver options. 2014-11-19 23:53:10 +01:00
Aurelien Jacobs 6ec3ef9b92 hameg-hmo: Publish driver options. 2014-11-19 23:52:51 +01:00
Aurelien Jacobs 8a58419d37 Finish fixing broken sr_config_list() logic. 2014-11-19 17:34:19 +01:00
Martin Ling a24da9a813 Make sr_analog_*_to_string() functions allocate the necessary buffers. 2014-11-19 17:34:19 +01:00
Uwe Hermann e07edc83d6 mic-985xx: Correctly report SR_CONF_THERMOMETER/_HYGROMETER.
Some models only log temperature, others log temperature and humidity
(so they need different drvopts).
2014-11-18 23:43:38 +01:00
Uwe Hermann 20a7cd07c9 mic-985xx: Drop unneeded #define. 2014-11-18 23:26:10 +01:00
Uwe Hermann d6e1e6c4e1 mic-985xx: Publish driver options. 2014-11-18 23:26:10 +01:00
Uwe Hermann 489c338884 center-3xx: Drop unneeded #define. 2014-11-18 23:20:09 +01:00
Uwe Hermann 6685e9a6b3 center-3xx: Publish driver options. 2014-11-18 23:20:09 +01:00
Bert Vermeulen 5c868fef43 Revert "victor-dmm: Set spec digits to 3, matching the display."
This reverts commit 28b4243493.
2014-11-18 18:10:19 +01:00
Bert Vermeulen 63ea6141b6 ols: Publish driver options. 2014-11-18 17:41:36 +01:00
Bert Vermeulen f9dada0b60 agilent-dmm: Now really fix driver options. 2014-11-18 17:31:58 +01:00
Bert Vermeulen 42a47a9a4b appa-55ii: Publish driver options. 2014-11-18 16:50:47 +01:00
Bert Vermeulen 5ecd9049e5 hantek-dso: Fix driver options. 2014-11-18 16:46:39 +01:00
Bert Vermeulen 1f889afd61 atten-pps3xxx: Fix driver options. 2014-11-18 16:44:58 +01:00
Bert Vermeulen 023c73ae05 cem-dt-885x: Fix driver options. 2014-11-18 16:44:14 +01:00
Bert Vermeulen 9d9cf1c4b9 scpi-pps: Fix driver options. 2014-11-18 16:44:14 +01:00
Bert Vermeulen 2ff11e50a5 asix-sigma: Fix driver options. 2014-11-18 16:30:47 +01:00
Bert Vermeulen 820c48f8c2 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.
2014-11-18 15:51:38 +01:00
Bert Vermeulen db6fa867a4 Add debug spew to all sr_config_(get|set|list) calls. 2014-11-18 15:46:59 +01:00
Bert Vermeulen cf3db38193 Fix broken sr_config_list() logic. 2014-11-18 15:46:24 +01:00
Bert Vermeulen 1e4a7cace2 demo: Fix driver options. 2014-11-18 15:39:46 +01:00
Bert Vermeulen ff6b76a145 fx2lafw: Publish driver options. 2014-11-18 15:35:30 +01:00
Bert Vermeulen ce4bd05256 agilent-dmm: Publish driver options. 2014-11-18 15:34:52 +01:00
Bert Vermeulen 5533392828 victor-dmm: Publish driver options. 2014-11-18 14:34:02 +01:00
Bert Vermeulen a5892391b0 Add analog helper sr_analog_unit_to_string(). 2014-11-18 01:16:27 +01:00
Bert Vermeulen c2a25ebb8f Add analog helper sr_analog_float_to_string(). 2014-11-18 01:15:41 +01:00
Bert Vermeulen 1954dfa963 Show SR_DF_ANALOG2 packets in debug output. 2014-11-18 00:24:37 +01:00
Bert Vermeulen 28b4243493 victor-dmm: Set spec digits to 3, matching the display. 2014-11-18 00:24:08 +01:00
Bert Vermeulen 4b4fdeea94 analog: Fix analog_to_float typos, and cleanup.
This was adding 1 to every measurement being converted.
2014-11-17 23:08:49 +01:00
Aurelien Jacobs 41caa31909 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.
2014-11-17 22:04:24 +01:00
Aurelien Jacobs 62f155f0c7 demo: Fix analog output at low samplerate. 2014-11-17 13:39:53 +01:00
Aurelien Jacobs 3772c04990 demo: Fix square pattern output shorter than other patterns. 2014-11-17 13:39:53 +01:00
Bert Vermeulen c6dde8125a Check driver capabilities before sr_config_get/set/list. 2014-11-17 13:20:32 +01:00
Uwe Hermann baa0c2ae67 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.
2014-11-15 01:07:12 +01:00
Jens Steinhauser ff50ad701e Check the version of the AX_CXX_COMPILE_STDCXX_11 macro. 2014-11-14 20:53:02 +01:00
Bert Vermeulen adfba7368a Refactor scan options check. 2014-11-14 20:25:12 +01:00
Uwe Hermann b8721d7cf0 bindings: Fix out-of-tree build.
This closes #473.
2014-11-14 20:01:12 +01:00
Uwe Hermann b71356d631 bindings: Re-enable Java, but ignore create_analog_packet().
This will need some fixing.
2014-11-14 16:58:38 +01:00
Bert Vermeulen 071151b578 sr_driver_scan: Enforce options passed in by client. 2014-11-14 12:22:54 +01:00