]> sigrok.org Git - libsigrok.git/commitdiff
teleinfo: Mark serial read as nonblocking, remove SERIAL_NONBLOCK flag.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 18:17:02 +0000 (19:17 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:31 +0000 (23:30 +0200)
This call was already nonblocking due to the flag.

src/hardware/teleinfo/api.c
src/hardware/teleinfo/protocol.c

index 4060b03ebf67866baaf1871c8c6e8f5d6a258a6a..77cd5f8d7e9c91386d59ff1fe4d7147b047eec9c 100644 (file)
@@ -76,7 +76,7 @@ static GSList *scan(GSList *options)
 
        if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
                return NULL;
-       if (serial_open(serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK)
+       if (serial_open(serial, SERIAL_RDONLY) != SR_OK)
                return NULL;
 
        sr_info("Probing serial port %s.", conn);
index a610173d1aaaa20421d2716bf44b3e7eaf8f42cd..d2b96e1f5c8c8ad58fbbf6ab9a81abfd2e55bbfd 100644 (file)
@@ -196,7 +196,7 @@ SR_PRIV int teleinfo_receive_data(int fd, int revents, void *cb_data)
 
        /* Try to get as much data as the buffer can hold. */
        len = TELEINFO_BUF_SIZE - devc->buf_len;
-       len = serial_read(serial, devc->buf + devc->buf_len, len);
+       len = serial_read_nonblocking(serial, devc->buf + devc->buf_len, len);
        if (len < 1) {
                sr_err("Serial port read error: %d.", len);
                return FALSE;