Bert Vermeulen [Sat, 16 Mar 2013 19:17:41 +0000 (20:17 +0100)]
add SR_CONF_SAMPLE_INTERVAL
Expresses the time between samples, in milliseconds. This can be used
for devices with a samplerate > 1 second, such as dataloggers, which
cannot be expressed with SR_CONF_SAMPLERATE.
Uwe Hermann [Thu, 7 Mar 2013 08:37:42 +0000 (09:37 +0100)]
Add a testsuite for libsigrok.
This adds a suite of unit tests for libsigrok. It uses the 'Check'
tool/library (apt-get install check) to run the tests.
The configure tool tries to find libcheck. If it succeeds, a
"make check" will run all tests. Otherwise, none of the tests will
be built and "make check" will not run any tests.
This also means that users who don't have 'check' installed will still
be able to build and install libsigrok just fine.
Bert Vermeulen [Thu, 21 Feb 2013 13:48:43 +0000 (14:48 +0100)]
input: feed the filename to the module's init() function
This is essential if a format contains e.g. the number of probes; the
init() function needs to initialize the sr_dev_inst struct, but needs
access to the file to properly add the probes to it.
Uwe Hermann [Fri, 8 Feb 2013 22:13:33 +0000 (23:13 +0100)]
zeroplus: Only report supported samplerates.
The currently supported model LAP-C(16032) doesn't support the
samplerates 150MHz and 200MHz which some of the other models have.
Thus, do not report these samplerates to the frontends. E.g. sigrok-cli
should not show them via --show and GUIs should not list them in their
"Samplerates" drop-down.
Uwe Hermann [Wed, 6 Feb 2013 18:57:32 +0000 (19:57 +0100)]
Add and use std_session_send_df_header().
This is a small helper function which sends the SR_DF_HEADER packet that
drivers usually emit in their hw_dev_acquisition_start() API callback.
It simplifies and shortens the hw_dev_acquisition_start() functions
quite a bit.
It also simplifies the input modules which send an SR_DF_HEADER packet, too.
This patch also automatically removes some unneeded malloc/free in some
drivers for the 'packet' and 'header' structs used for SR_DF_HEADER.
Uwe Hermann [Fri, 1 Feb 2013 21:58:54 +0000 (22:58 +0100)]
hw_dev_close(): Move common checks to wrapper.
Check the relevant arguments for != NULL before calling the actual
driver-specific function, so that the driver can safely assume those
arguments are non-NULL. This removes the need to duplicate these
checks in every driver.
This patch might also work for a number of other Brymen models
-- 859(a), 867, 869---
including their respective rebadges from Greenlee, Extech, and Amprobe.
Uwe Hermann [Mon, 28 Jan 2013 19:00:54 +0000 (20:00 +0100)]
sr_driver_scan(): Improve checks.
Check the relevant arguments for != NULL before calling the actual
driver-specific function, so that the driver can safely assume those
arguments are non-NULL. This removes the need to duplicate these
checks in every driver.
Also, do some minor whitespace and consistency improvements.
Uwe Hermann [Mon, 28 Jan 2013 18:36:16 +0000 (19:36 +0100)]
sr_driver_init(): Improve checks.
Check the relevant arguments for != NULL before calling the actual
driver-specific function, so that the driver can safely assume those
arguments are non-NULL. This removes the need to duplicate these
checks in every driver.
Also, change one SR_ERR to the more correct SR_ERR_MALLOC, and assign
sr_ctx in the rigol-ds1xx2's hw_init() function, like all the other
drivers do.
Bert Vermeulen [Fri, 25 Jan 2013 00:24:42 +0000 (01:24 +0100)]
New driver API function: config_list()
This takes an sr_config key and returns a list of possible values for
that key to be submitted with config_set(). The format of the list and
its contents is dependent on the key.
This will replace the SR_DI_* keys that returned such a list before,
such as SR_DI_SAMPLERATES.
Bert Vermeulen [Sun, 20 Jan 2013 14:45:09 +0000 (15:45 +0100)]
Use new SR_DF_META packet.
Since input modules determine a samplerate by reading from their
file format (or having it overridden with an option), they need
to pass this up to the frontend.
Bert Vermeulen [Sun, 6 Jan 2013 16:41:30 +0000 (17:41 +0100)]
drivers: use new sr_config struct
Sending an SR_DF_META packet at the start of every stream is not
mandatory; the frontend should ask for what it needs, and any extra
information the driver wants to send will come in due time.
Uwe Hermann [Sun, 20 Jan 2013 17:48:02 +0000 (18:48 +0100)]
Remove non-error hw_info_get() messages.
Currently hw_info_get() can receive requests for entries (info_id) that
the specific driver doesn't support. That is (right now) a valid
use-case and not an error (might change later, though).
Thus, for now, don't output messages for such requests at all (certainly
not as sr_err() where they show up in e.g. sigrok-cli output per default).