]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
fx2lafw: silence error message in query for channel group's device options
[libsigrok.git] / src / hardware / fx2lafw / api.c
index 34c5bc412ebfec2b9dc582da3cefab98588d92f6..dc085266d1129236d1eca0bfb3f32d76c0acd647 100644 (file)
 static const struct fx2lafw_profile supported_fx2[] = {
        /*
         * CWAV USBee AX
-        * EE Electronics ESLA201A
-        * ARMFLY AX-Pro
+        * ARMFLY AX-Pro (clone of the CWAV USBee AX)
+        * ARMFLY Mini-Logic (clone of the CWAV USBee AX)
+        * EE Electronics ESLA201A (clone of the CWAV USBee AX)
+        * HT USBee-AxPro (clone of the CWAV USBee AX)
+        * MCU123 USBee AX Pro clone (clone of the CWAV USBee AX)
+        * Noname LHT00SU1 (clone of the CWAV USBee AX)
+        * XZL_Studio AX (clone of the CWAV USBee AX)
         */
        { 0x08a9, 0x0014, "CWAV", "USBee AX", NULL,
                "fx2lafw-cwav-usbeeax.fw",
                DEV_CAPS_AX_ANALOG, NULL, NULL},
+
        /*
         * CWAV USBee DX
-        * XZL-Studio DX
+        * HT USBee-DxPro (clone of the CWAV USBee DX), not yet supported!
+        * XZL-Studio DX (clone of the CWAV USBee DX)
         */
        { 0x08a9, 0x0015, "CWAV", "USBee DX", NULL,
                "fx2lafw-cwav-usbeedx.fw",
@@ -55,9 +62,12 @@ static const struct fx2lafw_profile supported_fx2[] = {
 
        /*
         * Saleae Logic
-        * EE Electronics ESLA100
-        * Robomotic MiniLogic
-        * Robomotic BugLogic 3
+        * EE Electronics ESLA100 (clone of the Saleae Logic)
+        * Hantek 6022BL in LA mode (clone of the Saleae Logic)
+        * Instrustar ISDS205X in LA mode (clone of the Saleae Logic)
+        * Robomotic MiniLogic (clone of the Saleae Logic)
+        * Robomotic BugLogic 3 (clone of the Saleae Logic)
+        * MCU123 Saleae Logic clone (clone of the Saleae Logic)
         */
        { 0x0925, 0x3881, "Saleae", "Logic", NULL,
                "fx2lafw-saleae-logic.fw",
@@ -67,6 +77,7 @@ static const struct fx2lafw_profile supported_fx2[] = {
         * Default Cypress FX2 without EEPROM, e.g.:
         * Lcsoft Mini Board
         * Braintechnology USB Interface V2.x
+        * fx2grok-tiny
         */
        { 0x04B4, 0x8613, "Cypress", "FX2", NULL,
                "fx2lafw-cypress-fx2.fw",
@@ -81,6 +92,7 @@ static const struct fx2lafw_profile supported_fx2[] = {
 
        /*
         * sigrok FX2 based 8-channel logic analyzer
+        * fx2grok-flat (before and after renumeration)
         */
        { 0x1d50, 0x608c, "sigrok", "FX2 LA (8ch)", NULL,
                "fx2lafw-sigrok-fx2-8ch.fw",
@@ -251,10 +263,11 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                        continue;
                }
 
-               usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
-
                libusb_close(hdl);
 
+               if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+                       continue;
+
                prof = NULL;
                for (j = 0; supported_fx2[j].vid; j++) {
                        if (des.idVendor == supported_fx2[j].vid &&
@@ -325,14 +338,16 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                                        libusb_get_device_address(devlist[i]), NULL);
                } else {
                        if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
-                                       USB_CONFIGURATION, prof->firmware) == SR_OK)
+                                       USB_CONFIGURATION, prof->firmware) == SR_OK) {
                                /* Store when this device's FW was updated. */
                                devc->fw_updated = g_get_monotonic_time();
-                       else
+                       } else {
                                sr_err("Firmware upload failed for "
-                                      "device %d.%d (logical).",
+                                      "device %d.%d (logical), name %s.",
                                       libusb_get_bus_number(devlist[i]),
-                                      libusb_get_device_address(devlist[i]));
+                                      libusb_get_device_address(devlist[i]),
+                                      prof->firmware);
+                       }
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
                                        0xff, NULL);
@@ -526,8 +541,12 @@ static int config_list(uint32_t key, GVariant **data,
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
        case SR_CONF_DEVICE_OPTIONS:
+               if (cg)
+                       return SR_ERR_NA;
                return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
        case SR_CONF_SAMPLERATE:
+               if (!devc)
+                       return SR_ERR_NA;
                *data = std_gvar_samplerates(devc->samplerates, devc->num_samplerates);
                break;
        case SR_CONF_TRIGGER_MATCH: