From: Martin Ling Date: Tue, 16 Sep 2014 01:29:57 +0000 (+0100) Subject: appa-55ii: Mark serial read nonblocking and remove SERIAL_NONBLOCK. X-Git-Tag: libsigrok-0.4.0~976 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=25dd083128e0cf60f9f23c7ac2649ec6829a954f appa-55ii: Mark serial read nonblocking and remove SERIAL_NONBLOCK. This is the only read/write call in the driver. It is already non-blocking and is handled appropriately. --- diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c index c9169f33..b96bacfb 100644 --- a/src/hardware/appa-55ii/api.c +++ b/src/hardware/appa-55ii/api.c @@ -80,7 +80,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); diff --git a/src/hardware/appa-55ii/protocol.c b/src/hardware/appa-55ii/protocol.c index 708262bd..354bd83f 100644 --- a/src/hardware/appa-55ii/protocol.c +++ b/src/hardware/appa-55ii/protocol.c @@ -277,7 +277,7 @@ SR_PRIV int appa_55ii_receive_data(int fd, int revents, void *cb_data) /* Try to get as much data as the buffer can hold. */ len = sizeof(devc->buf) - 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;