]> sigrok.org Git - libsigrok.git/blobdiff - hardware/genericdmm/genericdmm.h
sr: convert sr_dev_has_hwcap() to use sdi
[libsigrok.git] / hardware / genericdmm / genericdmm.h
index 467ed662d4d71ecb82986ff57dccbfcc6732dac9..d961949415ae0c4a505cc0b7ac53a4854426c44a 100644 (file)
@@ -22,7 +22,7 @@
 #define LIBSIGROK_GENERICDMM_H
 
 /* SR_HWCAP_CONN takes one of these: */
-#define DMM_CONN_USB_VIDPID    "^([0--9a-z]{1,4}):([0--9a-z]{1,4})$"
+#define DMM_CONN_USB_VIDPID    "^([0-9a-z]{1,4})\\.([0-9a-z]{1,4})$"
 #define DMM_CONN_USB_BUSADDR   "^(\\d+)\\.(\\d+)$"
 #define DMM_CONN_SERIALPORT    "^([a-z0-9/\\-_]+)$"
 
@@ -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 {
@@ -73,9 +71,13 @@ struct context {
 
 struct dmmchip {
        /* Optional, called once before measurement starts. */
-       int (*init) (struct context *ctx);
+       int (*init) (void);
+
+       /* Scan for devices with the given options. */
+       GSList *(*scan) (GSList *options);
+
        /* Called whenever a chunk of data arrives. */
-       int (*data) (struct context *ctx, unsigned char *data);
+       int (*data) (struct sr_dev_inst *sdi, unsigned char *data);
 };