X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fgenericdmm%2Fgenericdmm.h;h=cb323e41a77d39e4091f707a335433da1fde9601;hb=161a8a272699a7b818ddab01043838f07d7cf6eb;hp=cb1e0a09cd90aa512c91ab3d79c2defff8f941f2;hpb=7356a55db8e1f0aa27abb8f3cd05bca848c4c2a0;p=libsigrok.git diff --git a/hardware/genericdmm/genericdmm.h b/hardware/genericdmm/genericdmm.h index cb1e0a09..cb323e41 100644 --- a/hardware/genericdmm/genericdmm.h +++ b/hardware/genericdmm/genericdmm.h @@ -40,13 +40,18 @@ 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; + int poll_timeout; + struct sr_hwopt *defaults_opts; }; -struct context { +/* Private driver context. */ +struct drv_context { + GSList *instances; +}; + +/* Private, per-device-instance driver context. */ +struct dev_context { struct dev_profile *profile; uint64_t limit_samples; uint64_t limit_msec; @@ -73,9 +78,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); };