]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hantek-6xxx/api.c
Add support for Hantek 6022BL
[libsigrok.git] / src / hardware / hantek-6xxx / api.c
index 349b557b7eaa91d3937548ea21bad0de3097e475..6e2d7d948325c1a33237695cbb09b237cdce4102 100644 (file)
@@ -61,15 +61,20 @@ static const char *acdc_coupling[] = {
 
 static const struct hantek_6xxx_profile dev_profiles[] = {
        {
-               0x04b4, 0x6022, 0x04b5, 0x6022,
-               "Hantek", "6022BE", "hantek-6022be.fw",
+               0x04b4, 0x6022, 0x1d50, 0x608e, 0x0001,
+               "Hantek", "6022BE", "fx2lafw-hantek-6022be.fw",
                dc_coupling, ARRAY_SIZE(dc_coupling), FALSE,
        },
        {
-               0x8102, 0x8102, 0x1D50, 0x608E,
-               "Sainsmart", "DDS120", "sainsmart-dds120.fw",
+               0x8102, 0x8102, 0x1d50, 0x608e, 0x0002,
+               "Sainsmart", "DDS120", "fx2lafw-sainsmart-dds120.fw",
                acdc_coupling, ARRAY_SIZE(acdc_coupling), TRUE,
        },
+       {
+               0x04b4, 0x602a, 0x1d50, 0x608e, 0x0003,
+               "Hantek", "6022BL", "fx2lafw-hantek-6022bl.fw",
+               dc_coupling, ARRAY_SIZE(dc_coupling), FALSE,
+       },
        ALL_ZERO
 };
 
@@ -241,7 +246,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                                                libusb_get_bus_number(devlist[i]), 0xff, NULL);
                                break;
                        } else if (des.idVendor == dev_profiles[j].fw_vid
-                               && des.idProduct == dev_profiles[j].fw_pid) {
+                               && des.idProduct == dev_profiles[j].fw_pid
+                               && des.bcdDevice == dev_profiles[j].fw_prod_ver) {
                                /* Device matches the post-firmware profile. */
                                prof = &dev_profiles[j];
                                sr_dbg("Found a %s %s.", prof->vendor, prof->model);
@@ -307,7 +313,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        err = libusb_claim_interface(usb->devhdl, USB_INTERFACE);
        if (err != 0) {
                sr_err("Unable to claim interface: %s.",
-                          libusb_error_name(err));
+                       libusb_error_name(err));
                return SR_ERR;
        }