From: Daniel Elstner Date: Tue, 14 Jan 2014 00:43:02 +0000 (+0100) Subject: sysclk-lwla: Honor SR_CONF_CONN at scan time. X-Git-Tag: libsigrok-0.3.0~292 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7ebe9b9e7e8649fa592527d7cba2cf49804c3652;p=libsigrok.git sysclk-lwla: Honor SR_CONF_CONN at scan time. --- diff --git a/hardware/sysclk-lwla/api.c b/hardware/sysclk-lwla/api.c index 444b6a1b..e20564a5 100644 --- a/hardware/sysclk-lwla/api.c +++ b/hardware/sysclk-lwla/api.c @@ -81,16 +81,24 @@ static GSList *scan(GSList *options) struct sr_dev_inst *sdi; struct dev_context *devc; struct sr_usb_dev_inst *usb; + struct sr_config *src; + const char *conn; int device_index; - (void)options; - - devices = NULL; drvc = di->priv; drvc->instances = NULL; - device_index = 0; + conn = USB_VID_PID; - usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, USB_VID_PID); + for (node = options; node != NULL; node = node->next) { + src = node->data; + if (src->key == SR_CONF_CONN) { + conn = g_variant_get_string(src->data, NULL); + break; + } + } + usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn); + devices = NULL; + device_index = 0; for (node = usb_devices; node != NULL; node = node->next) { usb = node->data;