]> sigrok.org Git - libsigrok.git/commitdiff
hantek-6xxx: Update driver to use the USB product version field.
authorUwe Hermann <redacted>
Wed, 12 Oct 2016 20:33:19 +0000 (22:33 +0200)
committerUwe Hermann <redacted>
Sun, 30 Oct 2016 13:36:40 +0000 (14:36 +0100)
We now require the use of the latest fx2lafw firmware which uses the
same USB VID/PID (1D50:608E) for the Hantek 6022BE and the variants
and rebadges of that device (e.g. the SainSmart DDS120).

The variants can be distinguished via the USB product version field.

src/hardware/hantek-6xxx/api.c
src/hardware/hantek-6xxx/protocol.h

index 0f00cd3ea25b7a6fef2e7b9e46f84b2318432955..5596268187ff6e7c3d0d59e92772d1fc8c7cb988 100644 (file)
@@ -61,12 +61,12 @@ static const char *acdc_coupling[] = {
 
 static const struct hantek_6xxx_profile dev_profiles[] = {
        {
-               0x04b4, 0x6022, 0x04b5, 0x6022,
+               0x04b4, 0x6022, 0x1d50, 0x608e, 0x0001,
                "Hantek", "6022BE", "hantek-6022be.fw",
                dc_coupling, ARRAY_SIZE(dc_coupling), FALSE,
        },
        {
-               0x8102, 0x8102, 0x1D50, 0x608E,
+               0x8102, 0x8102, 0x1d50, 0x608e, 0x0002,
                "Sainsmart", "DDS120", "sainsmart-dds120.fw",
                acdc_coupling, ARRAY_SIZE(acdc_coupling), TRUE,
        },
@@ -241,7 +241,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);
index 0e3e04d4a160c656e9c5f78aa982e25fc031e3d3..73d8f868da27430072a30b674ea96440ab27da22 100644 (file)
@@ -94,6 +94,7 @@ struct hantek_6xxx_profile {
        /* VID/PID after firmware upload */
        uint16_t fw_vid;
        uint16_t fw_pid;
+       uint16_t fw_prod_ver;
        const char *vendor;
        const char *model;
        const char *firmware;