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;
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;