]> sigrok.org Git - libsigrok.git/commitdiff
genericdmm: allow for default options in DMM profiles
authorBert Vermeulen <redacted>
Sun, 8 Jul 2012 02:09:55 +0000 (04:09 +0200)
committerBert Vermeulen <redacted>
Fri, 3 Aug 2012 08:27:36 +0000 (10:27 +0200)
Much better than the special-cased USB vid.pid

hardware/genericdmm/api.c
hardware/genericdmm/genericdmm.h

index 4a5da74432a5e1b448756279ec824169340f0158..eae25f02fe33c2bc32f62a41f22a225c12291a93 100644 (file)
 
 extern SR_PRIV struct dmmchip dmmchip_fs9922;
 
+static struct sr_hwopt victor_70c_vidpid[] = {
+       { SR_HWOPT_CONN, "1244.d237" },
+       { 0, NULL }
+};
 static struct dev_profile dev_profiles[] = {
        { "victor-70c", "Victor", "70C", &dmmchip_fs9922,
-               0x1244, 0xd237, DMM_TRANSPORT_USBHID },
-       { "mastech-va18b", "Mastech", "VA18B", NULL, 0, 0, DMM_TRANSPORT_SERIAL},
+               DMM_TRANSPORT_USBHID, victor_70c_vidpid
+       },
+       { "mastech-va18b", "Mastech", "VA18B", NULL, DMM_TRANSPORT_SERIAL, NULL},
+       { NULL, NULL, NULL, NULL, 0, NULL }
 };
 
 static const int hwcaps[] = {
index cb1e0a09cd90aa512c91ab3d79c2defff8f941f2..58d4a906dac2d009e30d56a656c33211122b7fd4 100644 (file)
@@ -40,10 +40,8 @@ struct dev_profile {
        char *vendor;
        char *model;
        struct dmmchip *chip;
-       /* Only use when the VID:PID is really specific to a DMM. */
-       uint16_t vid;
-       uint16_t pid;
        int transport;
+       struct sr_hwopt *defaults_opts;
 };
 
 struct context {