Publish config key capabilities.

Every driver now publishes its device option config keys, i.e. the
list fetched with sr_config_list(SR_CONF_DEVICE_OPTIONS), with a
set of flags indicating which methods are implemented by the driver
for that key.

The config keys are OR'ed with any combination of SR_CONF_GET,
SR_CONF_SET and SR_CONF_LIST. These are defined as the high bits
of the uint32_t config key. Clients can OR config keys with
SR_CONF_MASK to strip out these bits. This mask will be kept up to
date if other bits are added to the capabilities list; clients MUST
therefore use SR_CONF_MASK for this.

Some keys don't have capability bits added, such as the informative
device type keys (SR_CONF_MULTIMETER, SR_CONF_OSCILLOSCOPE, ...) and
SR_CONF_CONTINUOUS.

Scan options do not have capabilities bits.
This commit is contained in:
Bert Vermeulen 2014-09-17 15:28:29 +02:00
parent 138589b02e
commit 5827f61b64
43 changed files with 224 additions and 215 deletions

View File

@ -505,6 +505,11 @@ struct sr_config_info {
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 ------------------------------------------------*/

View File

@ -34,9 +34,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
extern const struct agdmm_job agdmm_jobs_u12xx[];

View File

@ -27,10 +27,10 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_DATA_SOURCE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const char *data_sources[] = {

View File

@ -73,10 +73,11 @@ static const char *channel_names[] = {
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_CAPTURE_RATIO,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
};
static const int32_t trigger_matches[] = {

View File

@ -39,16 +39,16 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS,
SR_CONF_OUTPUT_CHANNEL_CONFIG,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
SR_CONF_OUTPUT_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t devopts_cg[] = {
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT,
SR_CONF_OUTPUT_CURRENT_MAX,
SR_CONF_OUTPUT_ENABLED,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
static const char *channel_modes[] = {

View File

@ -31,13 +31,11 @@ static const uint32_t scanopts[] = {
/* Hardware capabilities */
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_NUM_LOGIC_CHANNELS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_NUM_LOGIC_CHANNELS | SR_CONF_GET,
};
/* Trigger matching capabilities */

View File

@ -27,9 +27,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver brymen_bm86x_driver_info;

View File

@ -26,9 +26,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver brymen_bm857_driver_info;

View File

@ -30,16 +30,16 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_SPL_WEIGHT_FREQ,
SR_CONF_SPL_WEIGHT_TIME,
SR_CONF_SPL_MEASUREMENT_RANGE,
SR_CONF_DATALOG,
SR_CONF_HOLD_MAX,
SR_CONF_HOLD_MIN,
SR_CONF_POWER_OFF,
SR_CONF_DATA_SOURCE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SPL_WEIGHT_FREQ | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SPL_WEIGHT_TIME | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SPL_MEASUREMENT_RANGE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_DATALOG | SR_CONF_GET | SR_CONF_SET,
SR_CONF_HOLD_MAX | SR_CONF_GET | SR_CONF_SET,
SR_CONF_HOLD_MIN | SR_CONF_GET | SR_CONF_SET,
SR_CONF_POWER_OFF | SR_CONF_GET | SR_CONF_SET,
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const char *weight_freq[] = {

View File

@ -27,9 +27,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
static const char *channel_names[] = {

View File

@ -25,10 +25,10 @@ static struct sr_dev_driver *di = &chronovu_la_driver_info;
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_LIMIT_MSEC, /* TODO: Not yet implemented. */
SR_CONF_LIMIT_SAMPLES, /* TODO: Not yet implemented. */
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
};
static const int32_t trigger_matches[] = {

View File

@ -37,9 +37,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver colead_slm_driver_info;

View File

@ -33,10 +33,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_CURRENT,
/* There's no SR_CONF_OUTPUT_ENABLED; can't know/set status remotely. */
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_SET,
SR_CONF_OUTPUT_CURRENT | SR_CONF_SET,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info;
@ -150,7 +149,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
}
ret = send_msg1(sdi, 'C', (int) (dblval * 100 + 0.5));
break;
/* No SR_CONF_OUTPUT_ENABLED :-( . */
case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED:
if (g_variant_get_boolean(data))
ret = send_msg1(sdi, 'V', 900);

View File

@ -135,11 +135,15 @@ static const uint32_t scanopts[] = {
static const int devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_DEMO_DEV,
SR_CONF_SAMPLERATE,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_DEMO_DEV,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
SR_CONF_PATTERN_MODE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_LOGIC_CHANNELS | SR_CONF_GET,
SR_CONF_NUM_ANALOG_CHANNELS | SR_CONF_GET,
SR_CONF_AMPLITUDE | SR_CONF_GET | SR_CONF_SET,
};
static const int devopts_cg_logic[] = {

View File

@ -34,9 +34,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver flukedmm_driver_info;

View File

@ -79,12 +79,11 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_TRIGGER_MATCH,
SR_CONF_SAMPLERATE,
/* These are really implemented in the driver, not the hardware. */
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_CONN | SR_CONF_GET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
};
static const char *channel_names[] = {

View File

@ -43,19 +43,19 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts_sm[] = {
SR_CONF_MULTIMETER,
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
};
/** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */
static const uint32_t devopts_bd[] = {
SR_CONF_MULTIMETER,
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_POWER_OFF,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
SR_CONF_POWER_OFF | SR_CONF_GET | SR_CONF_SET,
};

View File

@ -47,19 +47,19 @@ static const char *hameg_scpi_dialect[] = {
static const uint32_t hmo_devopts[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_TIMEBASE,
SR_CONF_NUM_TIMEBASE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_HORIZ_TRIGGERPOS,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_FRAMES,
SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_TIMEBASE | SR_CONF_GET,
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET,
};
static const uint32_t hmo_analog_devopts[] = {
SR_CONF_NUM_VDIV,
SR_CONF_COUPLING,
SR_CONF_VDIV,
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const char *hmo_coupling_options[] = {

View File

@ -46,18 +46,19 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_LIMIT_FRAMES,
SR_CONF_CONTINUOUS,
SR_CONF_TIMEBASE,
SR_CONF_BUFFERSIZE,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_HORIZ_TRIGGERPOS,
SR_CONF_FILTER,
SR_CONF_VDIV,
SR_CONF_COUPLING,
SR_CONF_NUM_TIMEBASE,
SR_CONF_NUM_VDIV,
SR_CONF_CONN | SR_CONF_GET,
SR_CONF_LIMIT_FRAMES | SR_CONF_SET,
SR_CONF_TIMEBASE | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_BUFFERSIZE | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SOURCE | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SLOPE | SR_CONF_SET,
SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_SET,
SR_CONF_FILTER | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_VDIV | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_TIMEBASE | SR_CONF_GET,
SR_CONF_NUM_VDIV | SR_CONF_GET,
};
static const char *channel_names[] = {

View File

@ -21,10 +21,10 @@
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_TRIGGER_MATCH,
SR_CONF_CAPTURE_RATIO,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
};
static const int32_t trigger_matches[] = {

View File

@ -30,10 +30,9 @@
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS, // TODO?
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
/* Channels are numbered 1-9. */

View File

@ -26,12 +26,13 @@
static const uint32_t devopts[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_DATALOG,
SR_CONF_SPL_WEIGHT_FREQ,
SR_CONF_SPL_WEIGHT_TIME,
SR_CONF_DATA_SOURCE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLE_INTERVAL | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_DATALOG | SR_CONF_GET,
SR_CONF_SPL_WEIGHT_FREQ | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SPL_WEIGHT_TIME | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
SR_PRIV const uint64_t kecheng_kc_330b_sample_intervals[][2] = {

View File

@ -33,8 +33,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_THERMOMETER,
SR_CONF_HYGROMETER,
SR_CONF_DATALOG,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONN | SR_CONF_GET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_DATALOG | SR_CONF_GET | SR_CONF_SET,
};
static int init(struct sr_context *sr_ctx)

View File

@ -24,13 +24,13 @@
static const uint32_t devopts[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_TYPE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_HORIZ_TRIGGERPOS,
// SR_CONF_CAPTURE_RATIO,
SR_CONF_LIMIT_SAMPLES,
// SR_CONF_RLE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_TYPE | SR_CONF_LIST,
SR_CONF_TRIGGER_SLOPE | SR_CONF_SET,
SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_SET,
SR_CONF_CAPTURE_RATIO | SR_CONF_SET,
SR_CONF_RLE | SR_CONF_SET,
};
/*

View File

@ -35,15 +35,15 @@ static const uint32_t devopts[] = {
/* Device class */
SR_CONF_POWER_SUPPLY,
/* Aquisition modes. */
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
/* Device configuration */
SR_CONF_OUTPUT_CURRENT,
SR_CONF_OUTPUT_CURRENT_MAX,
SR_CONF_OUTPUT_ENABLED,
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
/* Note: All models have one power supply output only. */

View File

@ -28,9 +28,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_THERMOMETER,
SR_CONF_HYGROMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver mic_98581_driver_info;

View File

@ -54,26 +54,26 @@ static const uint32_t devopts[] = {
/* Device class */
SR_CONF_POWER_SUPPLY,
/* Aquisition modes. */
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
/* Device configuration */
SR_CONF_OUTPUT_CHANNEL_CONFIG,
SR_CONF_OUTPUT_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
/** Hardware capabilities channel 1, 2. */
static const uint32_t devopts_ch12[] = {
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT,
SR_CONF_OUTPUT_CURRENT_MAX,
SR_CONF_OUTPUT_ENABLED,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
/** Hardware capabilities channel 3. (LPS-304/305 only). */
static const uint32_t devopts_ch3[] = {
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_ENABLED,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
static const char *channel_modes[] = {

View File

@ -31,9 +31,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
#define BUF_MAX 50

View File

@ -29,14 +29,14 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_CAPTURE_RATIO,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_EXTERNAL_CLOCK,
SR_CONF_PATTERN_MODE,
SR_CONF_SWAP,
SR_CONF_RLE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
SR_CONF_EXTERNAL_CLOCK | SR_CONF_SET,
SR_CONF_PATTERN_MODE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SWAP | SR_CONF_SET,
SR_CONF_RLE | SR_CONF_GET | SR_CONF_SET,
};
static const int32_t trigger_matches[] = {

View File

@ -21,14 +21,14 @@
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_CAPTURE_RATIO,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_PATTERN_MODE,
SR_CONF_EXTERNAL_CLOCK,
SR_CONF_SWAP,
SR_CONF_RLE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
SR_CONF_PATTERN_MODE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_EXTERNAL_CLOCK | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SWAP | SR_CONF_SET,
SR_CONF_RLE | SR_CONF_GET | SR_CONF_SET,
};
static const int32_t trigger_matches[] = {

View File

@ -36,20 +36,20 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_TIMEBASE,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_HORIZ_TRIGGERPOS,
SR_CONF_NUM_TIMEBASE,
SR_CONF_LIMIT_FRAMES,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_FRAMES | SR_CONF_SET,
SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET,
SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_SET,
SR_CONF_NUM_TIMEBASE | SR_CONF_GET,
SR_CONF_SAMPLERATE | SR_CONF_GET,
};
static const uint32_t analog_devopts[] = {
SR_CONF_NUM_VDIV,
SR_CONF_VDIV,
SR_CONF_COUPLING,
SR_CONF_DATA_SOURCE,
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint64_t timebases[][2] = {

View File

@ -47,13 +47,12 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_VOLTAGE_THRESHOLD,
SR_CONF_TRIGGER_MATCH,
/* These are really implemented in the driver, not the hardware. */
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_CONN | SR_CONF_GET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_VOLTAGE_THRESHOLD | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
};
static const int32_t soft_trigger_matches[] = {

View File

@ -45,22 +45,22 @@ static const uint32_t devopts_none[] = { };
static const uint32_t rigol_dp800_devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS,
SR_CONF_OVER_TEMPERATURE_PROTECTION,
SR_CONF_OVER_TEMPERATURE_PROTECTION | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t rigol_dp800_devopts_cg[] = {
SR_CONF_OUTPUT_REGULATION,
SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED,
SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE,
SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE,
SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD,
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT,
SR_CONF_OUTPUT_CURRENT_MAX,
SR_CONF_OUTPUT_ENABLED,
SR_CONF_OUTPUT_REGULATION | SR_CONF_GET,
SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE | SR_CONF_GET,
SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE | SR_CONF_GET,
SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
struct channel_spec rigol_dp831_ch[] = {
@ -111,11 +111,11 @@ struct scpi_command rigol_dp800_cmd[] = {
static const uint32_t hp_6632b_devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS,
SR_CONF_OUTPUT_ENABLED,
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_CURRENT,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT_MAX,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
struct channel_spec hp_6632b_ch[] = {

View File

@ -36,9 +36,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver bbcgm_m2110_driver_info;

View File

@ -31,14 +31,14 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_EXTERNAL_CLOCK,
SR_CONF_CLOCK_EDGE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_EXTERNAL_CLOCK | SR_CONF_GET | SR_CONF_SET,
SR_CONF_CLOCK_EDGE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const int32_t trigger_matches[] = {

View File

@ -30,9 +30,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_ENERGYMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver teleinfo_driver_info;

View File

@ -32,9 +32,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
unsigned char TESTO_x35_REQUEST[] = { 0x12, 0, 0, 0, 1, 1, 0x55, 0xd1, 0xb7 };

View File

@ -33,8 +33,8 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info;

View File

@ -32,9 +32,9 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
SR_PRIV struct sr_dev_driver tecpel_dmm_8061_driver_info;

View File

@ -23,9 +23,9 @@
static const uint32_t devopts[] = {
SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_DATA_SOURCE,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static char *channels[] = {

View File

@ -41,9 +41,10 @@ static const uint32_t scanopts[] = {
static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
SR_CONF_CONN | SR_CONF_GET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
};
static int init(struct sr_context *sr_ctx)

View File

@ -28,17 +28,19 @@
static const uint32_t dlm_devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_OSCILLOSCOPE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_TIMEBASE,
SR_CONF_NUM_TIMEBASE,
SR_CONF_HORIZ_TRIGGERPOS,
SR_CONF_LIMIT_FRAMES | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET,
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_TIMEBASE | SR_CONF_GET,
SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t dlm_analog_devopts[] = {
SR_CONF_VDIV,
SR_CONF_COUPLING,
SR_CONF_NUM_VDIV,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_VDIV | SR_CONF_GET,
};
static const char *dlm_coupling_options[] = {

View File

@ -54,11 +54,11 @@ static const struct zp_model zeroplus_models[] = {
static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
SR_CONF_CAPTURE_RATIO,
SR_CONF_VOLTAGE_THRESHOLD,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
SR_CONF_VOLTAGE_THRESHOLD | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const int32_t trigger_matches[] = {