gboolean enabled;
/** Name of channel. */
char *name;
+ /** Private data for driver use. */
+ void *priv;
};
/** Structure for groups of channels that have common properties. */
/** Used for setting or getting value of a config item. */
struct sr_config {
/** Config key like SR_CONF_CONN, etc. */
- int key;
+ uint32_t key;
/** Key-specific data. */
GVariant *data;
};
/** Information about a config key. */
struct sr_config_info {
/** Config key like SR_CONF_CONN, etc. */
- int key;
+ uint32_t key;
/** Data type like SR_T_STRING, etc. */
int datatype;
/** Id string, e.g. "serialcomm". */
char *description;
};
+#define SR_CONF_GET (1 << 31)
+#define SR_CONF_SET (1 << 30)
+#define SR_CONF_LIST (1 << 29)
+#define SR_CONF_MASK 0x1fffffff
+
/** Constants for device classes */
enum sr_configkey {
/*--- Device classes ------------------------------------------------*/
char *model;
/** Device version. */
char *version;
+ /** Serial number. */
+ char *serial_num;
+ /** Connection string to uniquely identify devices. */
+ char *connection_id;
/** List of channels. */
GSList *channels;
/** List of sr_channel_group structs */
/** Query value of a configuration key in driver or given device instance.
* @see sr_config_get().
*/
- int (*config_get) (int id, GVariant **data,
+ int (*config_get) (uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);
/** Set value of a configuration key in driver or a given device instance.
* @see sr_config_set(). */
- int (*config_set) (int id, GVariant *data,
+ int (*config_set) (uint32_t key, GVariant *data,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);
/** Channel status change.
/** List all possible values for a configuration key in a device instance.
* @see sr_config_list().
*/
- int (*config_list) (int info_id, GVariant **data,
+ int (*config_list) (uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);