From: Martin Ling Date: Sat, 7 Dec 2013 19:35:13 +0000 (+0000) Subject: ols: Get fd from sp_get_port_handle() rather than serial struct. X-Git-Tag: libsigrok-0.3.0~454 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bf72f649999a6e8741ffee1ca2850db4d478f9f8;p=libsigrok.git ols: Get fd from sp_get_port_handle() rather than serial struct. --- diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 7ae5e08c..c189bed3 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -18,6 +18,7 @@ */ #include "protocol.h" +#include #define SERIALCOMM "115200/8n1" @@ -152,7 +153,7 @@ static GSList *scan(GSList *options) /* Wait 10ms for a response. */ g_usleep(10000); - probefd.fd = serial->fd; + sp_get_port_handle(serial->data, &probefd.fd); probefd.events = G_IO_IN; g_poll(&probefd, 1, 1); diff --git a/hardware/openbench-logic-sniffer/protocol.c b/hardware/openbench-logic-sniffer/protocol.c index 09306dbe..71e8c34f 100644 --- a/hardware/openbench-logic-sniffer/protocol.c +++ b/hardware/openbench-logic-sniffer/protocol.c @@ -18,6 +18,7 @@ */ #include "protocol.h" +#include extern SR_PRIV struct sr_dev_driver ols_driver_info; static struct sr_dev_driver *di = &ols_driver_info; @@ -354,6 +355,7 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data) int num_channels, offset, j; unsigned int i; unsigned char byte; + int serial_fd; drvc = di->priv; @@ -363,7 +365,8 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data) sdi = l->data; devc = sdi->priv; serial = sdi->conn; - if (serial->fd == fd) + sp_get_port_handle(serial->data, &serial_fd); + if (serial_fd == fd) break; devc = NULL; }