Commit Graph

55 Commits

Author SHA1 Message Date
Uwe Hermann 3f239f0803 Rename various *PROBE* macros to *CHANNEL*.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 56d0d24535 Rename sr_probe_new() to sr_channel_new().
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann ba7dd8bbb8 Replace 'probe' with 'channel' in most places.
Also, consistently use 'ch' for channel variables. This matches how we
consistently use sdi, devc, and so on all over the code-base.

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 91aea754aa Rename 'struct sr_probe' to 'struct sr_channel' everywhere.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 53b4680fce Consistently use 'cg' for channel group variables.
This matches how we consistently use sdi, devc, and so on all over
the code-base.

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 660e398fe9 Replace 'probe group' with 'channel group' everywhere.
The name 'probe' (and thus 'probe group') is a relic from the times when
sigrok was mostly about logic analyzers. Nowadays we support a lot more
device types where 'probe' is not really a good term and 'channel' is
much better suited.

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 67bd805523 Switch to a non-recursive automake setup.
Instead of >= 44 Makefile.am's we now only have one top-level
Makefile.am, and use the 'subdir-objects' automake option to
handle the build via non-recursive (auto)make.

This has the advantage of fewer (boilerplate or other) files and less
clutter in general, as well as performance advantages since the new
setup can build many files in parallel (with 'make -j'), not only 2 or 3
files within the same (e.g. hardware/xxxx/* subdirectory) and also since
we no longer need to build intermediate libtool helper libs per subdirectory.

A quick, non-scientific test build on a quad-core laptop with 'make -j 4'
yields a build time reduction from 35s to 19s.

All autotools features that worked before are still intact without any
regressions, including the Make targets 'install', 'uninstall', 'check',
'dist', 'clean', 'distclean' and so on, as well as all the usual portability
handling (build works on any OS, with any Make implementation such as
GNU Make or BSD Make, with any shell such as sh/ksh/zsh/bash/dash, etc. etc.)
and features such as out-of-tree build support, cross-compile support,
testsuite support (also with colored output), "silent make rules", etc. etc.
2014-03-20 13:10:05 +01:00
Bert Vermeulen a66307424e Remove std_dev_clear() wrappers from drivers. 2014-02-26 21:37:18 +01:00
Aurelien Jacobs d87c1766f2 change a bunch of functions from SR_PRIV to static
None of those functions are called across compilation units.
2014-01-14 23:39:23 +01:00
Aurelien Jacobs 8162cad7e0 move function declarations to the appropriate header 2014-01-14 23:39:23 +01:00
Martin Ling 3544f848e0 Centralise duplicated logging helper defines. 2013-12-27 12:54:05 +01:00
Martin Ling 6c60facc19 Use common usb_source_add and usb_source_remove functions. 2013-12-21 23:09:23 +00:00
Martin Ling 8f996b8948 probe_groups: API changes required to implement probe groups. 2013-11-08 01:03:16 +01:00
Uwe Hermann ce4d26ddf9 Various cosmetics, whitespace, consistency fixes. 2013-07-31 13:09:48 +02:00
Bert Vermeulen d406dccd6a lascar-el-usb: Don't close device after acquisition 2013-07-16 16:08:38 +02:00
Uwe Hermann 3b412e3a30 s/clear_instances/dev_clear/.
Consistently use the same name for the dev_clear() API callback
everywhere.
2013-06-02 16:56:41 +02:00
Uwe Hermann f6beaac55c std: Drop hw_ from function names.
The per-driver API calls no longer have a hw_ prefix (e.g. hw_init()
became init() and so on), so drop the 'hw_' from the std versions
for those API callbacks too.
2013-06-02 16:46:18 +02:00
Uwe Hermann c9d622a420 lascar-el-usb: Use std_dev_clear(). 2013-06-02 13:52:40 +02:00
Uwe Hermann 6078d2c996 Use consistent API callback function names.
This now matches what the 'new-driver' tool generates.
2013-05-10 20:01:37 +02:00
Uwe Hermann decfe89d4e Drop some lines that are no longer needed. 2013-05-10 18:30:32 +02:00
Uwe Hermann 29a27196a1 s/DRIVER_LOG_DOMAIN/LOG_PREFIX/.
This is more correct anyway, and also a bit shorter and more readable.
2013-05-03 21:59:32 +02:00
Bert Vermeulen 50c604f50b Don't automatically clear known instances from USB drivers on scan
This invalidates previously returned sr_dev_inst pointers, which a
frontend may be holding. It's the frontend's responsibility to clear
the list of instances a driver keeps track of by calling

	sr_dev_clear(driver);

if it wants a completely new scan done.
2013-04-27 18:27:32 +02:00
Bert Vermeulen e73ffd4238 Enforce open device before config_set()/dev_acquisition_start() 2013-04-24 22:03:50 +02:00
Bert Vermeulen 0f1506497b lascar-el-usb: Support SR_CONF_CONN 2013-04-18 22:48:29 +02:00
Bert Vermeulen bd6fbf628a drivers: return SR_ERR_NA on unsupported config key
Fixes bug 89.
2013-04-16 11:00:55 +02:00
Bert Vermeulen 1d16675769 lascar-el-usb: Use two probes for temp/humidity loggers 2013-04-15 01:30:24 +02:00
Bert Vermeulen 7faf69da10 lascar-el-usb: Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:07 +02:00
Uwe Hermann 3ebce226a2 s/sr_config_make/sr_config_new/.
This matches the naming of other/similar functions better.
2013-03-23 14:16:00 +01:00
Bert Vermeulen 8e77bc20b9 lascar-el-usb: push samplerate before data log 2013-03-16 21:52:02 +01:00
Bert Vermeulen 361d15110c lascar-el-usb: support for SR_CONF_DATALOG 2013-03-11 16:37:02 +01:00
Uwe Hermann 6fab7b8f53 Driver struct cleanups.
- Explicitly list .config_get in all drivers for consistency, and set it
   to NULL if unused (whether or not a driver implements it is optional).

 - List all 'struct sr_dev_driver' entries in the same order in all drivers.

 - Move the check whether .config_set/.config_list exist (i.e., are non-NULL)
   into sanity_check_all_drivers().
2013-02-07 10:58:35 +01:00
Uwe Hermann 4afdfd4628 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.
2013-02-07 10:46:28 +01:00
Uwe Hermann 0e94d524c1 Shorten/simplify hw_dev_list() implementations. 2013-02-05 18:27:05 +01:00
Uwe Hermann 063e7aef6d Factor out common hw_init() driver code.
Most drivers do pretty much the same things in their hw_init()
right now, so factor out that code to std_hw_init() in std.c.
2013-01-29 12:56:02 +01:00
Uwe Hermann 4b97c74e0b 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.
2013-01-29 12:56:02 +01:00
Bert Vermeulen 6a4710fac2 drivers: Trim unused config_get() calls
None of the driver config_get/set/list calls are required.
2013-01-25 16:05:48 +01:00
Bert Vermeulen 0d485e30c6 Deprecate SR_DI_HWOPTS.
This is replaced by SR_CONF_SCAN_OPTIONS.
2013-01-25 15:09:20 +01:00
Bert Vermeulen 9a6517d14b Deprecate SR_DI_HWCAPS.
This is replaced by SR_CONF_DEVICE_OPTIONS.
2013-01-25 15:01:49 +01:00
Bert Vermeulen a1c743fc51 drivers: implement config_list() 2013-01-25 02:37:26 +01:00
Bert Vermeulen 035a1078fd drivers: rename and reorganize config get/set
The driver API calls info_get() and dev_config_set() have been renamed
to config_get() and config_set(), respectively.
2013-01-24 19:19:09 +01:00
Bert Vermeulen 69e19dd769 Always interleave analog data with all enabled probes.
The new "probes" field in sr_datafeed_analog contains a copy
of all enabled struct sr_probe.
2013-01-23 03:40:44 +01:00
Bert Vermeulen 1953564a96 Rename SR_HWOPT_* and SR_HWCAP_* to SR_CONF_* 2013-01-21 23:32:50 +01:00
Bert Vermeulen 1987b8d63e 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.
2013-01-21 23:32:49 +01:00
Uwe Hermann 4ebd48b352 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).
2013-01-20 18:48:02 +01:00
Bert Vermeulen 6b8d6f93bb Get rid of obsolete SR_DI_NUM_PROBES and SR_DI_PROBE_NAMES.
Frontends should use the probe list in the device's sr_dev_inst
to get this information.
2013-01-15 17:42:23 +01:00
Uwe Hermann 7869340103 Shorten probe_names[] arrays everywhere.
Also, NULL-terminate all of them.
2012-12-26 00:16:07 +01:00
Bert Vermeulen 6aed917b13 lascar-el-usb: fix sample limit parameter 2012-12-16 23:06:15 +01:00
Bert Vermeulen 6787f4049a lascar-el-usb: support for EL-USB-2* 2012-12-16 18:48:20 +01:00
Bert Vermeulen 7f00750ca4 lascar-el-usb: properly submit CO concentration as a PPM value 2012-12-15 22:49:40 +01:00
Bert Vermeulen b0c95747e1 lascar-el-usb: add config saver 2012-12-15 22:34:40 +01:00