From: Gerhard Sittig Date: Sat, 22 May 2021 11:54:52 +0000 (+0200) Subject: scpi-pps: don't break SCPI devices when scanning for HP-IB devices X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7f0463840ab5d6a85daaa76850558d2b71e596cf;p=libsigrok.git scpi-pps: don't break SCPI devices when scanning for HP-IB devices Only scan for hpib-pps devices when a user provided conn= specification was given. This avoids breaking SCPI devices by emitting non-standard requests before reliable device identification. --- diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index ed9fbd9d..aa5b945a 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -254,6 +254,17 @@ static GSList *scan_scpi_pps(struct sr_dev_driver *di, GSList *options) static GSList *scan_hpib_pps(struct sr_dev_driver *di, GSList *options) { + const char *conn; + + /* + * Only scan for HP-IB devices when conn= was specified, to not + * break SCPI devices' operation. + */ + conn = NULL; + (void)sr_serial_extract_options(options, &conn, NULL); + if (!conn) + return NULL; + return sr_scpi_scan(di->context, options, probe_hpib_pps_device); }