From: Uwe Hermann Date: Sun, 9 Nov 2014 19:04:09 +0000 (+0100) Subject: session_driver.c: Allow querying of SR_CONF_CAPTURE_UNITSIZE. X-Git-Tag: libsigrok-0.4.0~811 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3f2cd87f36fa8bb6fddc4ace7a6c9571e7c2309d;p=libsigrok.git session_driver.c: Allow querying of SR_CONF_CAPTURE_UNITSIZE. --- diff --git a/src/session_driver.c b/src/session_driver.c index 4c4ef364..511adac5 100644 --- a/src/session_driver.c +++ b/src/session_driver.c @@ -216,13 +216,17 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s (void)cg; + if (!sdi) + return SR_ERR; + + vdev = sdi->priv; + switch (key) { case SR_CONF_SAMPLERATE: - if (sdi) { - vdev = sdi->priv; - *data = g_variant_new_uint64(vdev->samplerate); - } else - return SR_ERR; + *data = g_variant_new_uint64(vdev->samplerate); + break; + case SR_CONF_CAPTURE_UNITSIZE: + *data = g_variant_new_uint64(vdev->unitsize); break; default: return SR_ERR_NA;