Commit Graph

5020 Commits

Author SHA1 Message Date
Gerhard Sittig fbbf21dcf5 pickit2: avoid NULL dereference in close code path 2018-12-27 11:26:19 +01:00
Daniel Anselmi f3549a1ccf ipdbg-la: Check if limit samples is valid (leq size of ringuffer) 2018-12-27 11:26:02 +01:00
Martin Ling 942719b46c Don't reference SR_PACKAGE_VERSION_STRING directly in backend.c.
Reporting build versus runtime versions makes sense for a client,
but not inside the library itself.
2018-12-20 19:12:34 +01:00
Martin Ling 2868bca35b Don't reference SR_PACKAGE_VERSION_STRING directly in output modules. 2018-12-20 19:12:34 +01:00
Uwe Hermann 3f34a40268 drivers: Make per-driver sr_dev_driver structs static. 2018-12-20 17:29:36 +01:00
Uwe Hermann 3aadf5c479 microchip-pickit2: Drop unneeded prefix. 2018-12-20 16:36:09 +01:00
Uwe Hermann e760f2cdaf microchip-pickit2: Minor cosmetics. 2018-12-20 16:36:09 +01:00
Gerhard Sittig bde6a99b33 microchip-pickit2: first driver implementation (acquisition works, triggers don't)
Fill in the scan, open/close, get/set/list, acquisition start/stop logic
such that data acquisition with a PICkit2 works.

Trigger support needs more attention. User specified triggers either
seem to not take effect, or the trigger position is not in the expected
location. It's yet to get determined what's the issue.

This implementation is based on protocol information gathered from the
pk2-la project.
2018-12-20 16:19:42 +01:00
Gerhard Sittig a5c0259c4a microchip-pickit2: Initial driver skeleton. 2018-12-20 16:19:42 +01:00
Gerhard Sittig d9a3c0b749 brymen-bm86x: drop redundant free call, fixup channel index
Remove a free() call in an error path for a list which immediately
before the call was determined to be NULL. Use index 0 and 1 for
channels P1 and P2 respectively (the previous implementation used 0
for both channels).
2018-12-20 16:19:42 +01:00
Gerhard Sittig 2887799404 scpi-dmm: run OPC queries immediately before essential commands
The current implementation of the SCPI DMM driver is conservative about
checking the device's being operational, but the *OPC? queries are found
in unfortunate locations. Run the OPC query right before running the
next "actual" command, not afterwards. And certainly not between sending
requests and potentially gathering responses in subsequent calls.

This commit does not change current behaviour, but improves maintenance
before pending commits.
2018-11-17 20:19:13 +01:00
Gerhard Sittig 08f3b427b6 scpi-dmm: return MQ table entry to "get MQ" routine callers
The "get MQ" helper routine communicates SCPI responses and translates
them to internal "MQ and flag" values. Optionally return the MQ table
entry reference to callers, so they don't have to repeat the table
lookup when the function's default precision is required, or should
future "start acquisition" requests need to refer to the meter's current
function.
2018-11-17 20:19:13 +01:00
Gerhard Sittig 64d03de1c2 scpi-dmm: adjust MQ table for Agilent 34405A
Rename the table to reflect that it's model specific. Remove the 4-wire
resistance function which this device does not support.
2018-11-17 20:17:48 +01:00
Gerhard Sittig 1d2f9963ab scpi-dmm: add support for model specific device options
Supported SCPI DMM devices will differ in the set of options and whether
parameters can get queried or configured. Use a "generic" set of devopts
during scan and for simpler models, prepare support for other sets of
devopts for more complex models.
2018-11-17 20:08:59 +01:00
Gerhard Sittig 31e65c62ec scpi-dmm: accept serialcomm= scan options 2018-11-17 20:08:59 +01:00
Gerhard Sittig 21bc4353f0 scpi: alpha-sort the vendor alias list 2018-11-17 20:07:21 +01:00
Gerhard Sittig 49b6732ec5 scpi: add Keysight vendor alias 2018-11-17 20:07:21 +01:00
Gerhard Sittig 0617bb5a4e scpi-dmm: move declaration of local variable out of header file 2018-11-17 20:07:21 +01:00
Michał Janiszewski 3e33089b72 Remove always-false condition 2018-11-10 23:20:29 +01:00
Sven Bursch-Osewold 4905215909 Python-Binding: Added data array for logic packet payload 2018-11-10 23:20:16 +01:00
Gerhard Sittig 3cdad416e4 scpi-dmm: Implement support for Agilent 34405A, prepare others
Implement the scpi-dmm driver in such a generic way that it could work
with several protocol variants and with differing models which happen to
use any of these protocol variants. Prepare a list of supported models
with their respective SCPI command set, set of DMM functions and their
precision.

Add support for Agilent 34405A. The ten functions of this device got
tested and are operational, in continuous mode as well as with sample
count or capture time limits. The driver can query the current meter's
function, can change the function, and can run acquisitions in either
the current mode or with a user specified function selection. There is
some potential for improvement: AUTO/MIN/MAX/HOLD indicators are not
supported by this implementation.
2018-11-10 23:14:49 +01:00
Gerhard Sittig 7a396ff5c5 scpi-dmm: Initial driver skeleton. 2018-11-10 20:11:35 +01:00
Gerhard Sittig a1ce15d4a1 scpi: nit, use glib to determine string vector length
Replace a DIY length calculation with a glib call.
2018-11-10 20:11:35 +01:00
Gerhard Sittig a019bc48fd scpi: introduce string un-quote helper routine
The SCPI protocol may communicate strings in quoted form, enclosed by a
matching pair of single or double quote characters, and occurances of
this very quote character within the string get doubled (escaped). Add a
common routine to undo the quotes.
2018-11-10 18:26:30 +01:00
Gerhard Sittig c10b0276da fluke-45: fix minor memory leaks in the probe routine
Free the SCPI hardware info after successful model detection, too. Only
allocate the device instance when a supported model was found. Link the
device context earlier right after allocation, for easier verification.
2018-11-10 18:26:30 +01:00
Gerhard Sittig 71db2d4d06 fluke-45: disable ECHO test, it confuses other SCPI devices
Disable the ECHO test in the Fluke 45 probe routine which violates the
SCPI protocol and makes other devices unavailable. This fixes bug #1272.
2018-11-10 18:26:30 +01:00
Gerhard Sittig 712f7d5e40 fluke-45: avoid NULL dereference in the probe routine
The Fluke 45 probe routine tries to detect whether the serial port is
"in echo mode" (which already is questionable before the IDN query).
In the absence of a response, the library segfaults. Fix it.
2018-11-10 18:26:30 +01:00
Gerhard Sittig 88c03eae85 README.devices: add example for -d driver:conn=usbtmc/bus.addr 2018-11-10 18:26:30 +01:00
Jon Burgess 3940abcb47 Free list returned by sr_session_dev_list()
==214948== 16 bytes in 1 blocks are definitely lost in loss record 161 of 6,440
==214948==    at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==214948==    by 0x650F435: g_malloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214948==    by 0x6527056: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214948==    by 0x65284B0: g_slist_copy_deep (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214948==    by 0x592BBA6: sr_session_dev_list (session.c:402)
==214948==    by 0x56EF7B5: sigrok::Session::Session(std::shared_ptr<sigrok::Context>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (classes.cpp:932)

==214948== 16 bytes in 1 blocks are definitely lost in loss record 162 of 6,440
==214948==    at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==214948==    by 0x650F435: g_malloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214948==    by 0x6527056: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214948==    by 0x65284B0: g_slist_copy_deep (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214948==    by 0x592BBA6: sr_session_dev_list (session.c:402)
==214948==    by 0x56F1EB1: sigrok::Session::devices() (classes.cpp:967)
2018-10-22 00:02:40 +02:00
Uwe Hermann 827139ef49 siglent-sds: Consistently use gboolean/TRUE/FALSE. 2018-10-21 23:33:15 +02:00
Guido Trentalancia fa3d104f17 Additional USB PID for Rohde&Schwarz HMO series mixed-signal oscilloscopes
Add another possible USB PID for Rohde&Schwarz HMO series mixed-signal
oscilloscopes (previously branded Hameg).
2018-10-21 23:32:07 +02:00
Gerhard Sittig 0be955d23d dmm/eev121gw: drop an obsolete TODO comment (power measurement) 2018-10-18 19:18:46 +02:00
Gerhard Sittig 72b6f1c082 dmm/eev121gw: cosmetics, align ranges' scaling table entries
Align the scaling items such that all numbers are aligned. Drop unneeded
"prefixes" for the 2nd display's tables, the main and sub displays already
have their individual tables which reside in their respective groups.
2018-10-18 19:11:38 +02:00
Gerhard Sittig 39ea7b7d39 dmm/eev121gw: add missing scale items for sub display in power modes
Complete the voltage and current scale items for the sub display which
were incomplete for VA, mVA, and uVA power measurement modes before.
2018-10-18 19:08:50 +02:00
Uwe Hermann 59cae77e28 serial_stream_detect(): Make a code comment more generic. 2018-10-14 22:05:57 +02:00
Soeren Apel d10781808d demo: Fixup soft-trigger 2018-10-14 22:05:57 +02:00
luftek 6fc51fb1ee demo: Implement logic triggering.
Analog triggers and other items still need more work.
2018-10-14 21:37:40 +02:00
luftek 31f69b096f demo: Port trigger configuration from fx2lafw. 2018-10-14 21:37:30 +02:00
Uwe Hermann 07182332f0 Random whitespace/cosmetic/typo fixes. 2018-10-14 18:21:56 +02:00
Gerhard Sittig 015df4ae8f serial-dmm: add EEVblog 121GW device entry (-d eevblog-121gw:conn=<uart>)
Add an "eevblog-121gw" subdriver entry for the EEVblog 121GW multimeter.
Use device dependent channel names instead of the default "P1" etc names.

It's assumed that the device's binary packet data is available at a COM
port. This means that an external BT to UART gateway is required until
BLE communication will be one of libsigrok's native connection types.
2018-10-14 18:21:56 +02:00
Gerhard Sittig 1c3098aae0 dmm/eev121gw: introduce parser for EEVblog 121GW 19-byte binary packets
Introduce the dmm/eev121gw.c source file with parse routines for the
EEVblog 121GW meter's 19-bytes binary packets. Get the values and MQ
properties of the device's several displays (main, sub, bar) in several
individual parse calls.

This commit introduces initial support for the device. Some of the modes
and features are untested, as are some of the device's ranges.
2018-10-14 18:21:56 +02:00
Thomas Weißschuh 388aa0fb6b Newer versions of Victor DMMs (at least for 86) contain a direct
Mini-USB port. This port speaks the FS9922 protocol.

Picture of Mini-USB version:
http://roastlogger.co.uk/coffee/roastlogger/victor86.html

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2018-10-14 17:43:34 +02:00
Uwe Hermann 023c6114c5 siglent-sds: Fix SR_CONF_AVERAGING/SR_CONF_AVG_SAMPLES handling. 2018-10-14 01:41:03 +02:00
marchelh c90065a949 siglent-sds: Add ESERIES device support.
Due to some SCPI command changes that Siglent made, the connection
failed due to the wrong commands being send to the device.

This might fix parts of bug #1242, though initial tests show that
further changes might be needed.

[Note: This commit consists of multiple squashed commits from
marchelh <marchelh@gmail.com> and various fixups and rebasing
operations by Uwe Hermann <uwe@hermann-uwe.de>]
2018-10-14 01:40:38 +02:00
Uwe Hermann 0540954d76 korad-kaxxxxp: Add Tenma 72-2540 V2.0/V2.1 support (untested).
The IDN strings were mentioned here:
https://github.com/kxtells/tenma-serial/issues/2
2018-10-13 17:26:47 +02:00
Gerhard Sittig e5fa47c1c9 serial: dump DMM packets during stream detection
Regular operation of serial DMM drivers optionally can dump packet bytes
after the intialization phase has synchronized to the stream. Failure to
synchronize to the stream left developers without a dump, which complicates
research what went wrong.

Do dump packet content while the serial_stream_detect() routine tries to
synchronize to the stream. Use the spew level since the dump occurs upon
every attempt, which translates to: every received byte until a valid
packet was seen (or the synchronization phase expired).
2018-10-13 15:57:01 +02:00
Gerhard Sittig 75aaf967e3 serial-dmm: print data bytes according to specific meter's packet length
The previous implementation always dumped 23 data bytes for received
packets. This could result in truncated diagnostics information, and/or
access to invalid buffer content.

Rephrase the packet dump routine such that the specific meter's exact
packet length gets dumped, and use the common hex dump support code.
2018-10-13 15:57:01 +02:00
Gerhard Sittig f1d0755b73 uni-t-dmm: use common hex dump helper routine 2018-10-13 15:57:01 +02:00
Gerhard Sittig d8bc7ca3e6 strutil: introduce hex dump routines (allocate a text buffer)
Introduce common support for hex dumps in the string util collection.
There are explicit allocation and release routines for the textual
representation of the data bytes, so that callers are free to chose
whether and how to decorate the dump and where to send the message.
2018-10-13 15:57:01 +02:00
Gerhard Sittig 08f8421a9e input/vcd: add channel list checks for file re-read
Keep (part of) previous results around when the VCD input module gets
reset, and check the header of the next import against previous runs to
avoid issues in applications. This addresses the VCD specific part of
bug #1241, and resolves the remaining part of bug #1306.
2018-10-13 15:17:51 +02:00