X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fnorma-dmm%2Fprotocol.c;h=035e991e8f1d40db9544acc531fc99bef4b8623a;hb=66c91e2509e2d995fa0b576104aa5ee04e469f21;hp=717ef15213142ed93080578aa4599ae7e4a1ef1b;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git diff --git a/src/hardware/norma-dmm/protocol.c b/src/hardware/norma-dmm/protocol.c index 717ef152..035e991e 100644 --- a/src/hardware/norma-dmm/protocol.c +++ b/src/hardware/norma-dmm/protocol.c @@ -48,9 +48,8 @@ static int nma_send_req(const struct sr_dev_inst *sdi, int req, char *params) devc->last_req = req; devc->last_req_pending = TRUE; - if (serial_write(serial, buf, len) == -1) { - sr_err("Unable to send request: %d %s.", - errno, strerror(errno)); + if (serial_write_blocking(serial, buf, len) < 0) { + sr_err("Unable to send request."); devc->last_req_pending = FALSE; return SR_ERR; } @@ -391,7 +390,7 @@ SR_PRIV int norma_dmm_receive_data(int fd, int revents, void *cb_data) if (revents == G_IO_IN) { /* Serial data arrived. */ while (NMADMM_BUFSIZE - devc->buflen - 1 > 0) { - len = serial_read(serial, devc->buf + devc->buflen, 1); + len = serial_read_nonblocking(serial, devc->buf + devc->buflen, 1); if (len < 1) break; devc->buflen += len;