]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lascar-el-usb/api.c
Change type of SR_CONF keys to uint32_t.
[libsigrok.git] / src / hardware / lascar-el-usb / api.c
index 04f844b3318b1d575a4eec0a8f23708e59a162a9..0ffe3f48ddbb08393a3e528a8de654fdb914bd21 100644 (file)
 SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info;
 static struct sr_dev_driver *di = &lascar_el_usb_driver_info;
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_HYGROMETER,
        SR_CONF_DATALOG,
@@ -158,7 +158,7 @@ static int cleanup(void)
        return ret;
 }
 
-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;
@@ -169,7 +169,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        (void)cg;
 
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_CONN:
                if (!sdi || !sdi->conn)
                        return SR_ERR_ARG;
@@ -194,7 +194,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;
@@ -212,7 +212,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_DATALOG:
                if (g_variant_get_boolean(data)) {
                        /* Start logging. */
@@ -234,7 +234,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)
 {
        (void)sdi;
@@ -242,12 +242,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;
        default:
                return SR_ERR_NA;