]> sigrok.org Git - libsigrok.git/blobdiff - hardware/agilent-dmm/sched.c
Always interleave analog data with all enabled probes.
[libsigrok.git] / hardware / agilent-dmm / sched.c
index 56e768dbc0ebfac1270c38b4647a755228794815..d7d720d3227af38c87efc2ffb9eaf46cb4a5350d 100644 (file)
@@ -93,6 +93,8 @@ SR_PRIV int agdmm_receive_data(int fd, int revents, void *cb_data)
        struct dev_context *devc;
        int len;
 
+       (void)fd;
+
        if (!(sdi = cb_data))
                return TRUE;
 
@@ -102,7 +104,7 @@ SR_PRIV int agdmm_receive_data(int fd, int revents, void *cb_data)
        if (revents == G_IO_IN) {
                /* Serial data arrived. */
                while(AGDMM_BUFSIZE - devc->buflen - 1 > 0) {
-                       len = serial_read(fd, devc->buf + devc->buflen, 1);
+                       len = serial_read(devc->serial, devc->buf + devc->buflen, 1);
                        if (len < 1)
                                break;
                        devc->buflen += len;
@@ -117,7 +119,7 @@ SR_PRIV int agdmm_receive_data(int fd, int revents, void *cb_data)
 
        dispatch(sdi);
 
-       if (devc->num_samples >= devc->limit_samples)
+       if (devc->limit_samples && devc->num_samples >= devc->limit_samples)
                sdi->driver->dev_acquisition_stop(sdi, cb_data);
 
        return TRUE;
@@ -135,7 +137,7 @@ static int agdmm_send(const struct sr_dev_inst *sdi, const char *cmd)
                strncat(buf, "\r\n", 32);
        else
                strncat(buf, "\n\r\n", 32);
-       if (serial_write(devc->serial->fd, buf, strlen(buf)) == -1) {
+       if (serial_write(devc->serial, buf, strlen(buf)) == -1) {
                sr_err("Failed to send: %s.", strerror(errno));
                return SR_ERR;
        }
@@ -261,6 +263,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
        analog.mq = devc->cur_mq;
        analog.unit = devc->cur_unit;
        analog.mqflags = devc->cur_mqflags;
+       analog.probes = sdi->probes;
        analog.num_samples = 1;
        analog.data = &fvalue;
        packet.type = SR_DF_ANALOG;