double tmp_double, dlow, dhigh;
uint64_t tmp_u64, p, q, low, high, mqflags;
uint32_t mq;
- GVariant *rational[2], *range[2], *gvar, *gtup[2];
+ GVariant *rational[2], *range[2], *gtup[2];
GVariantBuilder *vbl;
gboolean tmp_bool;
gchar **keyval;
g_strfreev(keyval);
}
break;
- case SR_T_MQLIST:
+ case SR_T_MQ:
/*
Argument is MQ id e.g. ("voltage") optionally followed by one
or more /<mqflag> e.g. "/ac".
}
g_strfreev(keyval);
if (ret != -1) {
- vbl = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
gtup[0] = g_variant_new_uint32(mq);
gtup[1] = g_variant_new_uint64(mqflags);
- gvar = g_variant_new_tuple(gtup, 2);
- g_variant_builder_add_value(vbl, gvar);
- src->data = g_variant_builder_end(vbl);
+ src->data = g_variant_new_tuple(gtup, 2);
}
break;
default:
struct sr_channel *ch;
struct sr_channel_group *channel_group, *cg;
GSList *devices, *cgl, *chl, *channel_groups;
- GVariant *gvar_opts, *gvar_dict, *gvar_list, *gvar, *element;
+ GVariant *gvar_opts, *gvar_dict, *gvar_list, *gvar;
gsize num_opts, num_elements;
double dlow, dhigh, dcur_low, dcur_high;
const uint64_t *uint64, p, q, low, high;
}
g_variant_unref(gvar_list);
- } else if (srci->datatype == SR_T_MQLIST) {
+ } else if (srci->datatype == SR_T_MQ) {
printf(" %s: ", srci->id);
if (maybe_config_get(driver, sdi, channel_group, key,
&gvar) == SR_OK
- && g_variant_is_of_type(gvar, G_VARIANT_TYPE_ARRAY)
- && g_variant_n_children(gvar) == 1) {
- element = g_variant_get_child_value(gvar, 0);
- g_variant_get(element, "(ut)", &cur_mq, &cur_mqflags);
- g_variant_unref(element);
+ && g_variant_is_of_type(gvar, G_VARIANT_TYPE_TUPLE)
+ && g_variant_n_children(gvar) == 2) {
+ g_variant_get(gvar, "(ut)", &cur_mq, &cur_mqflags);
g_variant_unref(gvar);
} else
cur_mq = cur_mqflags = 0;