X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fcolead-slm%2Fprotocol.c;h=182c77bb4b4e7a98a20fe5fcee6a56e2226c2a4a;hb=9e6d9bee2a6771aab111ad95140caf520310b109;hp=6b89ea14f512aeb9202e74f8f5e5a424801c0c7b;hpb=c9fc06d7f0b13798f9ce6f4187c0a676aa32a4d0;p=libsigrok.git diff --git a/src/hardware/colead-slm/protocol.c b/src/hardware/colead-slm/protocol.c index 6b89ea14..182c77bb 100644 --- a/src/hardware/colead-slm/protocol.c +++ b/src/hardware/colead-slm/protocol.c @@ -184,7 +184,7 @@ SR_PRIV int colead_slm_receive_data(int fd, int revents, void *cb_data) const struct sr_dev_inst *sdi; struct dev_context *devc; struct sr_serial_dev_inst *serial; - int len; + int delay_ms, len; char buf[128]; (void)fd; @@ -207,8 +207,9 @@ SR_PRIV int colead_slm_receive_data(int fd, int revents, void *cb_data) * we don't want it. */ return TRUE; /* Got 0x10, "measurement ready". */ - if (serial_write_blocking(serial, "\x20", 1) == -1) - sr_err("unable to send command: %s", strerror(errno)); + delay_ms = serial_timeout(serial, 1); + if (serial_write_blocking(serial, "\x20", 1, delay_ms) < 1) + sr_err("unable to send command"); else { devc->state = COMMAND_SENT; devc->buflen = 0;