drivers: Provide proper drvopts.
The device class config keys should be in drvopts (not devopts).
This commit is contained in:
parent
55fb76b348
commit
05199c0ac9
|
@ -22,6 +22,10 @@
|
|||
#include <time.h>
|
||||
#include <sys/timerfd.h>
|
||||
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_THERMOMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
|
@ -222,7 +226,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
if (!cg) {
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -26,9 +26,12 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_NUM_LOGIC_CHANNELS,
|
||||
};
|
||||
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
/* Hardware capabilities */
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET,
|
||||
|
@ -248,7 +251,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -26,8 +26,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
|
||||
|
@ -169,7 +172,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -25,8 +25,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -133,7 +136,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -35,8 +35,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_SOUNDLEVELMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -96,7 +99,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -35,8 +35,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_POWER_SUPPLY,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_VOLTAGE | SR_CONF_SET,
|
||||
SR_CONF_CURRENT | SR_CONF_SET,
|
||||
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET,
|
||||
|
@ -136,7 +139,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static struct sr_dev_driver conrad_digi_35_cpu_driver_info = {
|
||||
|
|
|
@ -32,8 +32,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -194,7 +197,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -28,8 +28,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
|
||||
|
@ -391,7 +394,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -40,10 +40,13 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
/** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
|
||||
static const uint32_t devopts_sm[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
|
||||
};
|
||||
|
||||
/** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
|
||||
static const uint32_t devopts_sm[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
|
||||
|
@ -51,8 +54,6 @@ static const uint32_t devopts_sm[] = {
|
|||
|
||||
/** 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_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
|
||||
|
@ -365,14 +366,14 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
|
|||
static int config_list_sm(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts_sm);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts_sm);
|
||||
}
|
||||
|
||||
/** Implementation of config_list for Metrahit 2x bidirectional mode */
|
||||
static int config_list_bd(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts_bd);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts_bd);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start_1x_2x_rs232(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -25,8 +25,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_OSCILLOSCOPE,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_LIMIT_FRAMES | SR_CONF_SET,
|
||||
SR_CONF_SAMPLERATE | SR_CONF_GET,
|
||||
};
|
||||
|
@ -162,7 +165,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -20,8 +20,11 @@
|
|||
#include <config.h>
|
||||
#include "protocol.h"
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
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,
|
||||
|
@ -306,7 +309,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -28,8 +28,11 @@
|
|||
|
||||
#define SAMPLE_BUF_SIZE (8 * 1024 * 1024)
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
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,
|
||||
|
@ -272,7 +275,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -25,8 +25,11 @@
|
|||
#define VENDOR "Kecheng"
|
||||
#define USB_INTERFACE 0
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_SOUNDLEVELMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_SAMPLE_INTERVAL | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
|
||||
|
@ -327,7 +330,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLE_INTERVAL:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
|
||||
for (i = 0; i < ARRAY_SIZE(kecheng_kc_330b_sample_intervals); i++) {
|
||||
|
|
|
@ -28,8 +28,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_SCALE,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -125,7 +128,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -32,7 +32,6 @@ static const uint32_t drvopts[] = {
|
|||
|
||||
static const uint32_t devopts[] = {
|
||||
/* Device class */
|
||||
SR_CONF_POWER_SUPPLY,
|
||||
/* Acquisition modes. */
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
|
|
|
@ -28,9 +28,12 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_THERMOMETER,
|
||||
SR_CONF_HYGROMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
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,
|
||||
|
@ -183,7 +186,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static void LIBUSB_CALL mark_xfer(struct libusb_transfer *xfer)
|
||||
|
|
|
@ -35,8 +35,11 @@
|
|||
#define UNKNOWN_ADDRESS 0xff
|
||||
#define MAX_RENUM_DELAY_MS 3000
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
|
||||
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
|
||||
|
@ -408,7 +411,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&vb, G_VARIANT_TYPE("a{sv}"));
|
||||
var = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -22,9 +22,12 @@
|
|||
#include <config.h>
|
||||
#include "protocol.h"
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_OSCILLOSCOPE,
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
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,
|
||||
|
@ -290,7 +293,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"), samplerates,
|
||||
|
|
|
@ -41,7 +41,6 @@ static const uint32_t drvopts[] = {
|
|||
|
||||
static const uint32_t devopts[] = {
|
||||
/* Device class */
|
||||
SR_CONF_POWER_SUPPLY,
|
||||
/* Acquisition modes. */
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include "protocol.h"
|
||||
|
||||
SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *buflen);
|
||||
SR_PRIV int lps_send_va(struct sr_serial_dev_inst *serial, const char *fmt, va_list args);
|
||||
SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...);
|
||||
|
@ -57,7 +58,6 @@ static const uint32_t drvopts[] = {
|
|||
/** Hardware capabilities generic. */
|
||||
static const uint32_t devopts[] = {
|
||||
/* Device class */
|
||||
SR_CONF_POWER_SUPPLY,
|
||||
/* Acquisition modes. */
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
|
|
|
@ -30,8 +30,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -176,7 +179,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -20,8 +20,11 @@
|
|||
#include <config.h>
|
||||
#include "protocol.h"
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
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,
|
||||
|
@ -345,7 +348,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"), samplerates,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
static const uint32_t scanopts[] = {
|
||||
SR_CONF_CONN,
|
||||
SR_CONF_SERIALCOMM
|
||||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t drvopts[] = {
|
||||
|
|
|
@ -43,8 +43,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LOGIC_ANALYZER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_CONN | SR_CONF_GET,
|
||||
|
@ -506,7 +509,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
case SR_CONF_SAMPLERATE:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
|
||||
gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
|
||||
|
|
|
@ -34,8 +34,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -152,7 +155,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -29,8 +29,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_ENERGYMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -136,7 +139,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -27,8 +27,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET | SR_CONF_GET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET | SR_CONF_GET,
|
||||
|
@ -222,7 +225,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static void receive_data(struct sr_dev_inst *sdi, unsigned char *data, int len)
|
||||
|
|
|
@ -31,8 +31,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_SOUNDLEVELMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -106,7 +109,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -28,8 +28,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_MULTIMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET | SR_CONF_GET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET | SR_CONF_GET,
|
||||
|
@ -121,7 +124,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
}
|
||||
|
||||
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
||||
|
|
|
@ -25,8 +25,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_CONN,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_THERMOMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
|
||||
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
|
||||
|
@ -208,7 +211,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
case SR_CONF_DATA_SOURCE:
|
||||
*data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
|
||||
break;
|
||||
|
|
|
@ -839,8 +839,11 @@ static const uint32_t scanopts[] = {
|
|||
SR_CONF_SERIALCOMM,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
static const uint32_t drvopts[] = {
|
||||
SR_CONF_LCRMETER,
|
||||
};
|
||||
|
||||
static const uint32_t devopts[] = {
|
||||
SR_CONF_CONTINUOUS,
|
||||
SR_CONF_LIMIT_FRAMES | SR_CONF_SET,
|
||||
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
|
||||
|
@ -855,7 +858,7 @@ SR_PRIV int es51919_serial_config_list(uint32_t key, GVariant **data,
|
|||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts);
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
case SR_CONF_OUTPUT_FREQUENCY:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_DOUBLE,
|
||||
frequencies, ARRAY_SIZE(frequencies), sizeof(double));
|
||||
|
|
Loading…
Reference in New Issue