]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/openbench-logic-sniffer/api.c
Change type of SR_CONF keys to uint32_t.
[libsigrok.git] / src / hardware / openbench-logic-sniffer / api.c
index cd9d817e22c17c2de8e87cc562c91ff68d5d7182..ac69250cf19ecc3d36e72acdaa8bee65a01025aa 100644 (file)
 
 #define SERIALCOMM "115200/8n1"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -215,7 +215,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
-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 dev_context *devc;
@@ -226,7 +226,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                return SR_ERR_ARG;
 
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
@@ -254,7 +254,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 dev_context *devc;
@@ -270,7 +270,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                tmp_u64 = g_variant_get_uint64(data);
                if (tmp_u64 < samplerates[0] || tmp_u64 > samplerates[1])
@@ -351,7 +351,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
-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)
 {
        struct dev_context *devc;
@@ -363,12 +363,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
                break;
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));