/* short name, full name */
static const struct rigol_ds_vendor supported_vendors[] = {
[RIGOL] = {"Rigol", "Rigol Technologies"},
/* short name, full name */
static const struct rigol_ds_vendor supported_vendors[] = {
[RIGOL] = {"Rigol", "Rigol Technologies"},
g_free(devc->coupling[1]);
g_free(devc->trigger_source);
g_free(devc->trigger_slope);
g_free(devc->coupling[1]);
g_free(devc->trigger_source);
g_free(devc->trigger_slope);
- g_slist_free(devc->analog_groups[0].channels);
- g_slist_free(devc->analog_groups[1].channels);
- g_slist_free(devc->digital_group.channels);
+ g_free(devc->analog_groups);
+ g_free(devc->digital_group);
+ g_free(devc);
for (i = 0; i < model->analog_channels; i++) {
if (!(channel_name = g_strdup_printf("CH%d", i + 1)))
return NULL;
ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel_name);
sdi->channels = g_slist_append(sdi->channels, ch);
for (i = 0; i < model->analog_channels; i++) {
if (!(channel_name = g_strdup_printf("CH%d", i + 1)))
return NULL;
ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel_name);
sdi->channels = g_slist_append(sdi->channels, ch);
- devc->analog_groups[i].name = channel_name;
- devc->analog_groups[i].channels = g_slist_append(NULL, ch);
+
+ devc->analog_groups[i] = g_malloc0(sizeof(struct sr_channel_group));
+
+ devc->analog_groups[i]->name = channel_name;
+ devc->analog_groups[i]->channels = g_slist_append(NULL, ch);
for (i = 0; i < 16; i++) {
if (!(channel_name = g_strdup_printf("D%d", i)))
return NULL;
for (i = 0; i < 16; i++) {
if (!(channel_name = g_strdup_printf("D%d", i)))
return NULL;
- devc->digital_group.channels = g_slist_append(
- devc->digital_group.channels, ch);
+ devc->digital_group->channels = g_slist_append(
+ devc->digital_group->channels, ch);
}
g_variant_get(data, "(tt)", &p, &q);
for (i = 0; i < 2; i++) {
}
g_variant_get(data, "(tt)", &p, &q);
for (i = 0; i < 2; i++) {
}
tmp_str = g_variant_get_string(data, NULL);
for (i = 0; i < 2; i++) {
}
tmp_str = g_variant_get_string(data, NULL);
for (i = 0; i < 2; i++) {
for (j = 0; j < ARRAY_SIZE(coupling); j++) {
if (!strcmp(tmp_str, coupling[j])) {
g_free(devc->coupling[i]);
for (j = 0; j < ARRAY_SIZE(coupling); j++) {
if (!strcmp(tmp_str, coupling[j])) {
g_free(devc->coupling[i]);
*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++) {
*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++) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t));
return SR_OK;
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t));
return SR_OK;