From: Bert Vermeulen Date: Sun, 8 Jul 2012 02:09:55 +0000 (+0200) Subject: genericdmm: allow for default options in DMM profiles X-Git-Tag: dsupstream~848 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7fc754a0db73b473fb5c70f59165b43dc682bf1a;p=libsigrok.git genericdmm: allow for default options in DMM profiles Much better than the special-cased USB vid.pid --- diff --git a/hardware/genericdmm/api.c b/hardware/genericdmm/api.c index 4a5da744..eae25f02 100644 --- a/hardware/genericdmm/api.c +++ b/hardware/genericdmm/api.c @@ -29,10 +29,16 @@ 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[] = { diff --git a/hardware/genericdmm/genericdmm.h b/hardware/genericdmm/genericdmm.h index cb1e0a09..58d4a906 100644 --- a/hardware/genericdmm/genericdmm.h +++ b/hardware/genericdmm/genericdmm.h @@ -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 {