This is required to adapt to the same rename in libsigrok.
The --probe-group command-line option is now called --channel-group
(however, the short version -g remains the same as it means "group").
This is an update related to bug #259.
extern struct sr_context *sr_ctx;
extern gchar *opt_drv;
extern struct sr_context *sr_ctx;
extern gchar *opt_drv;
-extern gchar *opt_probe_group;
+extern gchar *opt_channel_group;
/* Convert driver options hash to GSList of struct sr_config. */
static GSList *hash_to_hwopt(GHashTable *hash)
/* Convert driver options hash to GSList of struct sr_config. */
static GSList *hash_to_hwopt(GHashTable *hash)
-struct sr_probe_group *select_probe_group(struct sr_dev_inst *sdi)
+struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi)
- struct sr_probe_group *pg;
+ struct sr_channel_group *cg;
+ if (!opt_channel_group)
- if (!sdi->probe_groups) {
- g_critical("This device does not have any probe groups.");
+ if (!sdi->channel_groups) {
+ g_critical("This device does not have any channel groups.");
- for (l = sdi->probe_groups; l; l = l->next) {
- pg = l->data;
- if (!strcasecmp(opt_probe_group, pg->name)) {
- return pg;
+ for (l = sdi->channel_groups; l; l = l->next) {
+ cg = l->data;
+ if (!strcasecmp(opt_channel_group, cg->name)) {
+ return cg;
.B "1\-8"
probe selection.
.TP
.B "1\-8"
probe selection.
.TP
-.BR "\-g, \-\-probe\-group "<probe\ group>
-Specify the probe group to operate on.
+.BR "\-g, \-\-channel\-group "<channel\ group>
+Specify the channel group to operate on.
-Some devices organize probes into groups, the settings of which can
-only be changed as a group. The list of probe groups, if any, is displayed
+Some devices organize channels into groups, the settings of which can
+only be changed as a group. The list of channel groups, if any, is displayed
with the \-\-show command.
.TP
.BR "\-t, \-\-triggers " <triggerlist>
with the \-\-show command.
.TP
.BR "\-t, \-\-triggers " <triggerlist>
gchar *opt_drv = NULL;
gchar *opt_config = NULL;
static gchar *opt_probes = NULL;
gchar *opt_drv = NULL;
gchar *opt_config = NULL;
static gchar *opt_probes = NULL;
-gchar *opt_probe_group = NULL;
+gchar *opt_channel_group = NULL;
gchar *opt_triggers = NULL;
gchar *opt_pds = NULL;
#ifdef HAVE_SRD
gchar *opt_triggers = NULL;
gchar *opt_pds = NULL;
#ifdef HAVE_SRD
"Output format", NULL},
{"probes", 'p', 0, G_OPTION_ARG_STRING, &opt_probes,
"Probes to use", NULL},
"Output format", NULL},
{"probes", 'p', 0, G_OPTION_ARG_STRING, &opt_probes,
"Probes to use", NULL},
- {"probe-group", 'g', 0, G_OPTION_ARG_STRING, &opt_probe_group,
- "Probe groups", NULL},
+ {"channel-group", 'g', 0, G_OPTION_ARG_STRING, &opt_channel_group,
+ "Channel groups", NULL},
{"triggers", 't', 0, G_OPTION_ARG_STRING, &opt_triggers,
"Trigger configuration", NULL},
{"wait-trigger", 'w', 0, G_OPTION_ARG_NONE, &opt_wait_trigger,
{"triggers", 't', 0, G_OPTION_ARG_STRING, &opt_triggers,
"Trigger configuration", NULL},
{"wait-trigger", 'w', 0, G_OPTION_ARG_NONE, &opt_wait_trigger,
int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args)
{
struct sr_config src;
int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args)
{
struct sr_config src;
- struct sr_probe_group *pg;
+ struct sr_channel_group *cg;
GHashTableIter iter;
gpointer key, value;
int ret;
GHashTableIter iter;
gpointer key, value;
int ret;
while (g_hash_table_iter_next(&iter, &key, &value)) {
if ((ret = opt_to_gvar(key, value, &src)) != 0)
return ret;
while (g_hash_table_iter_next(&iter, &key, &value)) {
if ((ret = opt_to_gvar(key, value, &src)) != 0)
return ret;
- pg = select_probe_group(sdi);
- ret = sr_config_set(sdi, pg, src.key, src.data);
+ cg = select_channel_group(sdi);
+ ret = sr_config_set(sdi, cg, src.key, src.data);
if (ret != SR_OK) {
g_critical("Failed to set device option '%s'.", (char *)key);
return ret;
if (ret != SR_OK) {
g_critical("Failed to set device option '%s'.", (char *)key);
return ret;
struct sr_dev_inst *sdi;
const struct sr_config_info *srci;
struct sr_probe *probe;
struct sr_dev_inst *sdi;
const struct sr_config_info *srci;
struct sr_probe *probe;
- struct sr_probe_group *probe_group, *pg;
- GSList *devices, *pgl, *prl;
+ struct sr_channel_group *channel_group, *cg;
+ GSList *devices, *cgl, *prl;
GVariant *gvar_opts, *gvar_dict, *gvar_list, *gvar;
gsize num_opts, num_elements;
double dlow, dhigh, dcur_low, dcur_high;
GVariant *gvar_opts, *gvar_dict, *gvar_list, *gvar;
gsize num_opts, num_elements;
double dlow, dhigh, dcur_low, dcur_high;
g_variant_unref(gvar_opts);
}
g_variant_unref(gvar_opts);
}
- /* Selected probes and probe group may affect which options are
+ /* Selected channels and channel group may affect which options are
* returned, or which values for them. */
select_probes(sdi);
* returned, or which values for them. */
select_probes(sdi);
- probe_group = select_probe_group(sdi);
+ channel_group = select_channel_group(sdi);
- if ((sr_config_list(sdi->driver, sdi, probe_group, SR_CONF_DEVICE_OPTIONS,
+ if ((sr_config_list(sdi->driver, sdi, channel_group, SR_CONF_DEVICE_OPTIONS,
&gvar_opts)) != SR_OK)
/* Driver supports no device instance options. */
return;
&gvar_opts)) != SR_OK)
/* Driver supports no device instance options. */
return;
- if (sdi->probe_groups) {
- printf("Probe groups:\n");
- for (pgl = sdi->probe_groups; pgl; pgl = pgl->next) {
- pg = pgl->data;
- printf(" %s: channel%s", pg->name,
- g_slist_length(pg->probes) > 1 ? "s" : "");
- for (prl = pg->probes; prl; prl = prl->next) {
+ if (sdi->channel_groups) {
+ printf("Channel groups:\n");
+ for (cgl = sdi->channel_groups; cgl; cgl = cgl->next) {
+ cg = cgl->data;
+ printf(" %s: channel%s", cg->name,
+ g_slist_length(cg->channels) > 1 ? "s" : "");
+ for (prl = cg->channels; prl; prl = prl->next) {
probe = prl->data;
printf(" %s", probe->name);
}
probe = prl->data;
printf(" %s", probe->name);
}
}
printf("Supported configuration options");
}
printf("Supported configuration options");
- if (sdi->probe_groups) {
- if (!probe_group)
- printf(" across all probe groups");
+ if (sdi->channel_groups) {
+ if (!channel_group)
+ printf(" across all channel groups");
- printf(" on probe group %s", probe_group->name);
+ printf(" on channel group %s", channel_group->name);
}
printf(":\n");
opts = g_variant_get_fixed_array(gvar_opts, &num_opts, sizeof(int32_t));
}
printf(":\n");
opts = g_variant_get_fixed_array(gvar_opts, &num_opts, sizeof(int32_t));
continue;
if (srci->key == SR_CONF_TRIGGER_TYPE) {
continue;
if (srci->key == SR_CONF_TRIGGER_TYPE) {
- if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+ if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
&gvar) != SR_OK) {
printf("\n");
continue;
&gvar) != SR_OK) {
printf("\n");
continue;
* only to those that don't support compression, or
* have it turned off by default. The values returned
* are the low/high limits. */
* only to those that don't support compression, or
* have it turned off by default. The values returned
* are the low/high limits. */
- if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+ if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
&gvar) != SR_OK) {
continue;
}
&gvar) != SR_OK) {
continue;
}
} else if (srci->key == SR_CONF_SAMPLERATE) {
/* Supported samplerates */
printf(" %s", srci->id);
} else if (srci->key == SR_CONF_SAMPLERATE) {
/* Supported samplerates */
printf(" %s", srci->id);
- if (sr_config_list(sdi->driver, sdi, probe_group, SR_CONF_SAMPLERATE,
+ if (sr_config_list(sdi->driver, sdi, channel_group, SR_CONF_SAMPLERATE,
&gvar_dict) != SR_OK) {
printf("\n");
continue;
&gvar_dict) != SR_OK) {
printf("\n");
continue;
} else if (srci->key == SR_CONF_BUFFERSIZE) {
/* Supported buffer sizes */
printf(" %s", srci->id);
} else if (srci->key == SR_CONF_BUFFERSIZE) {
/* Supported buffer sizes */
printf(" %s", srci->id);
- if (sr_config_list(sdi->driver, sdi, probe_group,
+ if (sr_config_list(sdi->driver, sdi, channel_group,
SR_CONF_BUFFERSIZE, &gvar_list) != SR_OK) {
printf("\n");
continue;
SR_CONF_BUFFERSIZE, &gvar_list) != SR_OK) {
printf("\n");
continue;
} else if (srci->key == SR_CONF_TIMEBASE) {
/* Supported time bases */
printf(" %s", srci->id);
} else if (srci->key == SR_CONF_TIMEBASE) {
/* Supported time bases */
printf(" %s", srci->id);
- if (sr_config_list(sdi->driver, sdi, probe_group,
+ if (sr_config_list(sdi->driver, sdi, channel_group,
SR_CONF_TIMEBASE, &gvar_list) != SR_OK) {
printf("\n");
continue;
SR_CONF_TIMEBASE, &gvar_list) != SR_OK) {
printf("\n");
continue;
} else if (srci->key == SR_CONF_VDIV) {
/* Supported volts/div values */
printf(" %s", srci->id);
} else if (srci->key == SR_CONF_VDIV) {
/* Supported volts/div values */
printf(" %s", srci->id);
- if (sr_config_list(sdi->driver, sdi, probe_group,
+ if (sr_config_list(sdi->driver, sdi, channel_group,
SR_CONF_VDIV, &gvar_list) != SR_OK) {
printf("\n");
continue;
SR_CONF_VDIV, &gvar_list) != SR_OK) {
printf("\n");
continue;
} else if (srci->datatype == SR_T_CHAR) {
printf(" %s: ", srci->id);
} else if (srci->datatype == SR_T_CHAR) {
printf(" %s: ", srci->id);
- if (sr_config_get(sdi->driver, sdi, probe_group, srci->key,
+ if (sr_config_get(sdi->driver, sdi, channel_group, srci->key,
&gvar) == SR_OK) {
tmp_str = g_strdup(g_variant_get_string(gvar, NULL));
g_variant_unref(gvar);
} else
tmp_str = NULL;
&gvar) == SR_OK) {
tmp_str = g_strdup(g_variant_get_string(gvar, NULL));
g_variant_unref(gvar);
} else
tmp_str = NULL;
- if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+ if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
&gvar) != SR_OK) {
printf("\n");
continue;
&gvar) != SR_OK) {
printf("\n");
continue;
} else if (srci->datatype == SR_T_UINT64_RANGE) {
printf(" %s: ", srci->id);
} else if (srci->datatype == SR_T_UINT64_RANGE) {
printf(" %s: ", srci->id);
- if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+ if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
&gvar_list) != SR_OK) {
printf("\n");
continue;
&gvar_list) != SR_OK) {
printf("\n");
continue;
/* device.c */
GSList *device_scan(void);
/* device.c */
GSList *device_scan(void);
-struct sr_probe_group *select_probe_group(struct sr_dev_inst *sdi);
+struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi);
/* session.c */
int setup_output_format(void);
/* session.c */
int setup_output_format(void);