]> sigrok.org Git - libsigrok.git/log
libsigrok.git
4 years agohameg-hmo: Rename SCPI_CMD_GET_VERTICAL_DIV to *_SCALE.
Guido Trentalancia [Tue, 20 Nov 2018 22:22:29 +0000 (23:22 +0100)]
hameg-hmo: Rename SCPI_CMD_GET_VERTICAL_DIV to *_SCALE.

Fix the name of the SCPI command used to get the vertical scale.

4 years agohameg-hmo: Beautify trigger pattern.
Guido Trentalancia [Tue, 20 Nov 2018 18:35:33 +0000 (19:35 +0100)]
hameg-hmo: Beautify trigger pattern.

Beautify the trigger pattern by removing the quotes from the SCPI response
using sr_scpi_unquote_string() and improve the string pattern handling.

4 years agohameg-hmo: Add missing 1ns timebase for some models.
Guido Trentalancia [Tue, 20 Nov 2018 16:07:04 +0000 (17:07 +0100)]
hameg-hmo: Add missing 1ns timebase for some models.

Extend the timebase setting down to 1ns from the current limit
of 2ns for all supported series except the HMO Compact.

4 years agohameg-hmo: Add missing quotes for SCPI_CMD_SET_TRIGGER_PATTERN.
Guido Trentalancia [Sat, 1 Dec 2018 21:45:26 +0000 (22:45 +0100)]
hameg-hmo: Add missing quotes for SCPI_CMD_SET_TRIGGER_PATTERN.

4 years agohameg-hmo: Add RTA4000 MSO support (untested).
Guido Trentalancia [Tue, 20 Nov 2018 13:59:08 +0000 (14:59 +0100)]
hameg-hmo: Add RTA4000 MSO support (untested).

According to the latest available version of the manual, as
for the RTB2000 and RTM3000 series, the RTA4000 series also
uses a slightly different dialect than other previously
supported models, in particular when it comes to the POD
(logic channel groups) handling.

I do not have such model available for testing therefore, as
for the RTB2000 and RTM3000 support recently introduced, I do
not know whether or not the RTA4000 also understands the
existing dialect. In doubt, the new official dialect is
implemented by this patch.

4 years agohameg-hmo: Add RTB2000 and RTM3000 MSO support (untested).
Guido Trentalancia [Mon, 19 Nov 2018 22:39:46 +0000 (23:39 +0100)]
hameg-hmo: Add RTB2000 and RTM3000 MSO support (untested).

According to the latest available version of the manual, they
both use a slightly different dialect than currently supported
models, in particular when it comes to the POD (logic channel
groups) handling.

I do not have any of the above models available for testing
therefore I do not know whether or not they also understand
the existing dialect. In doubt, the new official dialect is
implemented by this patch.

4 years agohameg-hmo: Add SR_CONF_LOGIC_ANALYZER drvopt.
Guido Trentalancia [Sat, 29 Dec 2018 16:26:30 +0000 (17:26 +0100)]
hameg-hmo: Add SR_CONF_LOGIC_ANALYZER drvopt.

4 years agohameg-hmo: Fix the upper limit for the vertical scale.
Guido Trentalancia [Wed, 21 Nov 2018 15:17:14 +0000 (16:17 +0100)]
hameg-hmo: Fix the upper limit for the vertical scale.

4 years agohameg-hmo: Only update states after successful SCPI SET.
Guido Trentalancia [Sun, 18 Nov 2018 14:32:00 +0000 (15:32 +0100)]
hameg-hmo: Only update states after successful SCPI SET.

Update the oscilloscope state with new settings only after
they have been successfully stored in the device to avoid
an inconsistent state in case of SCPI SET command failure.

4 years agohameg-hmo: Fix for an incorrect samplerate being returned.
Guido Trentalancia [Sun, 18 Nov 2018 00:22:51 +0000 (01:22 +0100)]
hameg-hmo: Fix for an incorrect samplerate being returned.

The hameg-hmo driver returns an incorrect sample rate: to reproduce this
bug, set the maximum sample rate from the ACQUIRE menu.

This patch fixes the driver so that the correct sample rate is returned.

4 years agohameg-hmo: Avoid bogus SCPI timeouts.
Guido Trentalancia [Sat, 17 Nov 2018 21:20:29 +0000 (22:20 +0100)]
hameg-hmo: Avoid bogus SCPI timeouts.

During the initial configuration phase of the hameg-hmo driver
only send an OPC command if a SCPI command has been previously
sent to the device so that bogus SCPI timeouts are avoided.

4 years agohameg-hmo: Use 1-based (not 0-based) POD numbers.
Guido Trentalancia [Fri, 16 Nov 2018 20:51:49 +0000 (21:51 +0100)]
hameg-hmo: Use 1-based (not 0-based) POD numbers.

The current starting index for the POD name is currently wrong as it is zero.

The official POD numbering starts instead at 1 (see device panel, buttons
and manual), so the current index used for message printing and groups
naming in the driver needs to be incremented by one.

4 years agohameg-hmo: SR_CONF_LIMIT_SAMPLES/_FRAMES don't support _GET.
Guido Trentalancia [Fri, 16 Nov 2018 17:49:53 +0000 (18:49 +0100)]
hameg-hmo: SR_CONF_LIMIT_SAMPLES/_FRAMES don't support _GET.

The samples and frame acquisition limits are not stored in the device or
elsewhere. Therefore they should not be read.

4 years agohameg-hmo: Avoid a double-free.
Guido Trentalancia [Fri, 16 Nov 2018 17:48:36 +0000 (18:48 +0100)]
hameg-hmo: Avoid a double-free.

Avoid double memory freeing leading to segmentation fault in when a SCPI
command fails to get a string due conditions such as a timeout or an invalid
command.

4 years agohameg-hmo: Add SR_CONF_TRIGGER_PATTERN support.
Guido Trentalancia [Fri, 16 Nov 2018 17:47:55 +0000 (18:47 +0100)]
hameg-hmo: Add SR_CONF_TRIGGER_PATTERN support.

Introduce support for the Pattern Trigger functionality, sometimes also
called Logic Trigger.

4 years agohameg-hmo: When setting slope, also set trigger type to edge.
Guido Trentalancia [Fri, 16 Nov 2018 17:47:15 +0000 (18:47 +0100)]
hameg-hmo: When setting slope, also set trigger type to edge.

When setting the type of slope for the edge trigger function, also set the
trigger type to edge because it is not necessarily configured that way and
therefore such functionality might fail to work properly!

This fixes parts of bug #1328.

4 years agohameg-hmo: Remove unused SCPI command enums, sort entries.
Guido Trentalancia [Fri, 16 Nov 2018 17:46:39 +0000 (18:46 +0100)]
hameg-hmo: Remove unused SCPI command enums, sort entries.

4 years agohameg-hmo: Add support for the HMO1202 MSO.
Guido Trentalancia [Fri, 16 Nov 2018 17:45:50 +0000 (18:45 +0100)]
hameg-hmo: Add support for the HMO1202 MSO.

4 years agohameg-hmo: Initial R&S RTC1000 MSO support attempt.
Guido Trentalancia [Fri, 16 Nov 2018 17:44:41 +0000 (18:44 +0100)]
hameg-hmo: Initial R&S RTC1000 MSO support attempt.

(might need testing)

4 years agohameg-hmo: Add support for SR_CONF_LOGIC_THRESHOLD/_CUSTOM.
Guido Trentalancia [Fri, 16 Nov 2018 17:43:55 +0000 (18:43 +0100)]
hameg-hmo: Add support for SR_CONF_LOGIC_THRESHOLD/_CUSTOM.

Update the Hameg/Rohde&Schwarz HMO driver (hameg-hmo) so that it
is possible to configure the logic threshold for digital signals.

The user can get or set the logic threshold configuration using
the channel group POD0 (and/or POD1 where available), for example:

sigrok-cli --driver hameg-hmo --get logic_threshold -g POD0
sigrok-cli --driver hameg-hmo --config logic_threshold=TTL --set -g POD0

sigrok-cli --driver hameg-hmo --get logic_threshold_custom -g POD0
sigrok-cli --driver hameg-hmo --config logic_threshold_custom=0.7 --set -g POD0

4 years agohameg-hmo: Update the default serial port options.
Guido Trentalancia [Fri, 16 Nov 2018 17:43:25 +0000 (18:43 +0100)]
hameg-hmo: Update the default serial port options.

Update the default serial port options for Rohde&Schwarz and
Hameg mixed-signal oscilloscope devices connected through USB.

Also, remove misplaced and unused serial port configuration option.

This patch complements fa3d104f17966dd66664f5ee1cccd05856a7e312
in terms of updating the USB PIDs for new devices (HMO series).

This fixes parts of bug #1321.

4 years agohameg-hmo: Try to find a valid serialcomm if none is supplied.
Guido Trentalancia [Fri, 16 Nov 2018 17:42:47 +0000 (18:42 +0100)]
hameg-hmo: Try to find a valid serialcomm if none is supplied.

If no serial port option is specified on the command-line using the
"serialcomm" driver option, but the device is connected through USB
and it requires a known default serial port option, then use it in
order to avoid data corruption or even worse problems.

Note: the easiest way to reproduce data corruption on HMO3000 series
is to start an analog data acquisition (e.g. on channel CH1) after
switching from Ethernet mode to USB VCP mode (HO732 USB/Ethernet interface).

This fixes parts of bug #1321.

4 years agohameg-hmo: Avoid getting stuck upon SCPI timeouts.
Guido Trentalancia [Fri, 16 Nov 2018 17:42:16 +0000 (18:42 +0100)]
hameg-hmo: Avoid getting stuck upon SCPI timeouts.

Correctly set the length of the buffer used to hold the SCPI response
from the device containing the binary acquisition data.

If a timeout occurs, truncate the buffer and send the partial response
from the device instead of getting stuck on timeouts!

Thanks to Stefan BrĂ¼ns for reviewing the first version of this patch
and spotting out a serious problem with it.

This fixes bug #1323.

4 years agohameg-hmo: Add SR_CONF_LIMIT_SAMPLES support.
Guido Trentalancia [Fri, 16 Nov 2018 17:41:30 +0000 (18:41 +0100)]
hameg-hmo: Add SR_CONF_LIMIT_SAMPLES support.

At the moment only the maximum number of frames to be acquired can be
configured for the Hameg/Rohde&Schwarz HMO mixed-signal oscilloscope
series driver (hameg-hmo).

This patch adds support to configure the number of samples to acquire
in both analog and digital (logic) mode.

4 years agohameg-hmo: Add support for 16 digital (logic) channels.
Guido Trentalancia [Fri, 16 Nov 2018 17:39:59 +0000 (18:39 +0100)]
hameg-hmo: Add support for 16 digital (logic) channels.

This patch introduces the support for 16 digital (logic) channels for the
following oscilloscope models: HMO3032, HMO3042, HMO3052 and HMO3522
(previously only 8 digital channels were supported, i.e. only 1 POD).

4 years agohameg-hmo: Remove invalid HMO2522, add missing HMO3522.
Guido Trentalancia [Fri, 16 Nov 2018 17:39:36 +0000 (18:39 +0100)]
hameg-hmo: Remove invalid HMO2522, add missing HMO3522.

This patch takes care of removing an invalid product model (HMO2522)
and adds a missing product model (HMO3522) in the hameg-hmo driver,
thus extending the number of supported oscilloscope models.

This fixes bug #1322.

4 years agohameg-hmo: Use g_byte_array_free() instead of g_free().
Guido Trentalancia [Fri, 16 Nov 2018 17:38:54 +0000 (18:38 +0100)]
hameg-hmo: Use g_byte_array_free() instead of g_free().

Use the appropriate glib function to free memory (byte array).

This fixes bug #1324.

4 years agoUpdate the pkg-config (.pc) entry for libsigrok.
Guido Trentalancia [Fri, 16 Nov 2018 17:49:19 +0000 (18:49 +0100)]
Update the pkg-config (.pc) entry for libsigrok.

4 years agostd: std_gvar_tuple_array/_rational: Fix GVariantBuilder type.
Guido Trentalancia [Sun, 18 Nov 2018 23:01:04 +0000 (00:01 +0100)]
std: std_gvar_tuple_array/_rational: Fix GVariantBuilder type.

Fix the type of container used to initialize the GVariantBuilder
structure which builds an array of tuples.

4 years agohantek-4032l: Fix broken triggering on low signal.
Uwe Hermann [Sat, 6 Jul 2019 21:22:47 +0000 (23:22 +0200)]
hantek-4032l: Fix broken triggering on low signal.

The trigger range/mask "compression" procedure is apparently not
required and breaks triggering on a low line state.

This has been verified to fix the issue on a Hantek 4032L with FPGA
version 0x4303. It is possible that the procedure mentioned above
might be required for other FPGA versions, though that is unknown.

If you experience trigger issues with other FPGA versions, please
contact us for further debugging and testing.

This fixes bug #1402.

4 years agohantek-4032l: Cosmetics.
Uwe Hermann [Sat, 6 Jul 2019 21:21:22 +0000 (23:21 +0200)]
hantek-4032l: Cosmetics.

4 years agorigol-ds: Add Agilent DSO1000B series IDs
Nadav Mavor [Sun, 23 Jun 2019 02:41:46 +0000 (22:41 -0400)]
rigol-ds: Add Agilent DSO1000B series IDs

4 years agoscpi-pps: Support HP 66312a
Mike Walters [Tue, 2 Jul 2019 23:00:09 +0000 (00:00 +0100)]
scpi-pps: Support HP 66312a

4 years agobindings: Avoid "using namespace" in headers.
Daniel Anselmi [Wed, 30 Jan 2019 11:27:23 +0000 (12:27 +0100)]
bindings: Avoid "using namespace" in headers.

This fixes bug #1354.

4 years agoudev: Add Siglent SDS1104X-E VID/PID.
Uwe Hermann [Sun, 30 Jun 2019 17:06:46 +0000 (19:06 +0200)]
udev: Add Siglent SDS1104X-E VID/PID.

This fixes bug #1357.

4 years agoserial_hid: Don't print empty strings, [aaaa.bbbb] VID/PID format.
Uwe Hermann [Thu, 20 Jun 2019 16:16:31 +0000 (18:16 +0200)]
serial_hid: Don't print empty strings, [aaaa.bbbb] VID/PID format.

4 years agostd: Factor out std_dummy_set_params().
Uwe Hermann [Thu, 20 Jun 2019 15:50:35 +0000 (17:50 +0200)]
std: Factor out std_dummy_set_params().

4 years agodmm/bm86x: unbreak temperature modes (two probes and no probes)
Gerhard Sittig [Thu, 20 Jun 2019 09:53:36 +0000 (11:53 +0200)]
dmm/bm86x: unbreak temperature modes (two probes and no probes)

The Brymen BM86x supports up to two temperature probes. The dual display
can show individual temperatures of the two probes or differences. The
previous implementation "detected" a value of zero degrees when no probe
was attached and the display showed dash lines. When cycling assignments
of probes to displays, some valid combinations did not result in values
shown by the libsigrok driver.

An implementation detail of the formerly separate brymen-bm86x driver
was lost during recent migration of the dmm/bm86x parser into the
serial-dmm driver. When the meter's temperature function is selected,
it's essential to inspect the primary display's flags and digits, to
determine the secondary display's quantity and unit. Previous versions
never bothered to explicitly check for the "----" digits text, but the
combination of the primary's last digit showing C/F as well as the
binary C/F flags before the value provided hints which the secondary
displays group of digits and flags did not.

This fixes bug #1394.

4 years agodmm/bm86x: drop local packet dump, already done in serial-dmm
Gerhard Sittig [Thu, 20 Jun 2019 12:46:22 +0000 (14:46 +0200)]
dmm/bm86x: drop local packet dump, already done in serial-dmm

4 years agodoc: update README.devices, victor-dmm has moved into serial-dmm
Gerhard Sittig [Thu, 20 Jun 2019 09:41:03 +0000 (11:41 +0200)]
doc: update README.devices, victor-dmm has moved into serial-dmm

4 years agoserial_hid: make --list-serial output compatible with conn=, print "VID.PID"
Gerhard Sittig [Thu, 20 Jun 2019 09:06:22 +0000 (11:06 +0200)]
serial_hid: make --list-serial output compatible with conn=, print "VID.PID"

When the list of all connections gets created which are supported by the
HID serial transport, items contain a "hid/ch9325/raw=/dev/hidraw3" path
and a "1a86:e008" pair of vendor and product IDs.

Separate the VID/PID pair by a period not a colon, so that --list-serial
output immediately becomes usable with "--driver <name>:conn=<spec>"
invocations. Eliminate the necessity to adjust clipboard context by the
user. This improves usability in cases where not a single connection
gets addressed, but a group of connections gets specified by ambiguous
conn= specs.

$ sigrok-cli -d uni-t-ut32x:conn=1a86.e008 --scan

4 years agoserial_hid: address constness nits
Gerhard Sittig [Tue, 18 Jun 2019 16:57:44 +0000 (18:57 +0200)]
serial_hid: address constness nits

4 years agoserial-lcr: add support for packet request
Gerhard Sittig [Mon, 17 Jun 2019 20:59:25 +0000 (22:59 +0200)]
serial-lcr: add support for packet request

Some meters require the reception of a request before they provide
acquisition data. Add support for the chip driver's .packet_request()
routine, and timeout handling in the serial-lcr driver. This follows
the serial-dmm model.

4 years agoserial-lcr: add support for chip specific channel names
Gerhard Sittig [Mon, 17 Jun 2019 20:51:36 +0000 (22:51 +0200)]
serial-lcr: add support for chip specific channel names

Allow LCR chip drivers to specify custom printf() formats for their
channel names. Default to "P1" etc in the absence of format specs.
This implementation is similar to serial-dmm.

4 years agolcr/es51919: minor style nits in the ES51919 packet parser
Gerhard Sittig [Mon, 17 Jun 2019 20:44:44 +0000 (22:44 +0200)]
lcr/es51919: minor style nits in the ES51919 packet parser

Use macros for frequency constants. They hopfully are more readable than
large number literals with their magnitude being not as apparent.

4 years agodmm/eev121gw: visibility nits (single display parse routine)
Gerhard Sittig [Mon, 17 Jun 2019 20:40:26 +0000 (22:40 +0200)]
dmm/eev121gw: visibility nits (single display parse routine)

The EEVBlog 121GW meter support always registers the three-displays
parse routine with the serial-dmm device driver. The single-display
routine need not be public. Adjust the visibility.

Reduce indentation for a continued line in a nearby declaration
while we are here.

4 years agoipdbg-la: Fix an issue when capture rate is 100%.
Daniel Anselmi [Thu, 20 Jun 2019 12:19:57 +0000 (14:19 +0200)]
ipdbg-la: Fix an issue when capture rate is 100%.

If the capture ratio was set to 100%, the delay counter-value has an
overflow and a delay of 0 samples is used.

This fixes bug #1393.

4 years agoserial: Shorten a few code snippets.
Uwe Hermann [Sat, 15 Jun 2019 15:35:42 +0000 (17:35 +0200)]
serial: Shorten a few code snippets.

4 years agoserial_hid.h: Update SER_HID_CHUNK_SIZE comment.
Uwe Hermann [Sat, 15 Jun 2019 15:17:52 +0000 (17:17 +0200)]
serial_hid.h: Update SER_HID_CHUNK_SIZE comment.

4 years agoudev: Split SiLabs CP210x/CP2110 items, mention more devices.
Uwe Hermann [Sat, 15 Jun 2019 14:39:55 +0000 (16:39 +0200)]
udev: Split SiLabs CP210x/CP2110 items, mention more devices.

4 years agoserial-lcr: Replace duplicated std_session_send_frame_end().
Uwe Hermann [Sat, 15 Jun 2019 13:54:48 +0000 (15:54 +0200)]
serial-lcr: Replace duplicated std_session_send_frame_end().

4 years agoconfigure.ac: Clarify/fix some pkg-config package names.
Uwe Hermann [Sat, 15 Jun 2019 13:52:22 +0000 (15:52 +0200)]
configure.ac: Clarify/fix some pkg-config package names.

4 years agoEliminate VID_PID_TERM in favor of ALL_ZERO.
Uwe Hermann [Sat, 15 Jun 2019 13:45:12 +0000 (15:45 +0200)]
Eliminate VID_PID_TERM in favor of ALL_ZERO.

4 years agoftdi-la: Fix VID/PID format in a log message.
Uwe Hermann [Thu, 13 Jun 2019 22:15:24 +0000 (00:15 +0200)]
ftdi-la: Fix VID/PID format in a log message.

Before: 0x 403:0x6001
After:  0x0403:0x6001

4 years agoftdi-la: do enter the error path upon VID:PID mismatch
Gerhard Sittig [Wed, 12 Jun 2019 21:58:24 +0000 (23:58 +0200)]
ftdi-la: do enter the error path upon VID:PID mismatch

Bug #1390 reports that "!desc" is always true (should be: false?). But
the actual problem would be that 'desc' is _not_ NULL when none of the
supported chips' VID:PID matched (FT232H happens to "get found" then,
erroneously).

Add a sentinel to the table of supported chips, such that 'desc' becomes
NULL upon mismatch, and the error path is entered.

4 years agoserial-dmm: rename victor-dmm-ser entry, default to USB HID cable
Gerhard Sittig [Tue, 11 Jun 2019 16:56:04 +0000 (18:56 +0200)]
serial-dmm: rename victor-dmm-ser entry, default to USB HID cable

The serial-dmm entry for Victor DMMs is able to communicate to either
geniune COM ports (RS232 or USB CDC) or the obfuscating USB HID cables.
The victor-dmm driver became obsolete and was removed. Rename the
serial-dmm entry, remove the no longer needed "-ser" suffix. Suggest a
default connection via the obfuscating USB HID cable, accept user
provided overrides for regular serial cables (same behaviour as before,
connection spec for serial ports keeps being mandatory).

4 years agovictor-dmm: remove obsolete device driver, has moved to serial-dmm
Gerhard Sittig [Thu, 9 May 2019 16:11:07 +0000 (18:11 +0200)]
victor-dmm: remove obsolete device driver, has moved to serial-dmm

Remove the victor-dmm device driver. Its functionality is contained in
the Victor specific serial-over-HID transport, the FS9922 DMM parser,
and the serial-dmm device driver. The additional implementation became
obsolete.

4 years agoserial-hid: add support for (scrambling) Victor DMM cables
Gerhard Sittig [Mon, 10 Jun 2019 18:15:24 +0000 (20:15 +0200)]
serial-hid: add support for (scrambling) Victor DMM cables

Introduce a serial transport which undoes the Victor DMM cable's
obfuscation to the DMM chip's original data packet. Which allows to
re-use the existing FS9922 support code, obsoleting the victor-dmm
device driver.

4 years agouni-t-ut32x: don't provide a default conn= spec in the driver source
Gerhard Sittig [Sun, 9 Jun 2019 16:28:48 +0000 (18:28 +0200)]
uni-t-ut32x: don't provide a default conn= spec in the driver source

This undoes the essence of commit bf700f679af2, which introduced the
default conn= spec. Which improved usability: Users just select the
device and need not specify the connection. But also resulted in the
UT32x thermometer driver's probe to "succeed" as soon as the WCH CH9325
chip was found, no data check was involved in the scan. Unfortunately
this chip is also used in the popular UT-D04 cable, and thus there were
many false positives.

4 years agobrymen-bm86x: retire libusb using driver, has moved to serial-dmm
Gerhard Sittig [Sun, 9 Jun 2019 08:48:21 +0000 (10:48 +0200)]
brymen-bm86x: retire libusb using driver, has moved to serial-dmm

Remove the src/hardware/brymen-bm86x/ hierarchy of source files. Its
functionality has moved to the bm86x packet parser and the serial-dmm
device driver.

4 years agoserial-dmm: bm86x: increase packet request frequency
Gerhard Sittig [Sun, 9 Jun 2019 15:03:31 +0000 (17:03 +0200)]
serial-dmm: bm86x: increase packet request frequency

Request packets from the Brymen BM86x meter much faster. The previous
implementation in the separate driver used to immediately send another
request when a measurement arrived, with a 10ms granularity in the poll
routine, and a 500ms timeout between requests.

Considering the meter's update rate, stick with the 500ms timeout, but
increase the maximum request rate to 10 per second, with a minimum of 2
per second. This receives measurement data at the meter's capability
(compare DC and AC modes, seems to automatically adjust to the internal
operation, and match the display update rate).

4 years agodmm/bm86x: add Brymen BM86x packet parser, register with serial-dmm
Gerhard Sittig [Sun, 9 Jun 2019 07:03:22 +0000 (09:03 +0200)]
dmm/bm86x: add Brymen BM86x packet parser, register with serial-dmm

Move Brymen BM86x specific packet parse logic to a new src/dmm/bm86x.c
source file, and register the routines with the serial-dmm driver's list
of supported devices. Which obsoletes the src/hardware/brymen-bm86x/
hierarchy.

This implementation differs from the previous version: The parse routine
gets called multiple times after one DMM packet was received. Values for
the displays get extracted in separate invocations, the received packet
is considered read-only. Unsupported LCD segment combinations for digits
get logged. Low battery gets logged with higher severity -- the validity
of measurement values is uncertain after all. The parse routine uses
longer identifiers. Packet reception uses whichever serial transport is
available (need no longer be strictly USB HID nor libusb based). All
features of the previous implementation are believed to still be present
in this version.

This configuration queries measurement values each 0.5 seconds and
re-sends a not responded to request after 1.5 seconds. Which follows the
combination of the vendor's suggested flow (frequency) and the previous
implementation's timeout (3x 500ms). This implementation does not try to
re-connect to the HID device for each measurement, and neither checks
for the 4.0 seconds timeout (vendor's suggested flow). Local experiments
work without these.

4 years agobrymen-bm86x: rename specific Brymen BM86x driver (libusb implementation)
Gerhard Sittig [Sun, 9 Jun 2019 08:15:37 +0000 (10:15 +0200)]
brymen-bm86x: rename specific Brymen BM86x driver (libusb implementation)

The src/hardware/brymen-bm86x/ source code contains specific support for
the Brymen BM86x devices, and directly depends on the libusb library.
Rename the registered device (append the "-usb" suffix) before adding
BM86x support to the serial-dmm driver.

4 years agoserial-hid: introduce support for Brymen BU-86X IR adapters
Gerhard Sittig [Sun, 9 Jun 2019 06:25:54 +0000 (08:25 +0200)]
serial-hid: introduce support for Brymen BU-86X IR adapters

The Brymen BU-86X infrared adapters are sold with BM869s meters. Raw
streams of data bytes get communicated by means of HID reports with
report number 0 and up to 8 data bytes each. Communication parameters
are fixed and need no configuration.

4 years agoserial-dmm: add support for default connections (USB cables)
Gerhard Sittig [Sun, 9 Jun 2019 08:34:51 +0000 (10:34 +0200)]
serial-dmm: add support for default connections (USB cables)

Some meters which are supported by the serial-dmm driver don't strictly
require the user's COM port specification. When a known (usually bundled,
or even builtin) cable type is used, we can provide a default conn= spec
and thus improve usability. Prepare the DMM_CONN() macro, accept user
overrides.

4 years agoserial-dmm: fixup 'conn' vs 'serialcomm' confusion
Gerhard Sittig [Sun, 9 Jun 2019 08:18:52 +0000 (10:18 +0200)]
serial-dmm: fixup 'conn' vs 'serialcomm' confusion

The 'conn' field in the device context and the CONN values in the
declarations of supported DMM models seemed inappropriate. They specify
the communication parameters (UART frame format and bitrate), not the
connection (port name). Adjust the respective identifiers.

Also rephrase the evaluation logic. Instead of checking for the absence
of user specs and optionally assigning a fallback value, just preset
from defaults and override from user specs when present. This simplifies
the logic (eliminates a check).

4 years agoserial-dmm: alpha-sort check for devices with multiple displays
Gerhard Sittig [Sun, 9 Jun 2019 07:55:39 +0000 (09:55 +0200)]
serial-dmm: alpha-sort check for devices with multiple displays

4 years agobluetooth: silence compiler warning (missing writev(2) declaration)
Gerhard Sittig [Sat, 8 Jun 2019 12:15:20 +0000 (14:15 +0200)]
bluetooth: silence compiler warning (missing writev(2) declaration)

4 years agoserial-lcr: move device driver code from src/lcr/ to src/hardware/
Gerhard Sittig [Wed, 1 May 2019 20:01:48 +0000 (22:01 +0200)]
serial-lcr: move device driver code from src/lcr/ to src/hardware/

Keep the ES51919 chip support in the src/lcr/ directory, and move device
driver specific code to the src/hardware/serial-lcr/ directory. Implement
the same driver layout for LCR meters as is used for DMM devices.

This also addresses a few issues in the serial-lcr driver: Unbreak --get
and --show, do process a few LCR packets after probing the device, to
gather current parameter values. Keep sending meta packets when these
parameters change during acquisition, like the previous implementation
did. Use common code for frame/time limits.

Note that although LCR meters usually operate with AC to classify L/C/R
components, one of the officially supported modes is DC resistance.
Which means that an output frequency of 0 is not just a fallback when
packet parsing fails, it's also a regular value of the freq parameter.
List all supported frequencies including DC in strict numerical order.

Although all currently supported devices use the same ES51919 chip, the
implementation is prepared to support other devices which use different
LCR meter chips as well. The list of known equivalent circuit models and
output frequencies is kept in src/lcr/ chip support. It's assumed that
one LCR packet communicates the data for all channels/displays similar
to the serial-dmm driver implementation.

4 years agosw_limits: add support for maximum frame counts
Gerhard Sittig [Wed, 1 May 2019 19:26:11 +0000 (21:26 +0200)]
sw_limits: add support for maximum frame counts

4 years agooutput: also print meta strings in analog output module
Gerhard Sittig [Wed, 1 May 2019 18:28:50 +0000 (20:28 +0200)]
output: also print meta strings in analog output module

Meta packets not only communicate numbers, but also strings. Print them.
This unbreaks the reflection of LCR meters' equivalent circuit model.

4 years agoserial-dmm: drop obsolete redundant 'baudrate' parameter value
Gerhard Sittig [Wed, 1 May 2019 18:23:48 +0000 (20:23 +0200)]
serial-dmm: drop obsolete redundant 'baudrate' parameter value

The serial communication timing parameters during probe get determined
from earlier serial port configuration, which obsoletes the redundant
'baudrate' parameter, and eliminates potential inconsistency between
user specified parameters and builtin default values.

4 years agokern-scale: drop obsolete redundant 'baudrate' parameter value
Gerhard Sittig [Wed, 1 May 2019 18:11:46 +0000 (20:11 +0200)]
kern-scale: drop obsolete redundant 'baudrate' parameter value

The serial communication timing parameters during probe get determined
from earlier serial port configuration, which obsoletes the redundant
'baudrate' parameter, and eliminates potential inconsistency between
user specified parameters and builtin default values.

4 years agoserial: use timeout API in stream detect, obsoletes bitrate param
Gerhard Sittig [Wed, 1 May 2019 17:50:01 +0000 (19:50 +0200)]
serial: use timeout API in stream detect, obsoletes bitrate param

The serial_stream_detect() routine needs to estimate the time which is
needed to communicate a given amount of data. Since the serial port got
opened and configured before, the serial communication parameters are
known, and callers need not redundantly specify the bit rate.

4 years agoserial: add support for optional "RX chunk" callback
Gerhard Sittig [Wed, 3 Apr 2019 05:52:00 +0000 (07:52 +0200)]
serial: add support for optional "RX chunk" callback

The previous implementation provided a raw input stream of RX data from
read() calls to device drivers. This works great with genuine COM ports,
as well as with most setups which involve simple "cable expanders".

Recent additions of alternative transports (serial over HID and BLE)
added more protocol layers to the setup, and some device drivers are
reported to depend on the very framing of these transports: Mooshimeter
cares about individual BLE notification "frames", and the information
cannot get derived from the payload bytes. Some HID based cables which
obscure the DMM chips' serial protocol, or some HID based setups which
the serial layer does not abstract away as "a cable" may suffer from
similar requirements (do some drivers require access to individual HID
reports? Ikalogic? Victor DMM?).

Add support for an optional "RX chunk callback" which takes precedence
over "mere payload byte streams". Instead of returning payload bytes
from read() calls, the serial layer can call an application defined
routine and pass data bytes in the very framing which the physical
transport happens to use.

It's still up to the implementation of the specific transport whether
the callback approach is supported, and whether the wire's framing is
obeyed or whether payload data keeps getting provided as one raw stream.
It's also implementation dependent whether data reception transparently
occurs in background, or whether callers need to periodically "stimulate"
data reception by calling read or check routines which happen to call
back into the caller should RX data become available.

The approach that got implemented here is not universally applicable,
but serves those specific environments that were identified so far.

4 years agoudev: drop links to device/cable wiki pages from udev rule set
Gerhard Sittig [Sun, 2 Jun 2019 08:22:59 +0000 (10:22 +0200)]
udev: drop links to device/cable wiki pages from udev rule set

4 years agoudev: mark SiLabs CP2102 as generic, add SiLabs CP2110
Gerhard Sittig [Sat, 4 May 2019 08:20:21 +0000 (10:20 +0200)]
udev: mark SiLabs CP2102 as generic, add SiLabs CP2110

The CP210x USB to UART bridge is not specific to CEM DT-8852, it's a
generic bridge chip that is also used in other cables and devices. Add
the CP2110 USB HID to UART bridge that is found in UNI-T cables and
devices, and reported to also be used in Voltcraft devices.

4 years agoudev: add 'hidraw' subsystem to 60-libsigrok.rules
Gerhard Sittig [Sat, 4 May 2019 07:59:15 +0000 (09:59 +0200)]
udev: add 'hidraw' subsystem to 60-libsigrok.rules

WCH CH9325 and SiL CP2110 chips (and other HID cables) won't match the
currently used 'usb' subsystem when the platform registers these as
'hidraw' devices. Adjust the 60-libsigrok.rules SUBSYSTEM condition.

4 years agodoc: discuss how to enable PC communication on LCR meters
Gerhard Sittig [Mon, 27 May 2019 17:04:48 +0000 (19:04 +0200)]
doc: discuss how to enable PC communication on LCR meters

4 years agodoc: outline conn= specs for HID and Bluetooth in README.devices
Gerhard Sittig [Tue, 30 Apr 2019 18:33:14 +0000 (20:33 +0200)]
doc: outline conn= specs for HID and Bluetooth in README.devices

Add more examples of conn= specs for HID and Bluetooth devices to the
section which discusses COM ports. Outline the formal syntax and its
optional fields. Discuss how colons in device addresses interfere with
"-d <drv>:conn=<spec>" environments.

4 years agodoc: update README, optional conn= specs for UNI-T meters
Gerhard Sittig [Wed, 4 Oct 2017 14:21:06 +0000 (15:21 +0100)]
doc: update README, optional conn= specs for UNI-T meters

Recent adjustment in the libsigrok serial layer changed whether conn=
specs are mandatory or optional for some of the UNI-T meters.

4 years agodoc: update README for serial over Bluetooth
Gerhard Sittig [Sun, 30 Dec 2018 18:18:10 +0000 (19:18 +0100)]
doc: update README for serial over Bluetooth

Mention the optional external BlueZ dependency. Provide conn= examples
for Bluetooth communication. Mention the UT-D07 adapter.

4 years agoserial_bt: implement the serial over Bluetooth transport (conn=bt/...)
Gerhard Sittig [Thu, 27 Dec 2018 21:12:20 +0000 (22:12 +0100)]
serial_bt: implement the serial over Bluetooth transport (conn=bt/...)

Introduce the serial_bt.c source file which implements the methods of a
serial transport and calls into the platform agnostic src/bt/ support
code.

Implement support for several chips and modules: RFCOMM (BT classic,
tested with HC-05), BLE122 (tested with 121GW), Nordic nRF51, and TI
CC254x (the latter untested). Read support is assumed to be complete,
write support for BLE may be incomplete due to lack of access to
hardware for tests.

4 years agobluetooth: introduce Bluetooth communication API, implement BlueZ support
Gerhard Sittig [Sun, 30 Dec 2018 19:46:51 +0000 (20:46 +0100)]
bluetooth: introduce Bluetooth communication API, implement BlueZ support

Create a src/bt/ subdirectory for source files. Declare a platform
agnostic internal API for Bluetooth communication, and provide an
implementation of that portable API when the BlueZ library is available.

This implementation assumes that HAVE_BLUETOOTH and HAVE_LIBBLUEZ can be
used interchangeably, which is true for this initial version. When
support for other platforms gets added, the common and the specific
parts need to get sorted. Trying that now would involve guessing. :)

4 years agobuild: prepare serial over Bluetooth, search for optional BlueZ lib
Gerhard Sittig [Thu, 27 Dec 2018 13:22:34 +0000 (14:22 +0100)]
build: prepare serial over Bluetooth, search for optional BlueZ lib

Adding Bluetooth communication is desirable for all sigrok supported
platforms. The BlueZ library is available on Linux which will receive
support first. Check for the BlueZ library's presence, determine a
HAVE_BLUETOOTH summary state, and extend the HAVE_SERIAL_COMM check.
Print version details for the external library.

This commit extends build support and version information, but does not
yet include the implementation of the serial transport primitives.

4 years agodoc: mention serial-over-HID in README.devices (UT-D09 cable)
Gerhard Sittig [Sat, 18 Mar 2017 13:08:44 +0000 (14:08 +0100)]
doc: mention serial-over-HID in README.devices (UT-D09 cable)

4 years agoserial-lcr: add driver item for the UNI-T UT612 model
Gerhard Sittig [Sun, 28 May 2017 06:39:19 +0000 (08:39 +0200)]
serial-lcr: add driver item for the UNI-T UT612 model

Register another driver for the UNI-T UT612 LCR meter, which is based on the
ES51919/ES51920 chipset, too. This device had been usable before when the
internal UART connection was made accessible (read: with a hack). It became
officially supported in unmodified form with the addition of transparent
serial over HID support for SiLabs CP2110 chips.

4 years agouni-t-ut32x: migrate from USB transfers to serial-over-HID communication
Gerhard Sittig [Fri, 6 Oct 2017 00:52:29 +0000 (01:52 +0100)]
uni-t-ut32x: migrate from USB transfers to serial-over-HID communication

Switch the UT32x driver from running specific USB transfers to generic
serial communication. Preset the bitrate and frame format, but allow for
user specified overrides as well. Default to the WCH CH9325 HID chip,
but allow for overrides or more specific selection so that users can
resolve ambiguities with multiple cables.

The switch from libusb to hidapi removes a limitation that specifically
was reported for the Mac platform. The serial-over-HID variant should
now work as well. See bug #555.

Drop the background transfers. Stick with a local acquisition stop
routine, because a STOP request needs to get sent to the device. Reduce
the receive buffer size such that either blocking or non-blocking calls
will work. The additional flexibility of the buffer handling and packet
processing does not harm.

4 years agoserial_hid: add support for the SiLabs CP2110 chip (UT-D09, UT612)
Gerhard Sittig [Sat, 30 Sep 2017 16:29:55 +0000 (18:29 +0200)]
serial_hid: add support for the SiLabs CP2110 chip (UT-D09, UT612)

Also reported to be seen in Voltcraft devices (VC-650, VC-890).

4 years agoserial_hid: add support for the WCH CH9325 chip (UT-D04 cables, UT32x)
Gerhard Sittig [Wed, 15 Mar 2017 21:28:21 +0000 (22:28 +0100)]
serial_hid: add support for the WCH CH9325 chip (UT-D04 cables, UT32x)

4 years agoserial_hid: implement serial over HID transport
Gerhard Sittig [Fri, 17 Mar 2017 21:39:46 +0000 (22:39 +0100)]
serial_hid: implement serial over HID transport

Do implement the transport methods for serial communication underneath
the common layer, by communicating HID requests and payload data by
means of HIDAPI library calls.

This commit adds the common logic of serial-over-HID communication and
implements the full internal serial transport API, including reception
in the background. But it does not yet support a single HID chip (which
each run their own proprietary protocol).

The implementation works with either hidapi-libusb or hidapi-hidraw
variant of the HIDAPI library, but was only tested on Linux.

4 years agoserial: prepare serial over HID in common layer and build support
Gerhard Sittig [Sun, 26 Mar 2017 14:48:36 +0000 (15:48 +0100)]
serial: prepare serial over HID in common layer and build support

Search for the optional HIDAPI library. Call the library's init and exit
routine, and print version information. Extend the common serial layer's
code paths for open, list, and find USB to also support serial over HID.

This commit prepares serial over HID, but the HIDAPI specific transport
for serial communication still is empty in this implementation.

4 years agoserial: introduce local receive data buffer
Gerhard Sittig [Sat, 30 Sep 2017 12:10:10 +0000 (14:10 +0200)]
serial: introduce local receive data buffer

Add a local RX buffer to the common code of libsigrok's serial layer.
Callers of the serial layer's API won't notice, this is an internal
detail of how alternative transports receive their data from the
physical line, and pass it to read() calls emitted by device drivers.

The libserialport specific code still calls into the library, and does
not use the RX buffer. Future HID and BLE support will use the buffer.

4 years agoserial: make LCR, modbus, SCPI over serial depend on generic serial comm
Gerhard Sittig [Thu, 27 Dec 2018 13:29:00 +0000 (14:29 +0100)]
serial: make LCR, modbus, SCPI over serial depend on generic serial comm

Add guards around the implementation of ES51919 chip support for LCR, as
well as modbus and SCPI over serial. To accept when the source files get
compiled in the absence of their dependencies, end up with an empty
implementation in that case.

This approach can simplify build rules when several optional external
dependencies result in differing sets of supported communication means.

4 years agoserial: prepare for the absence of libserialport
Gerhard Sittig [Sun, 28 Jan 2018 17:07:38 +0000 (18:07 +0100)]
serial: prepare for the absence of libserialport

Only reference the libserialport header when the library is available.
Allow to always compile the serial.c source file, but optionally end
up with an empty implementation. Make the sr_serial_dev_inst symbol
available outside of HAVE_SERIAL_COMM such that empty stub code can
compile. This prepares the introduction of alternative transports for
serial communication, while all of them remain optional.

The libsigrok serial layer internally uses parity and flow control
symbols which are provided by libserialport. Optionally locally declare
these symbols when libserialport is not available.

4 years agoconfigure: make device drivers depend on "serial comm" not libserialport
Gerhard Sittig [Mon, 29 Apr 2019 16:57:04 +0000 (18:57 +0200)]
configure: make device drivers depend on "serial comm" not libserialport

A previous commit introduced the more generic "have serial communication"
condition, and adjusted the list of available libsigrok dependencies.

This commit adjusts device driver dependency declarations. This allows
to build e.g. DMM drivers in the presence of RFCOMM support but in the
absence of libserialport, because any of several optional external libs
can make serial communication available.

4 years agoserial: introduce more general "have serial comm" feature flag
Gerhard Sittig [Sun, 3 Jun 2018 04:34:27 +0000 (06:34 +0200)]
serial: introduce more general "have serial comm" feature flag

Introduce the HAVE_SERIAL_COMM identifier, which gets derived from, but
need not be identical to the HAVE_LIBSERIALPORT condition.

Derive the NEED_SERIAL automake condition from the general availability
of serial communication not the specific libserialport library.

Adjust source code references. Stick with HAVE_LIBSERIALPORT where the
specific library is meant, but switch to HAVE_SERIAL_COMM where the
availability of serial communication in general is meant.

4 years agoserial: prepare alternative transports for serial communication
Gerhard Sittig [Sat, 30 Sep 2017 23:21:08 +0000 (00:21 +0100)]
serial: prepare alternative transports for serial communication

Add an indirection between the common serial communication code and the
libserialport specific support code. Prepare the use of alternative
transports like USB HID in the future. Decide in the open() routine
which transport to use for subsequent operations (based on port names).

In theory only the transport specific layer depends on the libserialport
library's availability. In this implementation all support for serial
communication still depends on the HAVE_LIBSERIALPORT preprocessor
symbol. This needs to get addressed in later commits.

4 years agools: use serial layer's "has receive data" query
Gerhard Sittig [Sun, 3 Jun 2018 14:49:45 +0000 (16:49 +0200)]
ols: use serial layer's "has receive data" query

Eliminate a direct libserialport dependency in the OLS device driver.
Use libsigrok's internal serial layer's API instead to check for the
availability of receive data.

4 years agoserial: introduce "has receive data" query
Gerhard Sittig [Sun, 3 Jun 2018 10:17:09 +0000 (12:17 +0200)]
serial: introduce "has receive data" query

Add a serial_has_receive_data() routine to the serial layer's API which
returns the number of (known to be) available RX data bytes. Implement
support in the libserialport specific code.