From: Bert Vermeulen Date: Thu, 9 Jan 2014 13:30:20 +0000 (+0100) Subject: zeroplus-logic-cube: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES. X-Git-Tag: libsigrok-0.3.0~325 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=67055d4c184c8ff1db5f296608ac5c77f80ac437;p=libsigrok.git zeroplus-logic-cube: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES. --- diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index 25b4f78f..74b3f0f3 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -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;