Commit Graph

48 Commits

Author SHA1 Message Date
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 70424328c1 fluke-dmm: Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:07 +02:00
Uwe Hermann cd2f0fe22c Add/use std_hw_dev_acquisition_stop_serial(). 2013-02-08 23:32:45 +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 961009b0c4 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.
2013-02-05 18:46:33 +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
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
Bert Vermeulen 2f1e5c7cb7 fluke-dmm: Properly handle continuous mode
Same bug+fix as commit d55c89f523
2012-12-24 20:27:45 +01:00
Bert Vermeulen 11fb7110f4 fluke-dmm: 190 series scopemeter support
199B only for now.
2012-12-24 11:22:01 +01:00
Bert Vermeulen 4cea0ff7fe fluke-dmm: parser cleanup 2012-12-24 11:22:01 +01:00
Bert Vermeulen 9fa0968027 fluke-dmm: adapt scanner to accomodate 190 series scopemeters 2012-12-24 11:22:01 +01:00
Bert Vermeulen d4b11de09a fluke-dmm: make poll timeout configurable
Defaulted to 1s before, but a simple "QM" command on a 199B in scope
mode takes 1.7s to come through.
2012-12-24 11:22:01 +01:00
Peter Stuge 1ebe4b4e69 hw_init(): Save struct sr_context * parameter in struct drv_context 2012-12-03 12:07:40 +01:00
Peter Stuge 34f06b903e Add a struct sr_context * parameter to hw_init() 2012-12-03 12:07:40 +01:00
Uwe Hermann a54dd31e38 serial: Use OS-independent flags for serial port opening.
Add SERIAL_RDWR, SERIAL_RDONLY, and SERIAL_NONBLOCK (for now), which are
mapped to the respective OS-specific mechanism in serial_open().
2012-12-02 12:45:54 +01:00
Bert Vermeulen 58d03f034f fluke-dmm: use new serial API 2012-11-12 02:25:17 +01:00
Uwe Hermann 64d33dc28e All drivers: Drop unneeded comments. 2012-11-11 18:09:11 +01:00
Bert Vermeulen 642e9d623c more deconstifying sr_dev_inst for dev_acquisition_stop() 2012-11-06 19:32:53 +01:00
Bert Vermeulen 69b07d14db allow for intermediate stage in stopping acquisition
In the case of USB drivers, a driver's dev_acquisition_stop() cannot
simply remove its fd sources from the session and close its devices:
a USB transfer might still be underway, and it needs to be finished
(and its memory freed) properly.

An sr_dev_inst->status value is added: SR_ST_STOPPING, which should
be set when the driver's dev_acquisition_stop() is called, and acts
as a marker for the USB event handler to wind up its operations.

In order for dev_acquisition_stop() to be able to set the sdi status,
however, it needs to be unconstified.
2012-11-06 15:16:22 +01:00
Uwe Hermann 886a52b6fb Return SR_ERR_MALLOC upon allocation errors.
Add some TODOs.
2012-10-30 20:25:54 +01:00
Uwe Hermann 6f22a8ef2c Factor out serial_readline() to serial.c.
Only one (slightly different) variant remains in agilent-dmm, this will
be merged soon too, though.
2012-10-30 19:59:21 +01:00
Uwe Hermann 31d84da3a2 fluke-dmm: Use message logging helpers. 2012-10-30 19:28:37 +01:00
Bert Vermeulen a28dac0a73 fluke-dmm: code cleanup 2012-10-29 11:54:20 +01:00
Bert Vermeulen 2c04dede20 Fluke 287/289: support for dBu/dBV measurement units 2012-10-29 11:50:34 +01:00
Uwe Hermann 545f978639 config.h usage cleanups.
- Drop config.h #include from files that don't actually use any of
   its contents (at the moment).

 - Add comment for those that do need it.
2012-10-24 00:41:21 +02:00
Bert Vermeulen fe31f8b9f9 fluke-dmm: add support for Fluke 187 2012-10-16 23:33:54 +02:00
Uwe Hermann a2e222d24f sr: struct drv_context is global now. 2012-09-27 23:29:33 +02:00
Bert Vermeulen d38d2ef0ce fluke-dmm: support for all basic 287 functionality 2012-09-25 19:53:05 +02:00
Bert Vermeulen f46a36ad80 fluke-dmm: definitely use CR as line terminator 2012-09-25 19:53:05 +02:00
Bert Vermeulen acd29accb3 fluke-dmm: add Fluke 287 to supported list 2012-09-25 19:53:05 +02:00
Bert Vermeulen d3f8f1415c fluke-dmm: flesh out the driver API 2012-09-25 19:53:05 +02:00
Bert Vermeulen 4129832014 fluke-dmm: auto-discover serial bitrate if not provided 2012-09-25 19:53:05 +02:00
Bert Vermeulen bc41e012e6 fluke-dmm: don't log anything if no conn params given 2012-09-25 19:53:05 +02:00
Bert Vermeulen fb480d578e fluke-dmm: fix discovery 2012-09-25 19:53:05 +02:00
Bert Vermeulen e7edd64f45 fluke-dmm: build fixes 2012-09-25 19:53:05 +02:00
Bert Vermeulen 4f958423d1 fluke-dmm: basic scan functionality 2012-09-25 19:53:05 +02:00
Bert Vermeulen 883a2e9e71 fluke-dmm: initial driver skeleton 2012-09-25 19:53:05 +02:00