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.
This commit is contained in:
Gerhard Sittig 2021-05-22 13:54:52 +02:00
parent d822f54d52
commit 7f0463840a
1 changed files with 11 additions and 0 deletions

View File

@ -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);
}