teleinfo: Mark serial read as nonblocking, remove SERIAL_NONBLOCK flag.
This call was already nonblocking due to the flag.
This commit is contained in:
parent
4ded59eef0
commit
9333691aaf
|
@ -76,7 +76,7 @@ static GSList *scan(GSList *options)
|
||||||
|
|
||||||
if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
|
if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (serial_open(serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK)
|
if (serial_open(serial, SERIAL_RDONLY) != SR_OK)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
sr_info("Probing serial port %s.", conn);
|
sr_info("Probing serial port %s.", conn);
|
||||||
|
|
|
@ -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. */
|
/* Try to get as much data as the buffer can hold. */
|
||||||
len = TELEINFO_BUF_SIZE - devc->buf_len;
|
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) {
|
if (len < 1) {
|
||||||
sr_err("Serial port read error: %d.", len);
|
sr_err("Serial port read error: %d.", len);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue