Commit Graph

134 Commits

Author SHA1 Message Date
Frank Stettner 79034d4f39 strutil: Locale independent snprintf() and vsnprintf() functions 2018-02-11 23:15:39 +01:00
Uwe Hermann 31bdc10ec2 Add SR_CONF_POWERMETER. 2017-07-19 15:40:41 +02:00
Soeren Apel 6ad2fbaad2 Introduce A2L methods
The memory allocation for sr_datafeed_logic is broken, the memory
will never be freed. #994 is used to handle this issue.
2017-07-06 00:16:24 +02:00
Uwe Hermann 42be2adb5a Add APIs to query libsigrok build information. 2017-05-26 18:00:58 +02:00
Gerhard Sittig fe3004f5a0 minor nit, fixup whitespace in libsigrok.h 2017-05-05 18:25:10 +02:00
Soeren Apel 6984cfb245 Rework sr_period_string 2017-03-07 17:13:46 +01:00
Uwe Hermann 6928c4a928 Add SR_CONF_SIGNAL_GENERATOR. 2017-03-02 15:17:53 +01:00
Aurelien Jacobs 841aadc95b libsigrok.h: Add SR_MQ_HARMONIC_RATIO. 2017-01-22 19:03:29 +01:00
Aurelien Jacobs 5728718b66 analog: use SI prefix only with units that accept SI prefixes 2016-10-17 02:24:53 +02:00
Aurelien Jacobs cdc311957b analog: use correct unit for dBm/dBV 2016-10-17 02:09:18 +02:00
Aurelien Jacobs 962172e495 analog: improve output readability by using SI prefix 2016-08-29 00:25:19 +02:00
Aurelien Jacobs 96117c5660 document encoding.digits and spec.spec_digits 2016-08-23 12:58:06 +02:00
Aurelien Jacobs 28c95cc6c4 analog: add support for negative number of digits
When a meter display 105.2 kΩ, libsigrok will return 105200 Ω
but it is really valuable to know that the last 2 digits are not
significant, so encoding.digits should be set to -2.
This would allow a sigrok client to display 105200 as 105.2 k
instead of 105.200 k.
2016-06-26 20:32:56 +02:00
Aurelien Jacobs 9ea62f2e0a rigol-ds: add support for getting/setting trigger level. 2016-06-25 18:19:47 +02:00
Uwe Hermann 24f4a9d50b session: Drop SR_DF_ANALOG_OLD support completely.
This closes bug #728.
2016-06-17 15:13:12 +02:00
Stefan Brüns 17d5a11c69 analog: Implement division for sr_rational 2016-05-16 23:35:10 +02:00
Stefan Brüns ee1b6054d6 analog: Implement multiplication for sr_rational 2016-05-16 23:35:10 +02:00
Stefan Brüns bdba362695 analog: Add equality check for sr_rational 2016-05-16 23:35:10 +02:00
Stefan Brüns 5ec172d7e9 strutil: add method to get an sr_rational from a string
The method accepts strings with numbers in scientific or normal notation,
e.g. -1.25 or 3.37e-6. The numeric range is limited by the sr_rational
range, i.e +-9.2e18, resolution is ~19 digits.
2016-05-16 23:35:10 +02:00
Soeren Apel b6b4f03e40 Input: Add reset() function 2016-05-09 13:02:29 +02:00
Uwe Hermann 695dc859c1 dev_acquisition_{start,stop}(): Drop duplicate 'cb_data' parameter.
These are always 'sdi', which is passed in already.
2016-04-29 19:20:53 +02:00
Alexandru Gagniuc 6d5cd3bd38 analog: Add MQ Flag for four-wire measurements
On the high-end bench multimeters, resistance can be measured with a
kelvin connection as well as the more common two wire method. Provide
a flag which can indicate if four-wire mode is used.
2016-04-23 17:44:26 +02:00
Alexandru Gagniuc fadb19ac96 hwdriver: Add configuration key for number of powerline cycles
High precision multimeters have a special setting, called "number of
powerline cycles" (NPLC) which determines the integration time of the
ADC in terms of the power line period. Some devices need their NPLC
adjusted from the default value before they can measure at their full
rated precision.
2016-03-30 12:39:25 +02:00
Uwe Hermann 2fe1011f1d Add SR_CONF_UNDER_VOLTAGE_CONDITION* config keys.
Add two new config keys:

 - SR_CONF_UNDER_VOLTAGE_CONDITION

 - SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE
2016-02-11 14:42:50 +01:00
Daniel Elstner 32ba0d8005 resource: Replace ssize_t with gssize to avoid unistd.h 2016-01-04 20:53:30 +01:00
Uwe Hermann f014a8fd4c proto.h: Add missing unistd.h #include.
The ssize_t and size_t usage requires the unistd.h #include.

Thanks to Daniel Glöckner for the bug report.

This fixes bug #721.
2016-01-03 03:00:45 +01:00
Uwe Hermann 8141a0325c Rename sr_driver_scan_options() to sr_driver_scan_options_list(). 2015-12-31 19:04:34 +01:00
Uwe Hermann 0c697a4b33 Rename sr_dev_config_capabilities() to sr_dev_config_capabilities_list(). 2015-12-31 19:04:28 +01:00
Uwe Hermann 7d7fd93c94 Restore number "categories" in sr_configkey. 2015-12-31 19:00:16 +01:00
Martin Ling e318f01b2f Make SR_CONF_MASK an internal constant. 2015-12-31 19:00:16 +01:00
Martin Ling cffdc3e63b Make SR_CONF_{SCAN,DEVICE}_OPTIONS into internal constants.
These are no longer needed in the public API as we have new wrapper functions.
They are still used internally by drivers.
2015-12-31 19:00:16 +01:00
Martin Ling 8f3168b89b Add new sr_driver_scan_options() helper function.
This function replaces the pattern of calling config_list() with
SR_CONF_SCAN_OPTIONS to obtain a list of scan options.
2015-12-31 19:00:16 +01:00
Martin Ling e7136c626f Add new sr_dev_options() helper function.
This function replaces the pattern of calling config_list() with
SR_CONF_DEVICE_OPTIONS to obtain a list of device options. Note
that this does not include the SR_CONF_{GET,SET,LIST} bitmask,
which is now retrieved for a specific key by calling
sr_dev_config_capabilties().
2015-12-31 19:00:16 +01:00
Martin Ling 71e9c54dab Add new sr_dev_config_capabilities() helper function. 2015-12-31 19:00:15 +01:00
Martin Ling c57aa1ac19 Make SR_CONF_{GET,SET,LIST} into a new enum. 2015-12-31 18:27:56 +01:00
Stefan Brüns fe7b8efc6b session: fix use after free of session->devs as reported by valgrind
==7478== Invalid write of size 8
==7478==    at 0x4E59182: sr_session_dev_remove_all (session.c:302)
==7478==    by 0x4E591CD: sr_session_destroy (session.c:265)
==7478==    by 0x4095D9: load_input_file_module (input.c:143)
==7478==    by 0x4097AB: load_input_file (input.c:157)
==7478==    by 0x40531E: main (main.c:288)
==7478==  Address 0x7877eb8 is 88 bytes inside a block of size 96 free'd
==7478==    at 0x4C2A37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7478==    by 0x4E5F454: sr_input_free (input.c:573)
==7478==    by 0x4095C3: load_input_file_module (input.c:140)
==7478==    by 0x4097AB: load_input_file (input.c:157)
==7478==    by 0x40531E: main (main.c:288)
2015-11-29 01:13:58 +01:00
Uwe Hermann 2c24077466 Constify a lot more items.
This fixes various compiler warnings when -Wdiscarded-qualifiers is used.
2015-11-08 19:11:25 +01:00
Tilman Sauerbeck e5ef649be3 Constify sr_dev_driver::name and sr_dev_driver::long_name.
This fixes a bunch of warnings when compiling with -Wwrite-strings.
2015-11-06 17:55:55 +01:00
Uwe Hermann 222fdfd526 Drop unneeded sr_analog_float_to_string().
A simple g_strdup_printf() is sufficient, no need for an extra
libsigrok API call here.
2015-10-24 21:21:50 +02:00
Uwe Hermann 8ea0c90268 sr_analog_float_to_string(): Make 'digits' argument unsigned. 2015-10-21 00:29:29 +02:00
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
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 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 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 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
Martin Ling 53e5d3d14d sr_rational_set: Accept signed numerator. 2015-09-21 00:32:26 +02:00
Martin Ling 18ea6b76fd sr_rational: Make numerator signed. 2015-09-21 00:32:26 +02:00
Uwe Hermann 428d79a810 Drop obsolete SR_CONF_MEASURED_2ND_QUANTITY. 2015-09-13 21:43:17 +02:00