This fixes parts of bug #259.
sdi->probes = g_slist_append(sdi->probes, probe);
cg = g_malloc(sizeof(struct sr_channel_group));
cg->name = g_strdup(channel);
- cg->probes = g_slist_append(NULL, probe);
+ cg->channels = g_slist_append(NULL, probe);
cg->priv = NULL;
sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
}
}
} else {
/* We only ever have one channel per channel group in this driver. */
- probe = channel_group->probes->data;
+ probe = channel_group->channels->data;
channel = probe->index;
switch (key) {
} else {
/* Channel group specified: per-channel options. */
/* We only ever have one channel per channel group in this driver. */
- probe = channel_group->probes->data;
+ probe = channel_group->channels->data;
channel = probe->index;
switch (key) {
if (!sdi)
return SR_ERR_ARG;
/* We only ever have one channel per channel group in this driver. */
- probe = channel_group->probes->data;
+ probe = channel_group->channels->data;
channel = probe->index;
switch (key) {
if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
return NULL;
cg->name = g_strdup("Logic");
- cg->probes = NULL;
+ cg->channels = NULL;
cg->priv = NULL;
for (i = 0; i < num_logic_probes; i++) {
sprintf(probe_name, "D%d", i);
if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, probe_name)))
return NULL;
sdi->probes = g_slist_append(sdi->probes, probe);
- cg->probes = g_slist_append(cg->probes, probe);
+ cg->channels = g_slist_append(cg->channels, probe);
}
sdi->channel_groups = g_slist_append(NULL, cg);
if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
return NULL;
cg->name = g_strdup(probe_name);
- cg->probes = g_slist_append(NULL, probe);
+ cg->channels = g_slist_append(NULL, probe);
/* Every channel group gets a generator struct. */
if (!(ag = g_try_malloc(sizeof(struct analog_gen))))
return NULL;
- ag->packet.probes = cg->probes;
+ ag->packet.probes = cg->channels;
ag->packet.mq = 0;
ag->packet.mqflags = 0;
ag->packet.unit = SR_UNIT_VOLT;
case SR_CONF_PATTERN_MODE:
if (!channel_group)
return SR_ERR_CHANNEL_GROUP;
- probe = channel_group->probes->data;
+ probe = channel_group->channels->data;
if (probe->type == SR_PROBE_LOGIC) {
pattern = devc->logic_pattern;
*data = g_variant_new_string(logic_pattern_str[pattern]);
if (!channel_group)
return SR_ERR_CHANNEL_GROUP;
stropt = g_variant_get_string(data, NULL);
- probe = channel_group->probes->data;
+ probe = channel_group->channels->data;
pattern = -1;
if (probe->type == SR_PROBE_LOGIC) {
for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) {
return SR_ERR_NA;
}
} else {
- probe = channel_group->probes->data;
+ probe = channel_group->channels->data;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
hmo_scope_state_free(devc->model_state);
for (i = 0; i < model->analog_channels; ++i)
- g_slist_free(devc->analog_groups[i].probes);
+ g_slist_free(devc->analog_groups[i].channels);
for (i = 0; i < model->digital_pods; ++i) {
- g_slist_free(devc->digital_groups[i].probes);
+ g_slist_free(devc->digital_groups[i].channels);
g_free(devc->digital_groups[i].name);
}
devc->analog_groups[i].name =
(char *)(*scope_models[model_index].analog_names)[i];
- devc->analog_groups[i].probes = g_slist_append(NULL, probe);
+ devc->analog_groups[i].channels = g_slist_append(NULL, probe);
sdi->channel_groups = g_slist_append(sdi->channel_groups,
&devc->analog_groups[i]);
return SR_ERR_MALLOC;
sdi->probes = g_slist_append(sdi->probes, probe);
- devc->digital_groups[i < 8 ? 0 : 1].probes = g_slist_append(
- devc->digital_groups[i < 8 ? 0 : 1].probes, probe);
+ devc->digital_groups[i < 8 ? 0 : 1].channels = g_slist_append(
+ devc->digital_groups[i < 8 ? 0 : 1].channels, probe);
}
devc->model_config = &scope_models[model_index];
g_free(devc->coupling[1]);
g_free(devc->trigger_source);
g_free(devc->trigger_slope);
- g_slist_free(devc->analog_groups[0].probes);
- g_slist_free(devc->analog_groups[1].probes);
- g_slist_free(devc->digital_group.probes);
+ g_slist_free(devc->analog_groups[0].channels);
+ g_slist_free(devc->analog_groups[1].channels);
+ g_slist_free(devc->digital_group.channels);
}
static int dev_clear(void)
probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel_name);
sdi->probes = g_slist_append(sdi->probes, probe);
devc->analog_groups[i].name = channel_name;
- devc->analog_groups[i].probes = g_slist_append(NULL, probe);
+ devc->analog_groups[i].channels = g_slist_append(NULL, probe);
sdi->channel_groups = g_slist_append(sdi->channel_groups,
&devc->analog_groups[i]);
}
if (!probe)
return NULL;
sdi->probes = g_slist_append(sdi->probes, probe);
- devc->digital_group.probes = g_slist_append(
- devc->digital_group.probes, probe);
+ devc->digital_group.channels = g_slist_append(
+ devc->digital_group.channels, probe);
}
devc->digital_group.name = "LA";
sdi->channel_groups = g_slist_append(sdi->channel_groups,
}
if (channel_group) {
- probe = g_slist_nth_data(channel_group->probes, 0);
+ probe = g_slist_nth_data(channel_group->channels, 0);
if (!probe)
return SR_ERR;
if (probe->type == SR_PROBE_ANALOG) {
/** Status/error codes returned by libsigrok functions. */
enum {
- SR_OK = 0, /**< No error. */
- SR_ERR = -1, /**< Generic/unspecified error. */
- SR_ERR_MALLOC = -2, /**< Malloc/calloc/realloc error. */
- SR_ERR_ARG = -3, /**< Function argument error. */
- SR_ERR_BUG = -4, /**< Errors hinting at internal bugs. */
- SR_ERR_SAMPLERATE = -5, /**< Incorrect samplerate. */
- SR_ERR_NA = -6, /**< Not applicable. */
- SR_ERR_DEV_CLOSED = -7, /**< Device is closed, but needs to be open. */
- SR_ERR_TIMEOUT = -8, /**< A timeout occurred. */
- SR_ERR_PROBE_GROUP= -9, /**< A channel group must be specified. */
+ SR_OK = 0, /**< No error. */
+ SR_ERR = -1, /**< Generic/unspecified error. */
+ SR_ERR_MALLOC = -2, /**< Malloc/calloc/realloc error. */
+ SR_ERR_ARG = -3, /**< Function argument error. */
+ SR_ERR_BUG = -4, /**< Errors hinting at internal bugs. */
+ SR_ERR_SAMPLERATE = -5, /**< Incorrect samplerate. */
+ SR_ERR_NA = -6, /**< Not applicable. */
+ SR_ERR_DEV_CLOSED = -7, /**< Device is closed, but must be open. */
+ SR_ERR_TIMEOUT = -8, /**< A timeout occurred. */
+ SR_ERR_CHANNEL_GROUP = -9, /**< A channel group must be specified. */
/*
* Note: When adding entries here, don't forget to also update the
char *trigger;
};
-/** Structure for groups of probes that have common properties. */
+/** Structure for groups of channels that have common properties. */
struct sr_channel_group {
/** Name of the channel group. */
char *name;
- /** List of sr_probe structs of the probes belonging to this group. */
- GSList *probes;
+ /** List of sr_probe structs of the channels belonging to this group. */
+ GSList *channels;
/** Private data for driver use. */
void *priv;
};