Apparently, frontends may call scan() more than once to accumulate
multiple devices, so do not reset the instance list pointer at the
start of each scan. Also, number devices continuously across scans.
int device_index;
drvc = di->priv;
- drvc->instances = NULL;
conn = USB_VID_PID;
for (node = options; node != NULL; node = node->next) {
}
usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn);
devices = NULL;
- device_index = 0;
+ device_index = g_slist_length(drvc->instances);
for (node = usb_devices; node != NULL; node = node->next) {
usb = node->data;