X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fsession_driver.c;h=6a320aa5b3d17908dc401fa75bea5bd1ec0d3853;hp=9120ea14575b4f2e71fbfa3d0fcdfc28100b8467;hb=584560f142e1b17b9f4ef9069bd3724f2f77e750;hpb=a4e47454580b83972f052b5ace8e687d54d9425c diff --git a/src/session_driver.c b/src/session_driver.c index 9120ea14..6a320aa5 100644 --- a/src/session_driver.c +++ b/src/session_driver.c @@ -49,7 +49,7 @@ struct session_vdev { gboolean finished; }; -static const int hwcaps[] = { +static const uint32_t hwcaps[] = { SR_CONF_CAPTUREFILE, SR_CONF_CAPTURE_UNITSIZE, SR_CONF_SAMPLERATE, @@ -209,14 +209,14 @@ static int dev_close(struct sr_dev_inst *sdi) return SR_OK; } -static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, +static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct session_vdev *vdev; (void)cg; - switch (id) { + switch (key) { case SR_CONF_SAMPLERATE: if (sdi) { vdev = sdi->priv; @@ -231,7 +231,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, return SR_OK; } -static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, +static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct session_vdev *vdev; @@ -240,7 +240,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, vdev = sdi->priv; - switch (id) { + switch (key) { case SR_CONF_SAMPLERATE: vdev->samplerate = g_variant_get_uint64(data); sr_info("Setting samplerate to %" PRIu64 ".", vdev->samplerate); @@ -268,7 +268,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, return SR_OK; } -static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, +static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { (void)sdi; @@ -276,8 +276,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, switch (key) { case SR_CONF_DEVICE_OPTIONS: - *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, - hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); + *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, + hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t)); break; default: return SR_ERR_NA;