/** Generic option struct used by various subsystems. */
struct sr_option {
/* Short name suitable for commandline usage, [a-z0-9-]. */
- char *id;
+ const char *id;
/* Short name suitable for GUI usage, can contain UTF-8. */
- char *name;
+ const char *name;
/* Description of the option, in a sentence. */
- char *desc;
+ const char *desc;
/* Default value for this option. */
GVariant *def;
/* List of possible values, if this is an option with few values. */
/** Data type like SR_T_STRING, etc if applicable. */
int datatype;
/** Short, lowercase ID string, e.g. "serialcomm", "voltage". */
- char *id;
+ const char *id;
/** Full capitalized name, e.g. "Serial communication". */
- char *name;
+ const char *name;
/** Verbose description (unused currently). */
- char *description;
+ const 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
+/** Configuration capabilities. */
+enum sr_configcap {
+ /** Value can be read. */
+ SR_CONF_GET = (1 << 31),
+ /** Value can be written. */
+ SR_CONF_SET = (1 << 30),
+ /** Possible values can be enumerated. */
+ SR_CONF_LIST = (1 << 29),
+};
/** Configuration keys */
enum sr_configkey {
/** Over-temperature protection (OTP) active. */
SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE,
- /* Update sr_key_info_config[] (hwdriver.c) upon changes! */
+ /** Under-voltage condition. */
+ SR_CONF_UNDER_VOLTAGE_CONDITION,
- /*--- Special stuff -------------------------------------------------*/
+ /** Under-voltage condition active. */
+ SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE,
- /** Scan options supported by the driver. */
- SR_CONF_SCAN_OPTIONS = 40000,
+ /* Update sr_key_info_config[] (hwdriver.c) upon changes! */
- /** Device options for a particular device. */
- SR_CONF_DEVICE_OPTIONS,
+ /*--- Special stuff -------------------------------------------------*/
/** Session filename. */
- SR_CONF_SESSIONFILE,
+ SR_CONF_SESSIONFILE = 40000,
/** The device supports specifying a capturefile to inject. */
SR_CONF_CAPTUREFILE,
struct sr_dev_driver {
/* Driver-specific */
/** Driver name. Lowercase a-z, 0-9 and dashes (-) only. */
- char *name;
+ const char *name;
/** Long name. Verbose driver name shown to user. */
- char *longname;
+ const char *longname;
/** API version (currently 1). */
int api_version;
/** Called when driver is loaded, e.g. program startup. */