]> sigrok.org Git - libsigrok.git/commitdiff
center-3xx: Publish driver options.
authorUwe Hermann <redacted>
Tue, 18 Nov 2014 18:16:39 +0000 (19:16 +0100)
committerUwe Hermann <redacted>
Tue, 18 Nov 2014 22:20:09 +0000 (23:20 +0100)
src/hardware/center-3xx/api.c

index 0d671fbfff8b1d703893f473657ac63a031dc2bd..d5801ce907c65e3b8cd2cf59bbf8895cfeb556ba 100644 (file)
@@ -25,9 +25,12 @@ static const uint32_t scanopts[] = {
        SR_CONF_SERIALCOMM,
 };
 
-static const uint32_t devopts[] = {
+static const uint32_t drvopts[] = {
        SR_CONF_THERMOMETER,
-       SR_CONF_CONTINUOUS,
+};
+
+static const uint32_t devopts[] = {
+       SR_CONF_CONTINUOUS | SR_CONF_SET,
        SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
        SR_CONF_LIMIT_MSEC | SR_CONF_SET,
 };
@@ -192,7 +195,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
 static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
-       (void)sdi;
        (void)cg;
 
        switch (key) {
@@ -201,7 +203,11 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
                                scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                break;
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+               if (!sdi)
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
+               else
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                break;
        default: