X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fscpi-pps%2Fprotocol.c;h=a27089f52a7981f1b936ee2c46599abede38dd3e;hb=da005885c8ebbf98772f75126764f758b2640d11;hp=be4788600ef7ab72aedb216edba440810961bca1;hpb=329733d92c5004f0fe308eff26b9537fded2cdf3;p=libsigrok.git diff --git a/src/hardware/scpi-pps/protocol.c b/src/hardware/scpi-pps/protocol.c index be478860..a27089f5 100644 --- a/src/hardware/scpi-pps/protocol.c +++ b/src/hardware/scpi-pps/protocol.c @@ -18,6 +18,7 @@ */ #include +#include #include #include "protocol.h" @@ -148,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; @@ -226,6 +227,8 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data) pch = devc->cur_channel->priv; if (pch->mq == SR_MQ_VOLTAGE) cmd = SCPI_CMD_GET_MEAS_VOLTAGE; + else if (pch->mq == SR_MQ_FREQUENCY) + cmd = SCPI_CMD_GET_MEAS_FREQUENCY; else if (pch->mq == SR_MQ_CURRENT) cmd = SCPI_CMD_GET_MEAS_CURRENT; else if (pch->mq == SR_MQ_POWER)