From: Bert Vermeulen Date: Sun, 3 Nov 2013 13:16:10 +0000 (+0100) Subject: rigol-ds1xx2: Unbreak listing of _VDIV and _COUPLING X-Git-Tag: libsigrok-0.3.0~570 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=58f433696301321bda26431789abb2ba05e56dde;p=libsigrok.git rigol-ds1xx2: Unbreak listing of _VDIV and _COUPLING --- diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 8d5b90db..d6f055e6 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -607,29 +607,26 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, } break; case SR_CONF_COUPLING: - for (i = 0; i < 2; i++) { - if (probe_group == &devc->analog_groups[i]) { - *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling)); - return SR_OK; - } if (!probe_group) { sr_err("No probe group specified."); return SR_ERR_PROBE_GROUP; } - return SR_ERR_NA; + *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling)); + break; case SR_CONF_VDIV: - for (i = 0; i < 2; i++) { - if (probe_group == &devc->analog_groups[i]) { - rational[0] = g_variant_new_uint64(vdivs[i][0]); - rational[1] = g_variant_new_uint64(vdivs[i][1]); - *data = g_variant_new_tuple(rational, 2); - return SR_OK; - } if (!probe_group) { sr_err("No probe group specified."); return SR_ERR_PROBE_GROUP; } - return SR_ERR_NA; + g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); + for (i = 0; i < ARRAY_SIZE(vdivs); i++) { + rational[0] = g_variant_new_uint64(vdivs[i][0]); + rational[1] = g_variant_new_uint64(vdivs[i][1]); + tuple = g_variant_new_tuple(rational, 2); + g_variant_builder_add_value(&gvb, tuple); + } + *data = g_variant_builder_end(&gvb); + break; case SR_CONF_TIMEBASE: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); for (i = 0; i < ARRAY_SIZE(timebases); i++) {