]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds1xx2: Unbreak listing of _VDIV and _COUPLING
authorBert Vermeulen <redacted>
Sun, 3 Nov 2013 13:16:10 +0000 (14:16 +0100)
committerUwe Hermann <redacted>
Fri, 8 Nov 2013 00:03:19 +0000 (01:03 +0100)
hardware/rigol-ds1xx2/api.c

index 8d5b90db183a24bf2c020821db9e75a05cff7160..d6f055e64549662c01fa4894a3f84d244c1711b0 100644 (file)
@@ -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++) {