]> sigrok.org Git - libsigrok.git/log
libsigrok.git
6 years agoserial-dmm: Add Metex M-3860M
Frank Stettner [Thu, 7 Sep 2017 14:12:17 +0000 (16:12 +0200)]
serial-dmm: Add Metex M-3860M

6 years agoconrad-digi-35-cpu: Add and use missing dev_context structure
Frank Stettner [Thu, 7 Sep 2017 14:09:10 +0000 (16:09 +0200)]
conrad-digi-35-cpu: Add and use missing dev_context structure

6 years agodreamsourcelab-dslogic: config_list: Handle SR_CONF_TRIGGER_MATCH.
Uwe Hermann [Wed, 13 Sep 2017 11:05:42 +0000 (13:05 +0200)]
dreamsourcelab-dslogic: config_list: Handle SR_CONF_TRIGGER_MATCH.

This fixes bug #1032.

6 years agochronovu-la: Silence overly verbose log message.
Uwe Hermann [Tue, 12 Sep 2017 20:15:32 +0000 (22:15 +0200)]
chronovu-la: Silence overly verbose log message.

This triggered all kinds of unrelated / confusing log messages
for unrelated hardware devices, e.g.:

  sr: [00:00.613080] chronovu-la: Unknown iProduct string 'USB-based Instrument'.
  sr: [00:00.614374] chronovu-la: Unknown iProduct string 'GL3220      '.
  sr: [00:00.614907] chronovu-la: Unknown iProduct string 'USB 3.0 HUB      '.
  sr: [00:00.615558] chronovu-la: Unknown iProduct string 'USB 2.0 HUB      '.
  sr: [00:00.619846] chronovu-la: Unknown iProduct string 'Bluetooth USB Host Controller'.
  sr: [00:00.620411] chronovu-la: Unknown iProduct string 'USB 3.0 HUB      '.
  sr: [00:00.624293] chronovu-la: Unknown iProduct string 'UAC1 DAC'.
  sr: [00:00.627849] chronovu-la: Unknown iProduct string 'BRCM20702 Hub'.
  sr: [00:00.628640] chronovu-la: Unknown iProduct string 'USB 2.0 HUB      '.
  sr: [00:00.674777] chronovu-la: Unknown iProduct string 'USB2223'.
  sr: [00:00.675034] chronovu-la: Unknown iProduct string ''.
  sr: [00:00.675180] chronovu-la: Unknown iProduct string ''.
  sr: [00:00.675205] hwdriver: Scan found 0 devices (chronovu-la).

6 years agodrivers: Remove dependency on linker implementation specific behaviour
Marcus Comstedt [Sun, 20 Aug 2017 07:53:06 +0000 (09:53 +0200)]
drivers: Remove dependency on linker implementation specific behaviour

6 years agoz60_libsigrok.rules: Add Brymen BU-86X adapter IDs.
Uwe Hermann [Mon, 21 Aug 2017 16:23:45 +0000 (18:23 +0200)]
z60_libsigrok.rules: Add Brymen BU-86X adapter IDs.

6 years agomanson-hcs-3xxx: enabled output guaranteed write
turboaffe [Tue, 3 Jan 2017 11:06:32 +0000 (12:06 +0100)]
manson-hcs-3xxx: enabled output guaranteed write

6 years agomanson-hcs-3xxx: added new name for 3304, adjustment to new manson fw
turboaffe [Tue, 3 Jan 2017 10:32:11 +0000 (11:32 +0100)]
manson-hcs-3xxx: added new name for 3304, adjustment to new manson fw

6 years agobrymen-bm86x: support channel selection (enable/disable channels)
Gerhard Sittig [Fri, 18 Aug 2017 19:43:42 +0000 (21:43 +0200)]
brymen-bm86x: support channel selection (enable/disable channels)

The previous implementation unconditionally submitted analog data
whenever values could get extracted out of received serial packets.
This commit checks the channels' enabled state before submission. Care
is taken to obey the user's acquisition limits, exclusively counting
submitted not received values.

6 years agolsr/es51919: support channel selection (enable/disable P1/P2)
Gerhard Sittig [Fri, 18 Aug 2017 19:11:05 +0000 (21:11 +0200)]
lsr/es51919: support channel selection (enable/disable P1/P2)

Upon reception of serial data from the ES51919 LCR chipset, the data for
channels P1 and P2 was extracted from the packet, and unconditionally got
sent to the sigrok session.

Do check the channels' enabled state before submission. This fixes for
serial-lcr what recently got reported for a Brymen DMM. Tested with

  $ sigrok-cli -d peaktech-2170:conn=/dev/ttyUSB0 --channels P2

and other --channels specifications.

6 years agolcr/es51919: clean but don't free dev context in cleanup callback
Gerhard Sittig [Fri, 18 Aug 2017 18:07:23 +0000 (20:07 +0200)]
lcr/es51919: clean but don't free dev context in cleanup callback

The es51919_serial_clean() routine is called by std_dev_clear_with_callback().
Common code unconditionally frees the 'priv' part. The cleanup callback only
shall release descending resources which are local to the callee and opaque
to the caller.

This fixes a double free error. Tested with PeakTech 2170.

  $ sigrok-cli -d peaktech-2170:conn=/dev/ttyUSB0 --show

6 years agoresource: Also check $SIGROK_FIRMWARE_DIR for firmware files.
Uwe Hermann [Tue, 15 Aug 2017 20:15:47 +0000 (22:15 +0200)]
resource: Also check $SIGROK_FIRMWARE_DIR for firmware files.

If the SIGROK_FIRMWARE_DIR environment variable is specified, look there
first for firmware files.

6 years agoasix-sigma: download sample data upon user initiated stop, too
Gerhard Sittig [Sat, 29 Jul 2017 14:09:36 +0000 (16:09 +0200)]
asix-sigma: download sample data upon user initiated stop, too

When the acquisition was stopped before a configured limit was reached,
no sample data was retrieved. This is because the api.c stop routine did
unregister the receive callback.

Pass the stop request to the receive routine instead when stop is called
while the acquisition is still running. Have sample data downloaded very
much like it's done for reached limits, and existing logic will run the
stop routine again after state was advanced to "idle".

Extend the 'state' tracking while we are here, mark sample download as
well (that was omitted in the previous implementation). Though the
omission was non-fatal. Move the release of 'dram_line' to some earlier
location (as soon as the resource is not needed any longer), before some
rather complex calls to other routines will execute.

Reported-By: Michael Kaplan <redacted>
6 years agodrivers: Use serial_write_blocking() everywhere.
Uwe Hermann [Thu, 15 Jun 2017 17:55:15 +0000 (19:55 +0200)]
drivers: Use serial_write_blocking() everywhere.

This fixes bug #962.

6 years agosr_voltage_string(): Add a space before the unit.
Uwe Hermann [Sun, 6 Aug 2017 17:45:45 +0000 (19:45 +0200)]
sr_voltage_string(): Add a space before the unit.

This makes the output consistent with most of the other functions
in libsigrok.

6 years agoAdd sr_voltage_string() unit tests.
Uwe Hermann [Sun, 6 Aug 2017 17:38:00 +0000 (19:38 +0200)]
Add sr_voltage_string() unit tests.

6 years agodrivers: Use g_strdup_printf() where possible.
Uwe Hermann [Sun, 6 Aug 2017 16:22:26 +0000 (18:22 +0200)]
drivers: Use g_strdup_printf() where possible.

6 years agodrivers: Random whitespace fixes.
Uwe Hermann [Sun, 6 Aug 2017 14:42:35 +0000 (16:42 +0200)]
drivers: Random whitespace fixes.

6 years agodrivers: Simplify some more trigger slope settings.
Uwe Hermann [Sun, 6 Aug 2017 13:58:52 +0000 (15:58 +0200)]
drivers: Simplify some more trigger slope settings.

6 years agodrivers: Reduce unnecessarily high indentation in some places.
Uwe Hermann [Fri, 4 Aug 2017 21:24:15 +0000 (23:24 +0200)]
drivers: Reduce unnecessarily high indentation in some places.

6 years agodrivers: Consistently use the same method to check for !cg.
Uwe Hermann [Fri, 4 Aug 2017 21:09:04 +0000 (23:09 +0200)]
drivers: Consistently use the same method to check for !cg.

6 years agodrivers: Factor out std_cg_idx().
Uwe Hermann [Thu, 3 Aug 2017 21:18:01 +0000 (23:18 +0200)]
drivers: Factor out std_cg_idx().

6 years agodrivers: Start counting at 0 for some loops.
Uwe Hermann [Thu, 3 Aug 2017 20:22:40 +0000 (22:22 +0200)]
drivers: Start counting at 0 for some loops.

6 years agodrivers: Use NUM_CHANNELS in favor of hardcoded values.
Uwe Hermann [Thu, 3 Aug 2017 19:08:44 +0000 (21:08 +0200)]
drivers: Use NUM_CHANNELS in favor of hardcoded values.

6 years agodrivers: Use std_*idx*() helpers in some more places.
Uwe Hermann [Wed, 2 Aug 2017 21:40:18 +0000 (23:40 +0200)]
drivers: Use std_*idx*() helpers in some more places.

6 years agolecroy-xstream: Use array-based approach for timebases/vdivs.
Uwe Hermann [Wed, 2 Aug 2017 18:40:18 +0000 (20:40 +0200)]
lecroy-xstream: Use array-based approach for timebases/vdivs.

This makes the driver more consistent with the rest of the code-base
and allows us to use the new array helpers in a few more places.

6 years agodrivers: Use array-based approach in some places.
Uwe Hermann [Tue, 1 Aug 2017 19:12:04 +0000 (21:12 +0200)]
drivers: Use array-based approach in some places.

This allows us to use the new array helpers in a few more places.

6 years agodrivers: Consistently name SCPI helper functions 'probe_device'.
Uwe Hermann [Mon, 31 Jul 2017 06:43:57 +0000 (08:43 +0200)]
drivers: Consistently name SCPI helper functions 'probe_device'.

6 years agodrivers: Drop some unneeded voltage_/volt_ prefixes.
Uwe Hermann [Mon, 31 Jul 2017 06:30:19 +0000 (08:30 +0200)]
drivers: Drop some unneeded voltage_/volt_ prefixes.

6 years agodrivers: Drop some unneeded _names suffixes.
Uwe Hermann [Mon, 31 Jul 2017 06:20:25 +0000 (08:20 +0200)]
drivers: Drop some unneeded _names suffixes.

6 years agodrivers: SR_CONF_CAPTURE_RATIO fixes.
Uwe Hermann [Fri, 28 Jul 2017 19:29:12 +0000 (21:29 +0200)]
drivers: SR_CONF_CAPTURE_RATIO fixes.

Move the check for the capture ratio being 0..100 into the wrappers,
drop unneeded helper functions, fix incorrect variable types, minor
other consistency fixes.

6 years agodrivers: Remove some unneeded 'ret' variables.
Uwe Hermann [Fri, 28 Jul 2017 20:56:09 +0000 (22:56 +0200)]
drivers: Remove some unneeded 'ret' variables.

6 years agodrivers: Random SR_CONF_LIMIT_* cleanups.
Uwe Hermann [Fri, 28 Jul 2017 19:51:34 +0000 (21:51 +0200)]
drivers: Random SR_CONF_LIMIT_* cleanups.

Drop unneeded variables and checks (performed by the wrappers already).

6 years agodrivers: Factor out std_*_idx*().
Uwe Hermann [Tue, 25 Jul 2017 21:12:09 +0000 (23:12 +0200)]
drivers: Factor out std_*_idx*().

6 years agodrivers: Replace struct voltage_threshold with an array.
Uwe Hermann [Wed, 26 Jul 2017 18:41:10 +0000 (20:41 +0200)]
drivers: Replace struct voltage_threshold with an array.

This makes the code-base more consistent and will allow for wider usage
of upcoming array helper functions.

6 years agodrivers: Move SR_ERR_CHANNEL_GROUP log messages to wrappers.
Uwe Hermann [Tue, 25 Jul 2017 20:53:02 +0000 (22:53 +0200)]
drivers: Move SR_ERR_CHANNEL_GROUP log messages to wrappers.

6 years agodrivers/input: Remove some hardcoded values.
Uwe Hermann [Tue, 25 Jul 2017 20:07:11 +0000 (22:07 +0200)]
drivers/input: Remove some hardcoded values.

6 years agodrivers: Use g_variant_new_printf() where possible.
Uwe Hermann [Tue, 25 Jul 2017 19:50:24 +0000 (21:50 +0200)]
drivers: Use g_variant_new_printf() where possible.

6 years agodrivers: Factor out std_gvar_thresholds().
Uwe Hermann [Tue, 25 Jul 2017 18:09:42 +0000 (20:09 +0200)]
drivers: Factor out std_gvar_thresholds().

6 years agodrivers: Factor out std_gvar_tuple_double().
Uwe Hermann [Fri, 21 Jul 2017 21:27:40 +0000 (23:27 +0200)]
drivers: Factor out std_gvar_tuple_double().

6 years agodrivers: Factor out std_gvar_tuple_u64().
Uwe Hermann [Fri, 21 Jul 2017 21:08:47 +0000 (23:08 +0200)]
drivers: Factor out std_gvar_tuple_u64().

6 years agodrivers: Consistently use same indentation for config_*() API calls.
Uwe Hermann [Fri, 21 Jul 2017 18:59:50 +0000 (20:59 +0200)]
drivers: Consistently use same indentation for config_*() API calls.

6 years agostd_gvar_tuple_array(): Change to allow for more ARRAY_AND_SIZE usage.
Uwe Hermann [Fri, 21 Jul 2017 16:45:42 +0000 (18:45 +0200)]
std_gvar_tuple_array(): Change to allow for more ARRAY_AND_SIZE usage.

Thanks to Marcus Comstedt <redacted> for the hint!

6 years agodrivers: Consistently use the exact driver name as LOG_PREFIX.
Uwe Hermann [Fri, 21 Jul 2017 16:23:35 +0000 (18:23 +0200)]
drivers: Consistently use the exact driver name as LOG_PREFIX.

6 years agodrivers: Consistently make LOG_PREFIX the first item after #includes.
Uwe Hermann [Fri, 21 Jul 2017 16:20:14 +0000 (18:20 +0200)]
drivers: Consistently make LOG_PREFIX the first item after #includes.

6 years agodrivers: Eliminate some unnecessary vendor/model #defines.
Uwe Hermann [Fri, 21 Jul 2017 16:14:08 +0000 (18:14 +0200)]
drivers: Eliminate some unnecessary vendor/model #defines.

Most drivers use the vendor/model strings directly already; make all
of them do that consistently.

6 years agodrivers: Shorten some unnecessarily long arrays.
Uwe Hermann [Fri, 21 Jul 2017 07:03:05 +0000 (09:03 +0200)]
drivers: Shorten some unnecessarily long arrays.

6 years agodrivers: Consistently use the name trigger_matches[] everywhere.
Uwe Hermann [Fri, 21 Jul 2017 06:46:51 +0000 (08:46 +0200)]
drivers: Consistently use the name trigger_matches[] everywhere.

6 years agorigol-ds: config_set: Move error printing to wrapper.
Uwe Hermann [Fri, 21 Jul 2017 07:14:48 +0000 (09:14 +0200)]
rigol-ds: config_set: Move error printing to wrapper.

6 years agorigol-ds: Update a code comment.
Uwe Hermann [Fri, 21 Jul 2017 07:02:57 +0000 (09:02 +0200)]
rigol-ds: Update a code comment.

6 years agorigol-ds: Drop two unneeded #defines.
Uwe Hermann [Fri, 21 Jul 2017 06:44:20 +0000 (08:44 +0200)]
rigol-ds: Drop two unneeded #defines.

6 years agodrivers: Use ARRAY_AND_SIZE where possible.
Uwe Hermann [Fri, 21 Jul 2017 06:10:19 +0000 (08:10 +0200)]
drivers: Use ARRAY_AND_SIZE where possible.

6 years agodrivers: Factor out std_gvar_array_*().
Uwe Hermann [Thu, 20 Jul 2017 21:43:53 +0000 (23:43 +0200)]
drivers: Factor out std_gvar_array_*().

6 years agodrivers: Factor out std_gvar_min_max_step_thresholds().
Uwe Hermann [Thu, 20 Jul 2017 21:09:15 +0000 (23:09 +0200)]
drivers: Factor out std_gvar_min_max_step_thresholds().

6 years agoscpi-pps: Change some floats to doubles.
Uwe Hermann [Thu, 20 Jul 2017 20:23:25 +0000 (22:23 +0200)]
scpi-pps: Change some floats to doubles.

This makes the code more consistent with the rest of the code-base
and also allows std_gvar_min_max_step_array() to work here.

Without this change:

  src/hardware/scpi-pps/api.c: In function ‘config_list’:
  src/hardware/scpi-pps/api.c:570:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->voltage);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/hardware/scpi-pps/api.c:573:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->frequency);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/hardware/scpi-pps/api.c:576:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->current);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

6 years agodrivers: Factor out std_gvar_min_max_step{,_array}().
Uwe Hermann [Thu, 20 Jul 2017 20:03:55 +0000 (22:03 +0200)]
drivers: Factor out std_gvar_min_max_step{,_array}().

6 years agodrivers: Factor out std_gvar_samplerates{,_steps}().
Uwe Hermann [Thu, 20 Jul 2017 19:54:00 +0000 (21:54 +0200)]
drivers: Factor out std_gvar_samplerates{,_steps}().

6 years agodrivers: Factor out std_gvar_tuple_{array,rational}().
Uwe Hermann [Wed, 19 Jul 2017 23:56:36 +0000 (01:56 +0200)]
drivers: Factor out std_gvar_tuple_{array,rational}().

6 years agodrivers: Consistently name per-cg options 'devopts_cg_*'.
Uwe Hermann [Wed, 19 Jul 2017 20:40:47 +0000 (22:40 +0200)]
drivers: Consistently name per-cg options 'devopts_cg_*'.

6 years agodrivers: Drop some unnecessary prefixes.
Uwe Hermann [Wed, 19 Jul 2017 20:21:17 +0000 (22:21 +0200)]
drivers: Drop some unnecessary prefixes.

6 years agodrivers: Drop unneeded or duplicate comments.
Uwe Hermann [Wed, 19 Jul 2017 19:29:09 +0000 (21:29 +0200)]
drivers: Drop unneeded or duplicate comments.

Drop various comments which are not really needed, too verbose, document
obvious things, are duplicated across all drivers, or simply incorrect.

6 years agobaylibre-acme: Add SR_CONF_POWERMETER key.
Uwe Hermann [Wed, 19 Jul 2017 06:31:37 +0000 (08:31 +0200)]
baylibre-acme: Add SR_CONF_POWERMETER key.

6 years agoAdd SR_CONF_POWERMETER.
Uwe Hermann [Wed, 19 Jul 2017 06:31:16 +0000 (08:31 +0200)]
Add SR_CONF_POWERMETER.

6 years agotesto: Drop unneeded sdi->driver assignment.
Uwe Hermann [Tue, 18 Jul 2017 16:38:30 +0000 (18:38 +0200)]
testo: Drop unneeded sdi->driver assignment.

This is already done by std_scan_complete().

6 years agodrivers: Provide proper drvopts.
Uwe Hermann [Tue, 18 Jul 2017 22:03:39 +0000 (00:03 +0200)]
drivers: Provide proper drvopts.

The device class config keys should be in drvopts (not devopts).

6 years agodrivers: Always use same scanopts/drvopts/devopts/devopts_cg* order.
Uwe Hermann [Tue, 18 Jul 2017 20:12:54 +0000 (22:12 +0200)]
drivers: Always use same scanopts/drvopts/devopts/devopts_cg* order.

6 years agodrivers: Add and use STD_CONFIG_LIST().
Uwe Hermann [Thu, 13 Jul 2017 19:14:04 +0000 (21:14 +0200)]
drivers: Add and use STD_CONFIG_LIST().

This ensures consistent handling of the SR_CONF_SCAN_OPTIONS and
SR_CONF_DEVICE_OPTIONS (with sdi NULL or non-NULL) config keys
and also reduces copy-pasted boilerplate in the drivers a bit.

This function does not handle channel-group specific items, that's
very driver-specific and thus left to the individual drivers.

Also move some generic checks and error messages from the drivers into
the sr_config_list() wrapper.

6 years agosaleae-logic-pro: Use sr_dev_acquisition_stop() wrapper.
Uwe Hermann [Mon, 17 Jul 2017 06:25:27 +0000 (08:25 +0200)]
saleae-logic-pro: Use sr_dev_acquisition_stop() wrapper.

6 years agosaleae-logic-pro: Detect and abort on capture errors
Jan Luebbe [Sun, 16 Jul 2017 17:28:58 +0000 (19:28 +0200)]
saleae-logic-pro: Detect and abort on capture errors

The HW simply stops sending data on overflows, so if we receive no data
in one second, we abort the acquisition. We also need to allocate more
buffers to support higher sample rates.

6 years agosaleae-logic-pro: Implement bitstream upload and initialization
Jan Luebbe [Sun, 16 Jul 2017 17:25:46 +0000 (19:25 +0200)]
saleae-logic-pro: Implement bitstream upload and initialization

The control packets can be longer than 256 bytes, so change the
low-level functions accordingly.

6 years agosaleae-logic-pro: Implement FX3 firmware upload
Jan Luebbe [Sun, 16 Jul 2017 17:24:27 +0000 (19:24 +0200)]
saleae-logic-pro: Implement FX3 firmware upload

6 years agodrivers: Remove some uneeded 'ret' variables.
Uwe Hermann [Wed, 12 Jul 2017 20:03:37 +0000 (22:03 +0200)]
drivers: Remove some uneeded 'ret' variables.

6 years agosession_driver: Use std_cleanup().
Uwe Hermann [Tue, 11 Jul 2017 19:34:18 +0000 (21:34 +0200)]
session_driver: Use std_cleanup().

6 years agosession_driver: Don't open-code std_dev_clear().
Uwe Hermann [Tue, 11 Jul 2017 19:32:03 +0000 (21:32 +0200)]
session_driver: Don't open-code std_dev_clear().

6 years agoclear_helper(): Use a cast to shorten all implementations.
Uwe Hermann [Tue, 11 Jul 2017 19:30:30 +0000 (21:30 +0200)]
clear_helper(): Use a cast to shorten all implementations.

6 years agosr_dev_clear(): Always free sdi->priv (devc).
Uwe Hermann [Tue, 11 Jul 2017 20:59:52 +0000 (22:59 +0200)]
sr_dev_clear(): Always free sdi->priv (devc).

Until now, clear_helper() callbacks for std_dev_clear_with_callback()
were expected to g_free(devc), but not all of them did that.

Have std_dev_clear_with_callback() unconditionally g_free(sdi->priv)
(i.e., devc), regardless of whether a clear_helper() callback was
provided or not. It was doing g_free(sdi->priv) when no callback
was provided already anyway.

This makes the individual drivers' clear_helper() implementations
shorter and prevents errors such as missing g_free(devc) calls.

This works, because all drivers either call std_dev_clear_with_callback()
directly, or indirectly via std_dev_clear().

This also allows us to remove some no-longer needed dev_clear()
and clear_helper() implementations that only did g_free(devc)
in favor of std_dev_clear().

6 years agodev_clear(): Consistently name callback 'clear_helper()'.
Uwe Hermann [Tue, 11 Jul 2017 20:47:46 +0000 (22:47 +0200)]
dev_clear(): Consistently name callback 'clear_helper()'.

6 years agostd: Add and use std_dev_clear() where possible.
Uwe Hermann [Tue, 11 Jul 2017 20:14:01 +0000 (22:14 +0200)]
std: Add and use std_dev_clear() where possible.

Be explicit and consistent in the drivers about which dev_clear function
will be called to avoid confusion and inconsistencies.

Drop some open-coded implementations of std_dev_clear().

6 years agostd: Rename std_dev_clear() to std_dev_clear_with_callback().
Uwe Hermann [Tue, 11 Jul 2017 19:48:00 +0000 (21:48 +0200)]
std: Rename std_dev_clear() to std_dev_clear_with_callback().

6 years agostd: Factor out some API call dummy implementations.
Uwe Hermann [Tue, 11 Jul 2017 19:21:00 +0000 (21:21 +0200)]
std: Factor out some API call dummy implementations.

6 years agoVarious log message cleanups.
Uwe Hermann [Tue, 11 Jul 2017 19:06:15 +0000 (21:06 +0200)]
Various log message cleanups.

Drop unneeded log messages, add some others that might be useful,
document which ones we're intentionally not emitting.

Don't log "$operation successful" type of messages in most cases,
that's too verbose; logging failures only is sufficient there.

baylibre-acme: Don't log "No such file or directory" messages during scan,
this triggers on all kinds of unrelated devices (e.g. "AMDGPU i2c bit
bus 0x91" in this case):

  sr: [...] baylibre-acme: Name for probe 1 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0040/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 2 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0041/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 3 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0044/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 4 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0045/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 5 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0042/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 5 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004c/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 6 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0043/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 6 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0049/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 7 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0046/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 7 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004f/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 8 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0047/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 8 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004b/name”: No such file or directory

6 years agostd: Simplifications, random fixes, Doxygen cosmetics.
Uwe Hermann [Mon, 10 Jul 2017 20:32:26 +0000 (22:32 +0200)]
std: Simplifications, random fixes, Doxygen cosmetics.

 - sr_dev_clear(): Don't try to clear uninitialized drivers (the same
   check was previously done in std_dev_clear()).

 - Document some places where we intentionally don't emit log messages.

 - std: Various Doxygen fixes and updates.

 - std: Add some more sanity-checks on input parameters.

6 years agosession_file: Start out with SR_ST_INACTIVE like all drivers.
Uwe Hermann [Fri, 7 Jul 2017 21:34:34 +0000 (23:34 +0200)]
session_file: Start out with SR_ST_INACTIVE like all drivers.

6 years agosr_dev_close(): Set status to SR_ST_INACTIVE.
Uwe Hermann [Fri, 7 Jul 2017 18:42:04 +0000 (20:42 +0200)]
sr_dev_close(): Set status to SR_ST_INACTIVE.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_dev_open(): Set status to SR_ST_ACTIVE upon success.
Uwe Hermann [Fri, 7 Jul 2017 20:36:24 +0000 (22:36 +0200)]
sr_dev_open(): Set status to SR_ST_ACTIVE upon success.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_dev_open(): Factor out SR_ST_ACTIVE check.
Uwe Hermann [Fri, 7 Jul 2017 19:11:56 +0000 (21:11 +0200)]
sr_dev_open(): Factor out SR_ST_ACTIVE check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_dev_close(): Factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Thu, 6 Jul 2017 18:24:12 +0000 (20:24 +0200)]
sr_dev_close(): Factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_config_commit(): Factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Thu, 6 Jul 2017 18:17:50 +0000 (20:17 +0200)]
sr_config_commit(): Factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_config_set(): Factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Thu, 6 Jul 2017 18:05:43 +0000 (20:05 +0200)]
sr_config_set(): Factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agoAdd sr_dev_acquisition_start(), factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Wed, 5 Jul 2017 20:37:10 +0000 (22:37 +0200)]
Add sr_dev_acquisition_start(), factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agoAdd sr_dev_acquisition_stop(), factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Wed, 5 Jul 2017 17:33:38 +0000 (19:33 +0200)]
Add sr_dev_acquisition_stop(), factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agoIntroduce A2L methods
Soeren Apel [Sat, 1 Jul 2017 22:55:03 +0000 (00:55 +0200)]
Introduce A2L methods

The memory allocation for sr_datafeed_logic is broken, the memory
will never be freed. #994 is used to handle this issue.

6 years agoBindings: constify data pointer
Soeren Apel [Sat, 1 Jul 2017 21:57:34 +0000 (23:57 +0200)]
Bindings: constify data pointer

6 years agogitignore nano and vim swap files
Roland Hieber [Mon, 3 Jul 2017 21:02:48 +0000 (23:02 +0200)]
gitignore nano and vim swap files

When .*.swp already exists, vim will try .*.swo, then .*.swn, and so
forth. Ignore those files too.

Signed-off-by: Roland Hieber <redacted>
6 years agoserial-dmm: Add support for the SparkFun 70C multimeter.
Richard [Wed, 28 Jun 2017 05:23:35 +0000 (00:23 -0500)]
serial-dmm: Add support for the SparkFun 70C multimeter.

6 years agoMark some arrays as const
Richard [Wed, 28 Jun 2017 05:22:46 +0000 (00:22 -0500)]
Mark some arrays as const

6 years agosaleae-logic-pro: Fix two compiler warnings.
Uwe Hermann [Mon, 3 Jul 2017 06:40:30 +0000 (08:40 +0200)]
saleae-logic-pro: Fix two compiler warnings.

  src/hardware/saleae-logic-pro/protocol.c:389:12: warning: 'set_led' defined but not used [-Wunused-function]
   static int set_led(const struct sr_dev_inst *sdi, uint8_t r, uint8_t g, uint8_t b)
              ^
    CC       src/hardware/saleae-logic-pro/api.lo
  src/hardware/saleae-logic-pro/api.c: In function 'dev_acquisition_handle':
  src/hardware/saleae-logic-pro/api.c:332:9: warning: missing initializer for field 'tv_sec' of 'struct timeval' [-Wmissing-field-initializers]
    struct timeval tv = {};
           ^
  In file included from /usr/include/x86_64-linux-gnu/sys/time.h:27:0,
                   from include/libsigrok/libsigrok.h:24,
                   from src/hardware/saleae-logic-pro/protocol.h:25,
                   from src/hardware/saleae-logic-pro/api.c:23:
  /usr/include/x86_64-linux-gnu/bits/time.h:32:14: note: 'tv_sec' declared here
       __time_t tv_sec;  /* Seconds.  */
                ^

6 years agoRevert "C++: Avoid std::map::emplace() for GCC 4.7 compatibility"
Uwe Hermann [Wed, 28 Jun 2017 06:54:57 +0000 (08:54 +0200)]
Revert "C++: Avoid std::map::emplace() for GCC 4.7 compatibility"

This reverts commit 8c529898116e9a6bf7083fb3b748b24d006392a4.

We now require g++ >= 4.8.1 which supports std::map::emplace(), as does
clang >= 3.3.

6 years agosaleae-logic-pro: Random minor cosmetics/consistency fixes.
Uwe Hermann [Wed, 28 Jun 2017 06:29:04 +0000 (08:29 +0200)]
saleae-logic-pro: Random minor cosmetics/consistency fixes.

6 years agosaleae-logic-pro: Driver name consistency fixes.
Uwe Hermann [Wed, 28 Jun 2017 06:15:24 +0000 (08:15 +0200)]
saleae-logic-pro: Driver name consistency fixes.