scpi-pps: don't fail acquisition start for devices with no CMD_SELECT_CHANNEL
For devices such as the HP 6632B the following invocation was failing due to scpi_cmd(sdi, SCPI_CMD_SELECT_CHANNEL, ...) returning SR_OK_CONTINUE. ./sigrok-cli -d scpi-pps:conn=/dev/ttyUSB0:serialcomm=9600/8n1 --continuous sr: session: sr_session_start: could not start an acquisition (not enough data to decide error status yet) Failed to start session.
This commit is contained in:
parent
bbc42811d0
commit
c1603f4574
|
@ -560,7 +560,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
|
|||
/* Prime the pipe with the first channel's fetch. */
|
||||
ch = next_enabled_channel(sdi, NULL);
|
||||
pch = ch->priv;
|
||||
if ((ret = select_channel(sdi, ch)) != SR_OK)
|
||||
if ((ret = select_channel(sdi, ch)) < 0)
|
||||
return ret;
|
||||
if (pch->mq == SR_MQ_VOLTAGE)
|
||||
cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
|
||||
|
|
|
@ -149,7 +149,7 @@ SR_PRIV int select_channel(const struct sr_dev_inst *sdi, struct sr_channel *ch)
|
|||
}
|
||||
}
|
||||
|
||||
if ((ret = scpi_cmd(sdi, SCPI_CMD_SELECT_CHANNEL, new_pch->hwname)) == SR_OK)
|
||||
if ((ret = scpi_cmd(sdi, SCPI_CMD_SELECT_CHANNEL, new_pch->hwname)) >= 0)
|
||||
devc->cur_channel = ch;
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue