Consistently use 'cg' for channel group variables.
This matches how we consistently use sdi, devc, and so on all over the code-base. This fixes parts of bug #259.
This commit is contained in:
parent
a68bf88e3a
commit
53b4680fce
|
@ -170,11 +170,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -208,10 +208,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -129,11 +129,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -148,11 +148,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -174,14 +174,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
GVariant *gvar;
|
||||
GVariantBuilder gvb;
|
||||
int i;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
|
@ -138,11 +138,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc = sdi->priv;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_LIMIT_SAMPLES:
|
||||
|
@ -162,13 +162,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
const char *tmp_str;
|
||||
unsigned int i;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -206,10 +206,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -745,11 +745,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -767,12 +767,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -801,13 +801,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar;
|
||||
GVariantBuilder gvb;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
|
@ -206,7 +206,7 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_probe *probe;
|
||||
|
@ -218,7 +218,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
devc = sdi->priv;
|
||||
|
||||
ret = SR_OK;
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
/* No channel group: global options. */
|
||||
switch (key) {
|
||||
case SR_CONF_OUTPUT_CHANNEL:
|
||||
|
@ -232,7 +232,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
} else {
|
||||
/* We only ever have one channel per channel group in this driver. */
|
||||
probe = channel_group->channels->data;
|
||||
probe = cg->channels->data;
|
||||
channel = probe->index;
|
||||
|
||||
switch (key) {
|
||||
|
@ -275,7 +275,7 @@ static int find_str(const char *str, const char **strings, int array_size)
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_probe *probe;
|
||||
|
@ -289,7 +289,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
|
||||
ret = SR_OK;
|
||||
devc = sdi->priv;
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
/* No channel group: global options. */
|
||||
switch (key) {
|
||||
case SR_CONF_OUTPUT_CHANNEL:
|
||||
|
@ -323,7 +323,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
} else {
|
||||
/* Channel group specified: per-channel options. */
|
||||
/* We only ever have one channel per channel group in this driver. */
|
||||
probe = channel_group->channels->data;
|
||||
probe = cg->channels->data;
|
||||
channel = probe->index;
|
||||
|
||||
switch (key) {
|
||||
|
@ -359,7 +359,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_probe *probe;
|
||||
|
@ -379,7 +379,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
devc = sdi->priv;
|
||||
|
||||
ret = SR_OK;
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
/* No channel group: global options. */
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
@ -403,7 +403,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
if (!sdi)
|
||||
return SR_ERR_ARG;
|
||||
/* We only ever have one channel per channel group in this driver. */
|
||||
probe = channel_group->channels->data;
|
||||
probe = cg->channels->data;
|
||||
channel = probe->index;
|
||||
|
||||
switch (key) {
|
||||
|
|
|
@ -183,11 +183,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc = sdi->priv;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_LIMIT_SAMPLES:
|
||||
|
@ -204,11 +204,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -235,10 +235,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -150,12 +150,12 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -181,10 +181,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -166,14 +166,14 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
GVariant *range[2];
|
||||
uint64_t low, high;
|
||||
int tmp, ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (!sdi)
|
||||
return SR_ERR_ARG;
|
||||
|
@ -238,7 +238,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
uint64_t tmp_u64, low, high;
|
||||
|
@ -246,7 +246,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
int tmp, ret;
|
||||
const char *tmp_str;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -328,7 +328,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *tuple, *range[2];
|
||||
GVariantBuilder gvb;
|
||||
|
@ -336,7 +336,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
int ret;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
switch (key) {
|
||||
|
|
|
@ -161,11 +161,11 @@ static int cleanup(int idx)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -191,10 +191,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -263,11 +263,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -287,11 +287,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -333,13 +333,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar, *grange[2];
|
||||
GVariantBuilder gvb;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
|
@ -130,11 +130,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -168,10 +168,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -122,12 +122,12 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int ret;
|
||||
double dblval;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -165,12 +165,12 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
switch (key) {
|
||||
|
|
|
@ -171,7 +171,7 @@ static int init(struct sr_context *sr_ctx)
|
|||
return std_init(sr_ctx, di, LOG_PREFIX);
|
||||
}
|
||||
|
||||
static void generate_analog_pattern(const struct sr_channel_group *channel_group, uint64_t sample_rate)
|
||||
static void generate_analog_pattern(const struct sr_channel_group *cg, uint64_t sample_rate)
|
||||
{
|
||||
struct analog_gen *ag;
|
||||
double t, frequency;
|
||||
|
@ -179,12 +179,11 @@ static void generate_analog_pattern(const struct sr_channel_group *channel_group
|
|||
unsigned int num_samples, i;
|
||||
int last_end;
|
||||
|
||||
ag = channel_group->priv;
|
||||
ag = cg->priv;
|
||||
num_samples = ANALOG_BUFSIZE / sizeof(float);
|
||||
|
||||
sr_dbg("Generating %s pattern for channel group %s",
|
||||
analog_pattern_str[ag->pattern],
|
||||
channel_group->name);
|
||||
analog_pattern_str[ag->pattern], cg->name);
|
||||
|
||||
switch (ag->pattern) {
|
||||
case PATTERN_SQUARE:
|
||||
|
@ -383,7 +382,7 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_probe *probe;
|
||||
|
@ -405,14 +404,14 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
*data = g_variant_new_uint64(devc->limit_msec);
|
||||
break;
|
||||
case SR_CONF_PATTERN_MODE:
|
||||
if (!channel_group)
|
||||
if (!cg)
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
probe = channel_group->channels->data;
|
||||
probe = cg->channels->data;
|
||||
if (probe->type == SR_PROBE_LOGIC) {
|
||||
pattern = devc->logic_pattern;
|
||||
*data = g_variant_new_string(logic_pattern_str[pattern]);
|
||||
} else if (probe->type == SR_PROBE_ANALOG) {
|
||||
ag = channel_group->priv;
|
||||
ag = cg->priv;
|
||||
pattern = ag->pattern;
|
||||
*data = g_variant_new_string(analog_pattern_str[pattern]);
|
||||
} else
|
||||
|
@ -432,7 +431,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct analog_gen *ag;
|
||||
|
@ -463,10 +462,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
sr_dbg("Setting time limit to %" PRIu64"ms", devc->limit_msec);
|
||||
break;
|
||||
case SR_CONF_PATTERN_MODE:
|
||||
if (!channel_group)
|
||||
if (!cg)
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
stropt = g_variant_get_string(data, NULL);
|
||||
probe = channel_group->channels->data;
|
||||
probe = cg->channels->data;
|
||||
pattern = -1;
|
||||
if (probe->type == SR_PROBE_LOGIC) {
|
||||
for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) {
|
||||
|
@ -496,9 +495,8 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
if (pattern == -1)
|
||||
return SR_ERR_ARG;
|
||||
sr_dbg("Setting analog pattern for channel group %s to %s",
|
||||
channel_group->name,
|
||||
analog_pattern_str[pattern]);
|
||||
ag = channel_group->priv;
|
||||
cg->name, analog_pattern_str[pattern]);
|
||||
ag = cg->priv;
|
||||
ag->pattern = pattern;
|
||||
} else
|
||||
return SR_ERR_BUG;
|
||||
|
@ -511,7 +509,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct sr_probe *probe;
|
||||
GVariant *gvar;
|
||||
|
@ -528,7 +526,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
if (!sdi)
|
||||
return SR_ERR_ARG;
|
||||
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
|
@ -545,7 +543,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_NA;
|
||||
}
|
||||
} else {
|
||||
probe = channel_group->channels->data;
|
||||
probe = cg->channels->data;
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
|
|
|
@ -204,11 +204,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -242,10 +242,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -347,13 +347,13 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_usb_dev_inst *usb;
|
||||
char str[128];
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_CONN:
|
||||
|
@ -381,12 +381,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR;
|
||||
|
@ -407,13 +407,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar;
|
||||
GVariantBuilder gvb;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -423,18 +423,18 @@ static int cleanup_2x_bd232(void)
|
|||
|
||||
/** Get value of configuration item */
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int ret;
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)sdi;
|
||||
(void)data;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (!sdi || !(devc = sdi->priv))
|
||||
return SR_ERR_ARG;
|
||||
|
@ -460,10 +460,10 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
|
||||
/** Implementation of config_list, auxiliary function for common parts, */
|
||||
static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
@ -479,10 +479,9 @@ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst
|
|||
|
||||
/** Implementation of config_list for Metrahit 1x/2x send mode */
|
||||
static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
@ -490,7 +489,7 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
|
|||
hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t));
|
||||
break;
|
||||
default:
|
||||
return config_list_common(key, data, sdi, channel_group);
|
||||
return config_list_common(key, data, sdi, cg);
|
||||
}
|
||||
|
||||
return SR_OK;
|
||||
|
@ -498,10 +497,9 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
|
|||
|
||||
/** Implementation of config_list for Metrahit 2x bidirectional mode */
|
||||
static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
@ -509,7 +507,7 @@ static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sd
|
|||
hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t));
|
||||
break;
|
||||
default:
|
||||
return config_list_common(key, data, sdi, channel_group);
|
||||
return config_list_common(key, data, sdi, cg);
|
||||
}
|
||||
|
||||
return SR_OK;
|
||||
|
|
|
@ -1492,13 +1492,13 @@ SR_PRIV const char *gmc_model_str(enum model mcode)
|
|||
/** @copydoc sr_dev_driver.config_set
|
||||
*/
|
||||
SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
uint8_t params[9];
|
||||
uint8_t msg[42];
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
|
|
@ -120,7 +120,7 @@ struct dev_context {
|
|||
|
||||
/* Forward declarations */
|
||||
SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group);
|
||||
const struct sr_channel_group *cg);
|
||||
SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf);
|
||||
SR_PRIV void dump_msg14(guchar* buf, gboolean raw);
|
||||
SR_PRIV int gmc_decode_model_bd(uint8_t mcode);
|
||||
|
|
|
@ -184,22 +184,22 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int check_channel_group(struct dev_context *devc,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
unsigned int i;
|
||||
struct scope_config *model;
|
||||
|
||||
model = devc->model_config;
|
||||
|
||||
if (!channel_group)
|
||||
if (!cg)
|
||||
return PG_NONE;
|
||||
|
||||
for (i = 0; i < model->analog_channels; ++i)
|
||||
if (channel_group == &devc->analog_groups[i])
|
||||
if (cg == &devc->analog_groups[i])
|
||||
return PG_ANALOG;
|
||||
|
||||
for (i = 0; i < model->digital_pods; ++i)
|
||||
if (channel_group == &devc->digital_groups[i])
|
||||
if (cg == &devc->digital_groups[i])
|
||||
return PG_DIGITAL;
|
||||
|
||||
sr_err("Invalid channel group specified.");
|
||||
|
@ -208,7 +208,7 @@ static int check_channel_group(struct dev_context *devc,
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int ret, pg_type;
|
||||
unsigned int i;
|
||||
|
@ -219,7 +219,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
if (!sdi || !(devc = sdi->priv))
|
||||
return SR_ERR_ARG;
|
||||
|
||||
if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID)
|
||||
if ((pg_type = check_channel_group(devc, cg)) == PG_INVALID)
|
||||
return SR_ERR;
|
||||
|
||||
ret = SR_ERR_NA;
|
||||
|
@ -242,7 +242,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_CHANNEL_GROUP;
|
||||
} else if (pg_type == PG_ANALOG) {
|
||||
for (i = 0; i < model->analog_channels; ++i) {
|
||||
if (channel_group != &devc->analog_groups[i])
|
||||
if (cg != &devc->analog_groups[i])
|
||||
continue;
|
||||
*data = g_variant_new_int32(model->num_ydivs);
|
||||
ret = SR_OK;
|
||||
|
@ -290,7 +290,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_CHANNEL_GROUP;
|
||||
} else if (pg_type == PG_ANALOG) {
|
||||
for (i = 0; i < model->analog_channels; ++i) {
|
||||
if (channel_group != &devc->analog_groups[i])
|
||||
if (cg != &devc->analog_groups[i])
|
||||
continue;
|
||||
*data = g_variant_new_string((*model->coupling_options)[state->analog_channels[i].coupling]);
|
||||
ret = SR_OK;
|
||||
|
@ -332,7 +332,7 @@ static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n)
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int ret, pg_type;
|
||||
unsigned int i, j;
|
||||
|
@ -348,7 +348,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
if (!sdi || !(devc = sdi->priv))
|
||||
return SR_ERR_ARG;
|
||||
|
||||
if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID)
|
||||
if ((pg_type = check_channel_group(devc, cg)) == PG_INVALID)
|
||||
return SR_ERR;
|
||||
|
||||
model = devc->model_config;
|
||||
|
@ -389,7 +389,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
q != (*model->vdivs)[i][1])
|
||||
continue;
|
||||
for (j = 1; j <= model->analog_channels; ++j) {
|
||||
if (channel_group != &devc->analog_groups[j - 1])
|
||||
if (cg != &devc->analog_groups[j - 1])
|
||||
continue;
|
||||
state->analog_channels[j - 1].vdiv = i;
|
||||
g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q);
|
||||
|
@ -471,7 +471,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
if (strcmp(tmp, (*model->coupling_options)[i]) != 0)
|
||||
continue;
|
||||
for (j = 1; j <= model->analog_channels; ++j) {
|
||||
if (channel_group != &devc->analog_groups[j - 1])
|
||||
if (cg != &devc->analog_groups[j - 1])
|
||||
continue;
|
||||
state->analog_channels[j-1].coupling = i;
|
||||
|
||||
|
@ -504,7 +504,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int pg_type;
|
||||
struct dev_context *devc;
|
||||
|
@ -513,7 +513,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
if (!sdi || !(devc = sdi->priv))
|
||||
return SR_ERR_ARG;
|
||||
|
||||
if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID)
|
||||
if ((pg_type = check_channel_group(devc, cg)) == PG_INVALID)
|
||||
return SR_ERR;
|
||||
|
||||
model = devc->model_config;
|
||||
|
|
|
@ -423,12 +423,12 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct sr_usb_dev_inst *usb;
|
||||
char str[128];
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_CONN:
|
||||
|
@ -456,7 +456,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
double tmp_double;
|
||||
|
@ -466,7 +466,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
const char *tmp_str;
|
||||
char **targets;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -587,14 +587,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
GVariant *tuple, *rational[2];
|
||||
GVariantBuilder gvb;
|
||||
unsigned int i;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -308,12 +308,12 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
devc = sdi->priv;
|
||||
|
@ -333,12 +333,12 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
uint64_t samplerate, limit_samples, capture_ratio;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -366,14 +366,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar, *grange[2];
|
||||
GVariantBuilder gvb;
|
||||
int ret;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
|
||||
|
|
|
@ -280,10 +280,10 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -298,11 +298,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -335,13 +335,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar;
|
||||
GVariantBuilder gvb;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
|
@ -249,13 +249,13 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
GVariant *rational[2];
|
||||
const uint64_t *si;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
devc = sdi->priv;
|
||||
switch (key) {
|
||||
|
@ -298,7 +298,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
uint64_t p, q;
|
||||
|
@ -306,7 +306,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
int tmp, ret;
|
||||
const char *tmp_str;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -378,14 +378,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *tuple, *rational[2];
|
||||
GVariantBuilder gvb;
|
||||
unsigned int i;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
|
@ -159,14 +159,14 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_usb_dev_inst *usb;
|
||||
int ret;
|
||||
char str[128];
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
devc = sdi->priv;
|
||||
switch (id) {
|
||||
|
@ -195,12 +195,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -235,10 +235,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -276,11 +276,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -298,7 +298,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
int ret;
|
||||
struct dev_context *devc;
|
||||
|
@ -307,7 +307,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
int trigger_pos;
|
||||
double pos;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
devc = sdi->priv;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
|
@ -369,12 +369,12 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar;
|
||||
GVariantBuilder gvb;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
(void)sdi;
|
||||
|
||||
switch (key) {
|
||||
|
|
|
@ -163,11 +163,11 @@ static int cleanup(int idx)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -193,10 +193,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -185,11 +185,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -223,10 +223,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -213,11 +213,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (!sdi)
|
||||
return SR_ERR_ARG;
|
||||
|
@ -252,7 +252,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
uint16_t flag;
|
||||
|
@ -260,7 +260,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
int ret;
|
||||
const char *stropt;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -349,14 +349,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
GVariant *gvar, *grange[2];
|
||||
GVariantBuilder gvb;
|
||||
int num_channels, i;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -477,7 +477,7 @@ static int digital_frame_size(const struct sr_dev_inst *sdi)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_probe *probe;
|
||||
|
@ -492,13 +492,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_ARG;
|
||||
|
||||
/* If a channel group is specified, it must be a valid one. */
|
||||
if (channel_group && !g_slist_find(sdi->channel_groups, channel_group)) {
|
||||
if (cg && !g_slist_find(sdi->channel_groups, cg)) {
|
||||
sr_err("Invalid channel group specified.");
|
||||
return SR_ERR;
|
||||
}
|
||||
|
||||
if (channel_group) {
|
||||
probe = g_slist_nth_data(channel_group->channels, 0);
|
||||
if (cg) {
|
||||
probe = g_slist_nth_data(cg->channels, 0);
|
||||
if (!probe)
|
||||
return SR_ERR;
|
||||
if (probe->type == SR_PROBE_ANALOG) {
|
||||
|
@ -588,7 +588,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
uint64_t p, q;
|
||||
|
@ -605,7 +605,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_DEV_CLOSED;
|
||||
|
||||
/* If a channel group is specified, it must be a valid one. */
|
||||
if (channel_group && !g_slist_find(sdi->channel_groups, channel_group)) {
|
||||
if (cg && !g_slist_find(sdi->channel_groups, cg)) {
|
||||
sr_err("Invalid channel group specified.");
|
||||
return SR_ERR;
|
||||
}
|
||||
|
@ -676,13 +676,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
ret = SR_ERR_ARG;
|
||||
break;
|
||||
case SR_CONF_VDIV:
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
sr_err("No channel group specified.");
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
}
|
||||
g_variant_get(data, "(tt)", &p, &q);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (channel_group == &devc->analog_groups[i]) {
|
||||
if (cg == &devc->analog_groups[i]) {
|
||||
for (j = 0; j < ARRAY_SIZE(vdivs); j++) {
|
||||
if (vdivs[j][0] != p || vdivs[j][1] != q)
|
||||
continue;
|
||||
|
@ -697,13 +697,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
return SR_ERR_NA;
|
||||
case SR_CONF_COUPLING:
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
sr_err("No channel group specified.");
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
}
|
||||
tmp_str = g_variant_get_string(data, NULL);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (channel_group == &devc->analog_groups[i]) {
|
||||
if (cg == &devc->analog_groups[i]) {
|
||||
for (j = 0; j < ARRAY_SIZE(coupling); j++) {
|
||||
if (!strcmp(tmp_str, coupling[j])) {
|
||||
g_free(devc->coupling[i]);
|
||||
|
@ -738,7 +738,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *tuple, *rational[2];
|
||||
GVariantBuilder gvb;
|
||||
|
@ -752,7 +752,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
|
||||
return SR_OK;
|
||||
} else if (key == SR_CONF_DEVICE_OPTIONS && channel_group == NULL) {
|
||||
} else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
|
||||
return SR_OK;
|
||||
|
@ -763,9 +763,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_ARG;
|
||||
|
||||
/* If a channel group is specified, it must be a valid one. */
|
||||
if (channel_group) {
|
||||
if (channel_group != &devc->analog_groups[0]
|
||||
&& channel_group != &devc->analog_groups[1]) {
|
||||
if (cg) {
|
||||
if (cg != &devc->analog_groups[0]
|
||||
&& cg != &devc->analog_groups[1]) {
|
||||
sr_err("Invalid channel group specified.");
|
||||
return SR_ERR;
|
||||
}
|
||||
|
@ -773,17 +773,17 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
sr_err("No channel group specified.");
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
}
|
||||
if (channel_group == &devc->digital_group) {
|
||||
if (cg == &devc->digital_group) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
NULL, 0, sizeof(int32_t));
|
||||
return SR_OK;
|
||||
} else {
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (channel_group == &devc->analog_groups[i]) {
|
||||
if (cg == &devc->analog_groups[i]) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t));
|
||||
return SR_OK;
|
||||
|
@ -793,7 +793,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
sr_err("No channel group specified.");
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
if (!devc)
|
||||
/* Can't know this until we have the exact model. */
|
||||
return SR_ERR_ARG;
|
||||
if (!channel_group) {
|
||||
if (!cg) {
|
||||
sr_err("No channel group specified.");
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
}
|
||||
|
|
|
@ -428,7 +428,7 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
struct sr_usb_dev_inst *usb;
|
||||
|
@ -437,7 +437,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
int ret;
|
||||
unsigned int i;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
switch (key) {
|
||||
|
@ -482,14 +482,14 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
gdouble low, high;
|
||||
int ret;
|
||||
unsigned int i;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -525,7 +525,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar, *range[2];
|
||||
GVariantBuilder gvb;
|
||||
|
@ -533,7 +533,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
unsigned int i;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
ret = SR_OK;
|
||||
switch (key) {
|
||||
|
|
|
@ -460,11 +460,11 @@ static int cleanup(int dmm)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -493,10 +493,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -265,12 +265,12 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
size_t idx;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (!sdi)
|
||||
return SR_ERR_ARG;
|
||||
|
@ -337,13 +337,13 @@ static int lookup_index(GVariant *value, const char *const *table, int len)
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
uint64_t value;
|
||||
struct dev_context *devc;
|
||||
int idx;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
devc = sdi->priv;
|
||||
if (!devc)
|
||||
|
@ -477,13 +477,13 @@ static int config_commit(const struct sr_dev_inst *sdi)
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
GVariant *gvar;
|
||||
GVariantBuilder gvb;
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -178,11 +178,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -209,10 +209,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -129,11 +129,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -154,10 +154,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -272,11 +272,11 @@ static int cleanup(int dmm)
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
devc = sdi->priv;
|
||||
|
||||
|
@ -307,10 +307,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -200,11 +200,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
devc = sdi->priv;
|
||||
switch (key) {
|
||||
|
@ -225,13 +225,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
int ret;
|
||||
const char *tmp_str;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -266,11 +266,11 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
|
@ -202,12 +202,12 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct sr_usb_dev_inst *usb;
|
||||
char str[128];
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_CONN:
|
||||
|
@ -225,13 +225,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
gint64 now;
|
||||
int ret;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -264,10 +264,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
|
|
|
@ -467,11 +467,11 @@ static int cleanup(void)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -508,12 +508,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
gdouble low, high;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
if (sdi->status != SR_ST_ACTIVE)
|
||||
return SR_ERR_DEV_CLOSED;
|
||||
|
@ -541,7 +541,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct dev_context *devc;
|
||||
GVariant *gvar, *grange[2];
|
||||
|
@ -549,7 +549,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
double v;
|
||||
GVariant *range[2];
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
18
hwdriver.c
18
hwdriver.c
|
@ -587,7 +587,7 @@ SR_PRIV void sr_config_free(struct sr_config *src)
|
|||
* @param[in] sdi (optional) If the key is specific to a device, this must
|
||||
* contain a pointer to the struct sr_dev_inst to be checked.
|
||||
* Otherwise it must be NULL.
|
||||
* @param[in] channel_group The channel group on the device for which to list the
|
||||
* @param[in] cg The channel group on the device for which to list the
|
||||
* values, or NULL.
|
||||
* @param[in] key The configuration key (SR_CONF_*).
|
||||
* @param[in,out] data Pointer to a GVariant where the value will be stored.
|
||||
|
@ -604,7 +604,7 @@ SR_PRIV void sr_config_free(struct sr_config *src)
|
|||
*/
|
||||
SR_API int sr_config_get(const struct sr_dev_driver *driver,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group,
|
||||
const struct sr_channel_group *cg,
|
||||
int key, GVariant **data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -615,7 +615,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
|
|||
if (!driver->config_get)
|
||||
return SR_ERR_ARG;
|
||||
|
||||
if ((ret = driver->config_get(key, data, sdi, channel_group)) == SR_OK) {
|
||||
if ((ret = driver->config_get(key, data, sdi, cg)) == SR_OK) {
|
||||
/* Got a floating reference from the driver. Sink it here,
|
||||
* caller will need to unref when done with it. */
|
||||
g_variant_ref_sink(*data);
|
||||
|
@ -628,7 +628,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
|
|||
* Set value of a configuration key in a device instance.
|
||||
*
|
||||
* @param[in] sdi The device instance.
|
||||
* @param[in] channel_group The channel group on the device for which to list the
|
||||
* @param[in] cg The channel group on the device for which to list the
|
||||
* values, or NULL.
|
||||
* @param[in] key The configuration key (SR_CONF_*).
|
||||
* @param data The new value for the key, as a GVariant with GVariantType
|
||||
|
@ -642,7 +642,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
|
|||
* that it's not applicable.
|
||||
*/
|
||||
SR_API int sr_config_set(const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group,
|
||||
const struct sr_channel_group *cg,
|
||||
int key, GVariant *data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -654,7 +654,7 @@ SR_API int sr_config_set(const struct sr_dev_inst *sdi,
|
|||
else if (!sdi->driver->config_set)
|
||||
ret = SR_ERR_ARG;
|
||||
else
|
||||
ret = sdi->driver->config_set(key, data, sdi, channel_group);
|
||||
ret = sdi->driver->config_set(key, data, sdi, cg);
|
||||
|
||||
g_variant_unref(data);
|
||||
|
||||
|
@ -688,7 +688,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
|
|||
* @param[in] driver The sr_dev_driver struct to query.
|
||||
* @param[in] sdi (optional) If the key is specific to a device, this must
|
||||
* contain a pointer to the struct sr_dev_inst to be checked.
|
||||
* @param[in] channel_group The channel group on the device for which to list the
|
||||
* @param[in] cg The channel group on the device for which to list the
|
||||
* values, or NULL.
|
||||
* @param[in] key The configuration key (SR_CONF_*).
|
||||
* @param[in,out] data A pointer to a GVariant where the list will be stored.
|
||||
|
@ -705,7 +705,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
|
|||
*/
|
||||
SR_API int sr_config_list(const struct sr_dev_driver *driver,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group,
|
||||
const struct sr_channel_group *cg,
|
||||
int key, GVariant **data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -714,7 +714,7 @@ SR_API int sr_config_list(const struct sr_dev_driver *driver,
|
|||
ret = SR_ERR;
|
||||
else if (!driver->config_list)
|
||||
ret = SR_ERR_ARG;
|
||||
else if ((ret = driver->config_list(key, data, sdi, channel_group)) == SR_OK)
|
||||
else if ((ret = driver->config_list(key, data, sdi, cg)) == SR_OK)
|
||||
g_variant_ref_sink(*data);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -986,12 +986,12 @@ struct sr_dev_driver {
|
|||
*/
|
||||
int (*config_get) (int id, GVariant **data,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group);
|
||||
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,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group);
|
||||
const struct sr_channel_group *cg);
|
||||
/** Probe status change.
|
||||
* @see sr_dev_probe_enable(), sr_dev_trigger_set(). */
|
||||
int (*config_probe_set) (const struct sr_dev_inst *sdi,
|
||||
|
@ -1004,7 +1004,7 @@ struct sr_dev_driver {
|
|||
*/
|
||||
int (*config_list) (int info_id, GVariant **data,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group);
|
||||
const struct sr_channel_group *cg);
|
||||
|
||||
/* Device-specific */
|
||||
/** Open device */
|
||||
|
|
6
proto.h
6
proto.h
|
@ -72,15 +72,15 @@ SR_API int sr_driver_init(struct sr_context *ctx,
|
|||
SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options);
|
||||
SR_API int sr_config_get(const struct sr_dev_driver *driver,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group,
|
||||
const struct sr_channel_group *cg,
|
||||
int key, GVariant **data);
|
||||
SR_API int sr_config_set(const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group,
|
||||
const struct sr_channel_group *cg,
|
||||
int key, GVariant *data);
|
||||
SR_API int sr_config_commit(const struct sr_dev_inst *sdi);
|
||||
SR_API int sr_config_list(const struct sr_dev_driver *driver,
|
||||
const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group,
|
||||
const struct sr_channel_group *cg,
|
||||
int key, GVariant **data);
|
||||
SR_API const struct sr_config_info *sr_config_info_get(int key);
|
||||
SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);
|
||||
|
|
|
@ -211,11 +211,11 @@ static int dev_close(struct sr_dev_inst *sdi)
|
|||
}
|
||||
|
||||
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct session_vdev *vdev;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_SAMPLERATE:
|
||||
|
@ -233,11 +233,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
struct session_vdev *vdev;
|
||||
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
vdev = sdi->priv;
|
||||
|
||||
|
@ -270,10 +270,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
}
|
||||
|
||||
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
const struct sr_channel_group *channel_group)
|
||||
const struct sr_channel_group *cg)
|
||||
{
|
||||
(void)sdi;
|
||||
(void)channel_group;
|
||||
(void)cg;
|
||||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
|
|
Loading…
Reference in New Issue