X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fagilent-dmm%2Fsched.c;h=339dbac6aaf11e6a995c276c663d15fafc018cba;hb=19ee7dff78f7195bfc82f14ef659751cdd0f6476;hp=140c53403f938c7a88a6ed6548baefc7bb36a45a;hpb=38d326e879c6e1bb7d4a11682c262ca838a7dde5;p=libsigrok.git diff --git a/hardware/agilent-dmm/sched.c b/hardware/agilent-dmm/sched.c index 140c5340..339dbac6 100644 --- a/hardware/agilent-dmm/sched.c +++ b/hardware/agilent-dmm/sched.c @@ -89,10 +89,12 @@ static void receive_line(const struct sr_dev_inst *sdi) SR_PRIV int agdmm_receive_data(int fd, int revents, void *cb_data) { - const struct sr_dev_inst *sdi; + struct sr_dev_inst *sdi; 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; } @@ -241,7 +243,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match) return SR_OK; if (!strcmp(g_match_info_get_string(match), "+9.90000000E+37")) { - /* An invalid measurement shows up on the display as "O.L, but + /* An invalid measurement shows up on the display as "O.L", but * comes through like this. Since comparing 38-digit floats * is rather problematic, we'll cut through this here. */ fvalue = NAN;