- if (ftdi_usb_open_desc(&ftdic, USB_VENDOR, USB_PRODUCT,
- USB_DESCRIPTION, NULL) < 0)
- return 0;
+
+ if ((ret = ftdi_usb_find_all(&devc->ftdic, &devlist,
+ USB_VENDOR, USB_PRODUCT)) <= 0) {
+ if (ret < 0)
+ sr_err("ftdi_usb_find_all(): %d", ret);
+ goto free;
+ }
+
+ /* Make sure it's a version 1 or 2 SIGMA. */
+ ftdi_usb_get_strings(&devc->ftdic, devlist->dev, NULL, 0, NULL, 0,
+ serial_txt, sizeof(serial_txt));
+ sscanf(serial_txt, "%x", &serial);
+
+ if (serial < 0xa6010000 || serial > 0xa602ffff) {
+ sr_err("Only SIGMA and SIGMA2 are supported "
+ "in this version of libsigrok.");
+ goto free;
+ }
+
+ sr_info("Found ASIX SIGMA - Serial: %s", serial_txt);
+
+ devc->cur_samplerate = 0;
+ devc->period_ps = 0;
+ devc->limit_msec = 0;
+ devc->cur_firmware = -1;
+ devc->num_probes = 0;
+ devc->samples_per_event = 0;
+ devc->capture_ratio = 50;
+ devc->use_triggers = 0;