]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok.h
libsigrok-internal.h: Fix libserialport.h name.
[libsigrok.git] / libsigrok.h
index 17d7fc17d7a5249dff9d11c585ec95891bb596d9..7f18d6902d596c4917da3b016b48f2a01cb21381 100644 (file)
@@ -73,6 +73,7 @@ enum {
        SR_ERR_NA         = -6, /**< Not applicable. */
        SR_ERR_DEV_CLOSED = -7, /**< Device is closed, but needs to be open. */
        SR_ERR_TIMEOUT    = -8, /**< A timeout occurred. */
+       SR_ERR_PROBE_GROUP= -9, /**< A probe group must be specified. */
 
        /*
         * Note: When adding entries here, don't forget to also update the
@@ -549,6 +550,16 @@ struct sr_probe {
        char *trigger;
 };
 
+/** Structure for groups of probes that have common properties. */
+struct sr_probe_group {
+       /** Name of the probe group. */
+       char *name;
+       /** List of sr_probe structs of the probes belonging to this group. */
+       GSList *probes;
+       /** Private data for driver use. */
+       void *priv;
+};
+
 struct sr_config {
        int key;
        GVariant *data;
@@ -777,6 +788,8 @@ struct sr_dev_inst {
        char *model;
        char *version;
        GSList *probes;
+       /* List of sr_probe_group structs */
+       GSList *probe_groups;
        void *conn;
        void *priv;
 };
@@ -814,11 +827,14 @@ struct sr_dev_driver {
        GSList *(*dev_list) (void);
        int (*dev_clear) (void);
        int (*config_get) (int id, GVariant **data,
-                       const struct sr_dev_inst *sdi);
+                       const struct sr_dev_inst *sdi,
+                       const struct sr_probe_group *probe_group);
        int (*config_set) (int id, GVariant *data,
-                       const struct sr_dev_inst *sdi);
+                       const struct sr_dev_inst *sdi,
+                       const struct sr_probe_group *probe_group);
        int (*config_list) (int info_id, GVariant **data,
-                       const struct sr_dev_inst *sdi);
+                       const struct sr_dev_inst *sdi,
+                       const struct sr_probe_group *probe_group);
 
        /* Device-specific */
        int (*dev_open) (struct sr_dev_inst *sdi);