]> sigrok.org Git - libsigrok.git/commitdiff
brymen-dmm: Mark serial read calls as nonblocking.
authorMartin Ling <redacted>
Tue, 16 Sep 2014 01:42:26 +0000 (02:42 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:00 +0000 (23:30 +0200)
The driver opens the port with SERIAL_NONBLOCK so these were already
nonblocking, and are handled appropriately.

src/hardware/brymen-dmm/protocol.c

index dff7b985bfe071a8c6f90af6e14719c8aff81fbe..881881cf026a1366b2993157e464c52c2e550265 100644 (file)
@@ -57,7 +57,7 @@ static void handle_new_data(struct sr_dev_inst *sdi)
 
        /* Try to get as much data as the buffer can hold. */
        len = DMM_BUFSIZE - devc->buflen;
-       len = serial_read(serial, devc->buf + devc->buflen, len);
+       len = serial_read_nonblocking(serial, devc->buf + devc->buflen, len);
        if (len < 1) {
                sr_err("Serial port read error: %d.", len);
                return;
@@ -192,7 +192,7 @@ SR_PRIV int brymen_stream_detect(struct sr_serial_dev_inst *serial,
 
        packet_len = i = ibuf = len = 0;
        while (ibuf < maxlen) {
-               len = serial_read(serial, &buf[ibuf], maxlen - ibuf);
+               len = serial_read_nonblocking(serial, &buf[ibuf], maxlen - ibuf);
                if (len > 0) {
                        ibuf += len;
                        sr_spew("Read %d bytes.", len);