From 7f0463840ab5d6a85daaa76850558d2b71e596cf Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Sat, 22 May 2021 13:54:52 +0200 Subject: [PATCH] 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. --- src/hardware/scpi-pps/api.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); } -- 2.30.2