]> sigrok.org Git - libsigrok.git/commitdiff
session_driver.c: Allow querying of SR_CONF_CAPTURE_UNITSIZE.
authorUwe Hermann <redacted>
Sun, 9 Nov 2014 19:04:09 +0000 (20:04 +0100)
committerUwe Hermann <redacted>
Sun, 9 Nov 2014 19:04:09 +0000 (20:04 +0100)
src/session_driver.c

index 4c4ef364883e83b6e3d0ddf357d20fc9ee8266fa..511adac5978814f05f61ca9f30e839ecd17de999 100644 (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;