]> sigrok.org Git - libsigrok.git/commitdiff
ols: Get fd from sp_get_port_handle() rather than serial struct.
authorMartin Ling <redacted>
Sat, 7 Dec 2013 19:35:13 +0000 (19:35 +0000)
committerMartin Ling <redacted>
Sat, 7 Dec 2013 19:43:47 +0000 (19:43 +0000)
hardware/openbench-logic-sniffer/api.c
hardware/openbench-logic-sniffer/protocol.c

index 7ae5e08cd317bbe585cf47a4a54b20bd91e75694..c189bed32715800b1ac6b2e947ca38668db42411 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "protocol.h"
+#include <libserialport.h>
 
 #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);
 
index 09306dbef6afd87869d980788035ce748b3c4abb..71e8c34f0d082814e8fe915910feb5fef8bbe579 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "protocol.h"
+#include <libserialport.h>
 
 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;
        }