session_driver.c: Allow querying of SR_CONF_CAPTURE_UNITSIZE.

This commit is contained in:
Uwe Hermann 2014-11-09 20:04:09 +01:00
parent 6508992d04
commit 3f2cd87f36
1 changed files with 9 additions and 5 deletions

View File

@ -216,13 +216,17 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
(void)cg; (void)cg;
if (!sdi)
return SR_ERR;
vdev = sdi->priv;
switch (key) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) {
vdev = sdi->priv;
*data = g_variant_new_uint64(vdev->samplerate); *data = g_variant_new_uint64(vdev->samplerate);
} else break;
return SR_ERR; case SR_CONF_CAPTURE_UNITSIZE:
*data = g_variant_new_uint64(vdev->unitsize);
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;