]> sigrok.org Git - libsigrok.git/blobdiff - hardware/agilent-dmm/sched.c
agilent-dmm: use new serial API
[libsigrok.git] / hardware / agilent-dmm / sched.c
index 56e768dbc0ebfac1270c38b4647a755228794815..339dbac6aaf11e6a995c276c663d15fafc018cba 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;
@@ -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;
        }