The confusingly named sr_log_logdomain_set() simply set a global
string prefixed to the log message by the default log callback.
This is pretty much useless, misleadingly named, and not used by
either sigrok-cli or PulseView.
The need to make this a list no longer applies.
SR_T_MQ is thus a type consisting of a tuple with two elements: the first
item is the MQ (type G_VARIANT_TYPE_UINT32), and the second is the MQ
flags value (G_VARIANT_TYPE_UINT64).
- SR_MQ_MASS: Mass, as measured by scales / balances.
- SR_UNIT_*: Various units of mass.
- SR_MQFLAG_UNSTABLE: A flag denoting that a value has not
yet stabilized (settled). E.g. when placing an object on a scale
it'll take a few moments until a stable reading is available.
Measurement values marked with SR_MQFLAG_UNSTABLE denote that they
are "unsettled", unstable values (not yet stabilized).
The absence of SR_MQFLAG_UNSTABLE denotes that the value is stable.
- SR_CONF_SCALE: A device class for weighing scales / balances.
This type consists of an array, with each item a two-member tuple,
representing an MQ/MQflags pair: the first item is the MQ (type
G_VARIANT_TYPE_UINT32), and the second is the MQ flags value
(G_VARIANT_TYPE_UINT64).
A GVariant of type SR_T_MQLIST can thus always represent more than
one MQ/MQflag pair.
The tables defined with this struct can now be used for information
on items other than config keys.
Functions to access these tables have been renamed sr_key_info_[name_]get.
These take an extra argument, keytype, which should be set to SR_KEY_CONFIG
to get the config key tables. Other key types will be added.
Use the proper tool for the job and make libsigrok/version.h
a secondary configuration header, so that autoconf's AC_DEFINE
machinery can be used to generate it. Note that the header
template is still hand-written, enabling fine control of the
content.
Move the include flags for files in the source tree from
configure.ac to Makefile.am where they belong. Also use
AM_CPPFLAGS instead of CFLAGS/CXXFLAGS to make sure the
files in the build/source tree are always picked up first.
Also, remove the include/libsigrok sub-directory from the
search path, thereby making the <libsigrok/> prefix mandatory
when building libsigrok itself. This matches the convention
already imposed on users of the library.
All those options are currently applied only to power-supplies
but they could apply as well to electronic loads, except for the
fact that electronic loads channels are called inputs and not
outputs.
Also when you think about an SMU (or any kind of 4-quadrants
power-supply), their channels can both source and sink current,
so they can be considered as input as much as output.
Those SR_CONF_* are thus renamed so that they can be used in all
those situations.
This requires sr_hw_cleanup_all() and sanity_check_all_drivers()
to also take a context.
The (runtime) generation of the driver list now happens in sr_init()
and sr_driver_list() always returns that pre-generated list. This fixes
a segfault when (correctly) invoking multiple sr_init() and sr_exit()
calls with different contexts (caught by the unit tests).
This fixes bug #565.
Add new configuration option allowing to modify the probe factor
for oscilloscopes and power-monitors.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Inlining can only happen in the same compilation unit where the
function was defined, so there is no sense declaring an inline
function in a header if this function is not defined in this
same header.
This fixes the following gcc-5 warning:
In file included from include/libsigrok/libsigrok.h:1066:0,
from src/version.c:21:
include/libsigrok/proto.h:36:20: warning: inline function 'sr_rational_set' declared but never defined
SR_API inline void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q);
^
Add new error code which can be used to notify the user about
general input/output errors.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
- 'struct sr_input *' variables are consistently named 'in'.
- 'struct sr_input_module *' variables are consistently named 'imod'.
- 'struct sr_output *' variables are consistently named 'o'.
- 'struct sr_output_module *' variables are consistently named 'omod'.
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.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
The automatic selections of the measured quantity and equivalent circuit
model are more part of the configuration of the meter than attributes
of the measurement result. To reflect this, model them as config keys
instead of mqflags. This allows a driver that supports remote control to
implement 'set' method for them and has the additional benefit of saveing
two flag bits.
Add flags for indicating that the meter has selected the measured
quantitiy and/or the used measurement model automatically. These
are similar to the existing auto-range flag.
Add 'SR_MQ_DIFFERENCE' quantity for reporting relative difference
between the current measurement and the reference value. The value
of this quantity will normally be reported in percents. Add also
the flag 'SR_MQFLAG_REFERENCE' for indicating that the reported
value is not the current measurement but the reference value instead.
Add parallel and serial model inductance, capacitance and resistance
for LCR meter measurements. Add also secondary quantities many LCR
meters calculate, namely dissipation factor, quality factor and phase
angle.
Add degrees and henrys to the list of supported units. Degree is
an unit of plane angle where one degree is 1/360th of a full circle.
Henry is the SI unit of inductance.
This signifies to the module instance no more input will come. This
will cause the module to process any data it may have buffered. The
SR_DF_END packet will also typically be sent at this time.
Every driver now publishes its device option config keys, i.e. the
list fetched with sr_config_list(SR_CONF_DEVICE_OPTIONS), with a
set of flags indicating which methods are implemented by the driver
for that key.
The config keys are OR'ed with any combination of SR_CONF_GET,
SR_CONF_SET and SR_CONF_LIST. These are defined as the high bits
of the uint32_t config key. Clients can OR config keys with
SR_CONF_MASK to strip out these bits. This mask will be kept up to
date if other bits are added to the capabilities list; clients MUST
therefore use SR_CONF_MASK for this.
Some keys don't have capability bits added, such as the informative
device type keys (SR_CONF_MULTIMETER, SR_CONF_OSCILLOSCOPE, ...) and
SR_CONF_CONTINUOUS.
Scan options do not have capabilities bits.
SR_OK: a match was found.
SR_ERR: no match.
SR_ERR_DATA: a match was found but the module cannot handle the input.
SR_OK_CONTINUE: some module didn't have enough data to be sure.
This returned an array of structs with an NULL-ed element at the end.
The drivers still do this, but the wrappers now make and free a NULL-
terminated array around it.
sr_output_options_free() now takes the pointer returned by
sr_output_options_get(), instead of the module owning it.
This is intended for setting (or getting) the amplitude of a source
which doesn't really have an MQ associated with it, such as the demo
driver's analog channels.
This is needed so that the C++ bindings, the header for which
references "libsigrok/libsigrok.h", can have a valid include
directory passed to build them before the headers are installed.