- /* Register SIGMA device. */
- sdi = sigrok_device_instance_new(0, ST_INITIALIZING,
- USB_VENDOR_NAME, USB_MODEL_NAME, USB_MODEL_VERSION);
- if (!sdi)
- return 0;
+ if ((ret = ftdi_usb_find_all(&ctx->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(&ctx->ftdic, devlist->dev, NULL, 0, NULL, 0,
+ serial_txt, sizeof(serial_txt));
+ sscanf(serial_txt, "%x", &serial);
+
+ if (serial < 0xa6010000 || serial > 0xa602ffff) {
+ sr_err("sigma: Only SIGMA and SIGMA2 are supported "
+ "in this version of sigrok.");
+ goto free;
+ }
+
+ sr_info("Found ASIX SIGMA - Serial: %s", serial_txt);