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).
Uwe Hermann [Tue, 15 Jan 2013 23:02:24 +0000 (00:02 +0100)]
alsa: Silence ALSA scanning process.
Errors while opening or configuring ALSA devices during scan for devices
should not be shown by default (i.e., no sr_err() usage). Non-working
or non-accessible devices (due to permissions or other reasons) will
simply not show up in frontends. Use sr_dbg() instead of sr_err().
Fix the bare minumum of whitespace/indentation/coding-style via
automatic 'indent' run, followed by some minor manual fixes.
Some more fixes and cleanups might follow later.