X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fopenbench-logic-sniffer%2Fapi.c;h=8df4a8cd178739871894394287778f115ff3bcb1;hb=61c39f54bbcae7bdde86ddb11b2fd0ff308d319b;hp=7ae5e08cd317bbe585cf47a4a54b20bd91e75694;hpb=bf2c987fdef6787a5ce826ed9d98a70f52a1ff96;p=libsigrok.git diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 7ae5e08c..8df4a8cd 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); @@ -209,19 +210,6 @@ static GSList *dev_list(void) return ((struct drv_context *)(di->priv))->instances; } -static int dev_open(struct sr_dev_inst *sdi) -{ - struct sr_serial_dev_inst *serial; - - serial = sdi->conn; - if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) - return SR_ERR; - - sdi->status = SR_ST_ACTIVE; - - return SR_OK; -} - static int cleanup(void) { return dev_clear(); @@ -550,7 +538,7 @@ SR_PRIV struct sr_dev_driver ols_driver_info = { .config_get = config_get, .config_set = config_set, .config_list = config_list, - .dev_open = dev_open, + .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop,