Bug 1589 - SR_CONF_CONN get value contains colons for SCPI over serial
Summary: SR_CONF_CONN get value contains colons for SCPI over serial
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Common: SCPI handling code (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-22 08:29 CEST by Gerhard Sittig
Modified: 2020-08-25 18:49 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Sittig 2020-08-22 08:29:42 CEST
This reproduces with SCPI over serial (USB CDC). During probe() the 
sdi->connection_id gets set to /dev/ttyUSB2, and "somewhere along 
the path" to sigrok-cli's config_get() call the value has changed to 
"/dev/ttyUSB2:115200/8n1". Which results in a conn= value that cannot 
be used for subsequent invocations. It's yet to get determined whether 
this is an issue in the library or in the application. I'd suspect the 
library since SCPI handling is concentrated there.

How to reproduce: 
  $ sigrok-cli -d scpi-dmm --scan 
  $ sigrok-cli -d scpi-dmm --show 
with a UART adapter which is covered by auto-scan, or gets specified 
in the -d option. Have noticed this during GWInstek GDM-8xxx development.

Source code eyeballing suggests that TCP could suffer from a similar issue, 
where colons get added to connection ID values.
Comment 1 Gerhard Sittig 2020-08-25 18:49:33 CEST
For the record here is the output as generated by the config getter and 
after some common code executed after the probe routine.

$ sigrok-cli --scan
sr: scpi-dmm: DIAG: probe_device() conn text: '/dev/ttyUSB2'
The following devices were found:
sr: scpi-dmm: DIAG: config_get() conn text: '/dev/ttyUSB2:115200/8n1'
scpi-dmm:conn=/dev/ttyUSB2:115200/8n1 - GWInstek GDM8341 1.04 with 1 channel: P1