]> sigrok.org Git - libsigrok.git/commitdiff
zeroplus-logic-cube: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES.
authorBert Vermeulen <redacted>
Thu, 9 Jan 2014 13:30:20 +0000 (14:30 +0100)
committerBert Vermeulen <redacted>
Thu, 9 Jan 2014 13:30:20 +0000 (14:30 +0100)
hardware/zeroplus-logic-cube/api.c

index 25b4f78f80aa278a5a30cc996a2d88d203db85da..74b3f0f3d5ef003278fdc6c24536153e1000d077 100644 (file)
@@ -486,14 +486,14 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                        sr_spew("Returning samplerate: %" PRIu64 "Hz.",
                                devc->cur_samplerate);
                } else
-                       return SR_ERR;
+                       return SR_ERR_ARG;
                break;
        case SR_CONF_CAPTURE_RATIO:
                if (sdi) {
                        devc = sdi->priv;
                        *data = g_variant_new_uint64(devc->capture_ratio);
                } else
-                       return SR_ERR;
+                       return SR_ERR_ARG;
                break;
        case SR_CONF_VOLTAGE_THRESHOLD:
                if (sdi) {
@@ -502,6 +502,16 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                        range[0] = g_variant_new_double(devc->cur_threshold);
                        range[1] = g_variant_new_double(devc->cur_threshold);
                        *data = g_variant_new_tuple(range, 2);
+               } else
+                       return SR_ERR_ARG;
+               break;
+       case SR_CONF_MAX_UNCOMPRESSED_SAMPLES:
+               if (sdi) {
+                       /* As long as this driver doesn't support compression,
+                        * this is ok. When compression is enabled, this should
+                        * return SR_ERR_NA instead. */
+                       devc = sdi->priv;
+                       *data = g_variant_new_uint64(devc->max_sample_depth);
                } else
                        return SR_ERR;
                break;