]> sigrok.org Git - libsigrok.git/commitdiff
Change type of SR_CONF keys to uint32_t.
authorBert Vermeulen <redacted>
Tue, 16 Sep 2014 15:49:20 +0000 (17:49 +0200)
committerBert Vermeulen <redacted>
Tue, 16 Sep 2014 19:22:41 +0000 (21:22 +0200)
55 files changed:
include/libsigrok/libsigrok.h
include/libsigrok/proto.h
src/hardware/agilent-dmm/api.c
src/hardware/appa-55ii/api.c
src/hardware/asix-sigma/asix-sigma.c
src/hardware/atten-pps3xxx/api.c
src/hardware/beaglelogic/api.c
src/hardware/brymen-bm86x/api.c
src/hardware/brymen-dmm/api.c
src/hardware/cem-dt-885x/api.c
src/hardware/center-3xx/api.c
src/hardware/chronovu-la/api.c
src/hardware/colead-slm/api.c
src/hardware/conrad-digi-35-cpu/api.c
src/hardware/demo/demo.c
src/hardware/fluke-dmm/api.c
src/hardware/fx2lafw/api.c
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/gmc-mh-1x-2x/protocol.c
src/hardware/gmc-mh-1x-2x/protocol.h
src/hardware/hameg-hmo/api.c
src/hardware/hameg-hmo/protocol.c
src/hardware/hameg-hmo/protocol.h
src/hardware/hantek-dso/api.c
src/hardware/ikalogic-scanalogic2/api.c
src/hardware/ikalogic-scanaplus/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/lascar-el-usb/api.c
src/hardware/link-mso19/api.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/mic-985xx/api.c
src/hardware/motech-lps-30x/api.c
src/hardware/norma-dmm/api.c
src/hardware/openbench-logic-sniffer/api.c
src/hardware/pipistrello-ols/api.c
src/hardware/rigol-ds/api.c
src/hardware/saleae-logic16/api.c
src/hardware/scpi-pps/api.c
src/hardware/scpi-pps/profiles.c
src/hardware/scpi-pps/protocol.h
src/hardware/serial-dmm/api.c
src/hardware/sysclk-lwla/api.c
src/hardware/teleinfo/api.c
src/hardware/testo/api.c
src/hardware/tondaj-sl-814/api.c
src/hardware/uni-t-dmm/api.c
src/hardware/uni-t-ut32x/api.c
src/hardware/victor-dmm/api.c
src/hardware/yokogawa-dlm/api.c
src/hardware/yokogawa-dlm/protocol.c
src/hardware/yokogawa-dlm/protocol.h
src/hardware/zeroplus-logic-cube/api.c
src/hwdriver.c
src/libsigrok-internal.h
src/session_driver.c

index 3ecc460a28fa9bb387443ec4e5f180615ebc22cd..c029f1176f193a7c9aeb0af21f9dd5e2b573e20b 100644 (file)
@@ -486,7 +486,7 @@ struct sr_channel_group {
 /** Used for setting or getting value of a config item. */
 struct sr_config {
        /** Config key like SR_CONF_CONN, etc. */
 /** Used for setting or getting value of a config item. */
 struct sr_config {
        /** Config key like SR_CONF_CONN, etc. */
-       int key;
+       uint32_t key;
        /** Key-specific data. */
        GVariant *data;
 };
        /** Key-specific data. */
        GVariant *data;
 };
@@ -494,7 +494,7 @@ struct sr_config {
 /** Information about a config key. */
 struct sr_config_info {
        /** Config key like SR_CONF_CONN, etc. */
 /** Information about a config key. */
 struct sr_config_info {
        /** Config key like SR_CONF_CONN, etc. */
-       int key;
+       uint32_t key;
        /** Data type like SR_T_STRING, etc. */
        int datatype;
        /** Id string, e.g. "serialcomm". */
        /** Data type like SR_T_STRING, etc. */
        int datatype;
        /** Id string, e.g. "serialcomm". */
@@ -930,12 +930,12 @@ struct sr_dev_driver {
        /** Query value of a configuration key in driver or given device instance.
         *  @see sr_config_get().
         */
        /** Query value of a configuration key in driver or given device instance.
         *  @see sr_config_get().
         */
-       int (*config_get) (int id, GVariant **data,
+       int (*config_get) (uint32_t key, GVariant **data,
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
        /** Set value of a configuration key in driver or a given device instance.
         *  @see sr_config_set(). */
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
        /** Set value of a configuration key in driver or a given device instance.
         *  @see sr_config_set(). */
-       int (*config_set) (int id, GVariant *data,
+       int (*config_set) (uint32_t key, GVariant *data,
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
        /** Channel status change.
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
        /** Channel status change.
@@ -948,7 +948,7 @@ struct sr_dev_driver {
        /** List all possible values for a configuration key in a device instance.
         *  @see sr_config_list().
         */
        /** List all possible values for a configuration key in a device instance.
         *  @see sr_config_list().
         */
-       int (*config_list) (int info_id, GVariant **data,
+       int (*config_list) (uint32_t key, GVariant **data,
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
 
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
 
index e8aa7ab10a423bb46b82e709b078a972640243b8..68e7a1ab5491b31a4df91dd5b906b36db37b9758 100644 (file)
@@ -64,16 +64,16 @@ SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options);
 SR_API int sr_config_get(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
 SR_API int sr_config_get(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
-               int key, GVariant **data);
+               uint32_t key, GVariant **data);
 SR_API int sr_config_set(const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
 SR_API int sr_config_set(const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
-               int key, GVariant *data);
+               uint32_t key, GVariant *data);
 SR_API int sr_config_commit(const struct sr_dev_inst *sdi);
 SR_API int sr_config_list(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
 SR_API int sr_config_commit(const struct sr_dev_inst *sdi);
 SR_API int sr_config_list(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
-               int key, GVariant **data);
-SR_API const struct sr_config_info *sr_config_info_get(int key);
+               uint32_t key, GVariant **data);
+SR_API const struct sr_config_info *sr_config_info_get(uint32_t key);
 SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);
 
 /*--- session.c -------------------------------------------------------------*/
 SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);
 
 /*--- session.c -------------------------------------------------------------*/
index 55f87416721df2bc198fac3f8ab85f7df33d3508..df2d94e8511b709dbca1987636efde96145eab56 100644 (file)
 #include "libsigrok-internal.h"
 #include "agilent-dmm.h"
 
 #include "libsigrok-internal.h"
 #include "agilent-dmm.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -178,7 +178,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -193,7 +193,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                return SR_ERR_BUG;
        }
 
                return SR_ERR_BUG;
        }
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (g_variant_get_uint64(data) == 0) {
        case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (g_variant_get_uint64(data) == 0) {
@@ -216,7 +216,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -224,12 +224,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index de71e338d8f84fd22b7fd3b618ed25a633b2ebcc..f57a3b901a3782c0fa89a0a8f26985f5264cc681 100644 (file)
 #include <string.h>
 #include "protocol.h"
 
 #include <string.h>
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_THERMOMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -137,7 +137,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-static int config_get(int key, 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 = sdi->priv;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc = sdi->priv;
@@ -161,7 +161,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -205,7 +205,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -213,12 +213,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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_DATA_SOURCE:
                *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
                break;
        case SR_CONF_DATA_SOURCE:
                *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
index bfd69484bf8b944e8db564bc82ccab03cdb33d93..55c6026cacbefb4661d5fd8bc7f961f231791d61 100644 (file)
@@ -71,7 +71,7 @@ static const char *channel_names[] = {
        "9", "10", "11", "12", "13", "14", "15", "16",
 };
 
        "9", "10", "11", "12", "13", "14", "15", "16",
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -813,7 +813,7 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -824,7 +824,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                return SR_ERR;
        devc = sdi->priv;
 
                return SR_ERR;
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
@@ -841,7 +841,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -856,7 +856,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        devc = sdi->priv;
 
        ret = SR_OK;
        devc = sdi->priv;
 
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                ret = set_samplerate(sdi, g_variant_get_uint64(data));
                break;
        case SR_CONF_SAMPLERATE:
                ret = set_samplerate(sdi, g_variant_get_uint64(data));
                break;
@@ -885,7 +885,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *gvar;
                const struct sr_channel_group *cg)
 {
        GVariant *gvar;
@@ -896,8 +896,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
@@ -907,7 +907,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                *data = g_variant_builder_end(&gvb);
                break;
        case SR_CONF_TRIGGER_MATCH:
                *data = g_variant_builder_end(&gvb);
                break;
        case SR_CONF_TRIGGER_MATCH:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                trigger_matches, ARRAY_SIZE(trigger_matches),
                                sizeof(int32_t));
                break;
                                trigger_matches, ARRAY_SIZE(trigger_matches),
                                sizeof(int32_t));
                break;
index b6eae3cc776a979e0fa4871bd8fa52bcaf7593f4..0df8bcf0fe2d877e9edb67de5450a1761e84047d 100644 (file)
  */
 #define SERIALCOMM "9600/8n2"
 
  */
 #define SERIALCOMM "9600/8n2"
 
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
        SR_CONF_POWER_SUPPLY,
        SR_CONF_CONTINUOUS,
        SR_CONF_OUTPUT_CHANNEL_CONFIG,
        SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
 };
 
        SR_CONF_POWER_SUPPLY,
        SR_CONF_CONTINUOUS,
        SR_CONF_OUTPUT_CHANNEL_CONFIG,
        SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
 };
 
-static const int32_t devopts_cg[] = {
+static const uint32_t devopts_cg[] = {
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_VOLTAGE_MAX,
        SR_CONF_OUTPUT_CURRENT,
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_VOLTAGE_MAX,
        SR_CONF_OUTPUT_CURRENT,
@@ -205,7 +205,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -274,7 +274,7 @@ static int find_str(const char *str, const char **strings, int array_size)
        return idx;
 }
 
        return idx;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -358,7 +358,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -369,8 +369,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        /* Always available, even without sdi. */
        if (key == SR_CONF_SCAN_OPTIONS) {
 
        /* Always available, even without sdi. */
        if (key == SR_CONF_SCAN_OPTIONS) {
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                return SR_OK;
        }
 
                return SR_OK;
        }
 
@@ -383,8 +383,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                /* No channel group: global options. */
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
                /* No channel group: global options. */
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                       devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                       devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                        break;
                case SR_CONF_OUTPUT_CHANNEL_CONFIG:
                        if (devc->model->channel_modes == CHANMODE_INDEPENDENT) {
                        break;
                case SR_CONF_OUTPUT_CHANNEL_CONFIG:
                        if (devc->model->channel_modes == CHANMODE_INDEPENDENT) {
@@ -408,8 +408,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
 
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                       devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                       devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
                        break;
                case SR_CONF_OUTPUT_VOLTAGE_MAX:
                        g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
                        break;
                case SR_CONF_OUTPUT_VOLTAGE_MAX:
                        g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
index c86925be56d9133ed1443d282cec44d65c7fe834..b5850314eab9b5b0a0476210b136fee5fba5aad1 100644 (file)
@@ -24,7 +24,7 @@ SR_PRIV struct sr_dev_driver beaglelogic_driver_info;
 static struct sr_dev_driver *di = &beaglelogic_driver_info;
 
 /* Hardware capabiities */
 static struct sr_dev_driver *di = &beaglelogic_driver_info;
 
 /* Hardware capabiities */
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -223,7 +223,7 @@ static int cleanup(void)
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_get(int key, 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 = sdi->priv;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc = sdi->priv;
@@ -249,7 +249,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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 = sdi->priv;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc = sdi->priv;
@@ -289,7 +289,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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)
 {
        int ret;
                const struct sr_channel_group *cg)
 {
        int ret;
@@ -303,8 +303,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        ret = SR_OK;
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
        ret = SR_OK;
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
@@ -314,7 +314,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                *data = g_variant_builder_end(&gvb);
                break;
        case SR_CONF_TRIGGER_MATCH:
                *data = g_variant_builder_end(&gvb);
                break;
        case SR_CONF_TRIGGER_MATCH:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
                                sizeof(int32_t));
                break;
                                soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
                                sizeof(int32_t));
                break;
index be21583b169b15199077e7ec975d92430ae33f2a..f47c01ed74884f7fbb65c8be760851c1427f67bf 100644 (file)
 
 #define BRYMEN_BC86X "0820.0001"
 
 
 #define BRYMEN_BC86X "0820.0001"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -182,7 +182,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-static int config_get(int key, 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 = sdi->priv;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc = sdi->priv;
@@ -203,7 +203,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -234,7 +234,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                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:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 1ccd18af0fa36f3eb92685d818c2fe94308b6edc..f0ba3923e74874cbc0a702143528e0ab811a4d34 100644 (file)
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
@@ -149,7 +149,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -166,7 +166,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        }
 
        ret = SR_OK;
        }
 
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                break;
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                break;
@@ -180,7 +180,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -188,12 +188,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 9aed547362c59bd5933c45e56cff2e24a7fb43f8..943377a3df67e67ee2f182eaafacba15c0e36e5e 100644 (file)
 /* 23ms is the longest interval between tokens. */
 #define MAX_SCAN_TIME 25 * 1000
 
 /* 23ms is the longest interval between tokens. */
 #define MAX_SCAN_TIME 25 * 1000
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
@@ -165,7 +165,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -237,7 +237,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        return ret;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -327,7 +327,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *tuple, *range[2];
                const struct sr_channel_group *cg)
 {
        GVariant *tuple, *range[2];
@@ -341,12 +341,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        ret = SR_OK;
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
        ret = SR_OK;
        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:
                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_SPL_WEIGHT_FREQ:
                *data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq));
                break;
        case SR_CONF_SPL_WEIGHT_FREQ:
                *data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq));
index 0f80cf83d1e92a484b5334f2b54a8d56ab5c4300..edaecd7be4af264812247e064d9a4ed23b5c5c9e 100644 (file)
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_THERMOMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -158,7 +158,7 @@ static int cleanup(int idx)
        return dev_clear(idx);
 }
 
        return dev_clear(idx);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -170,7 +170,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_SAMPLES:
                if (g_variant_get_uint64(data) == 0)
                        return SR_ERR_ARG;
        case SR_CONF_LIMIT_SAMPLES:
                if (g_variant_get_uint64(data) == 0)
                        return SR_ERR_ARG;
@@ -188,7 +188,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -196,12 +196,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 5a8a3d36c959a1c4b06c7411a07e01508d6907fe..f4b198946c661142c1c46f4d3012c6e788b10f88 100644 (file)
@@ -23,7 +23,7 @@
 SR_PRIV struct sr_dev_driver chronovu_la_driver_info;
 static struct sr_dev_driver *di = &chronovu_la_driver_info;
 
 SR_PRIV struct sr_dev_driver chronovu_la_driver_info;
 static struct sr_dev_driver *di = &chronovu_la_driver_info;
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -285,14 +285,14 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-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;
 
        (void)cg;
 
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
        (void)cg;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                if (!sdi || !(devc = sdi->priv))
                        return SR_ERR_BUG;
        case SR_CONF_SAMPLERATE:
                if (!sdi || !(devc = sdi->priv))
                        return SR_ERR_BUG;
@@ -305,7 +305,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -318,7 +318,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        if (!(devc = sdi->priv))
                return SR_ERR_BUG;
 
        if (!(devc = sdi->priv))
                return SR_ERR_BUG;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                if (cv_set_samplerate(sdi, g_variant_get_uint64(data)) < 0)
                        return SR_ERR;
        case SR_CONF_SAMPLERATE:
                if (cv_set_samplerate(sdi, g_variant_get_uint64(data)) < 0)
                        return SR_ERR;
@@ -340,7 +340,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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)
 {
        GVariant *gvar, *grange[2];
                const struct sr_channel_group *cg)
 {
        GVariant *gvar, *grange[2];
@@ -351,8 +351,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                if (!sdi || !sdi->priv || !(devc = sdi->priv))
                break;
        case SR_CONF_SAMPLERATE:
                if (!sdi || !sdi->priv || !(devc = sdi->priv))
@@ -379,7 +379,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        case SR_CONF_TRIGGER_MATCH:
                if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof)
                        return SR_ERR_BUG;
        case SR_CONF_TRIGGER_MATCH:
                if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof)
                        return SR_ERR_BUG;
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                trigger_matches, devc->prof->num_trigger_matches,
                                sizeof(int32_t));
                break;
                                trigger_matches, devc->prof->num_trigger_matches,
                                sizeof(int32_t));
                break;
index d5fc9ac1c28f5e4f63b68fdaa74fba6436bb53bd..8e48552da7a9f7239cbf8ed40045b1351ceda0a3 100644 (file)
 /* The Colead SL-5868P uses this. */
 #define SERIALCOMM "2400/8n1"
 
 /* The Colead SL-5868P uses this. */
 #define SERIALCOMM "2400/8n1"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -129,7 +129,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -144,7 +144,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                return SR_ERR_BUG;
        }
 
                return SR_ERR_BUG;
        }
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (g_variant_get_uint64(data) == 0) {
        case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (g_variant_get_uint64(data) == 0) {
@@ -167,7 +167,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -175,12 +175,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 6a1f31c9a952d1777d23094f0ae4d10bce36d7d2..a2a881598b1b6b1798faed0d0ce636f8d5100600 100644 (file)
 
 #define SERIALCOMM "9600/8n1"
 
 
 #define SERIALCOMM "9600/8n1"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_POWER_SUPPLY,
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_CURRENT,
        SR_CONF_POWER_SUPPLY,
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_CURRENT,
@@ -121,7 +121,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-static int config_set(int key, 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)
 {
        int ret;
                const struct sr_channel_group *cg)
 {
        int ret;
@@ -164,7 +164,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        int ret;
                const struct sr_channel_group *cg)
 {
        int ret;
@@ -175,12 +175,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        ret = SR_OK;
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
        ret = SR_OK;
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 7fc959f493b018a766fe74a8f12792cc8e392351..d2fddde466751c1eb17b57e5d7b06e9b26127a29 100644 (file)
@@ -128,7 +128,7 @@ struct dev_context {
        GHashTable *ch_ag;
 };
 
        GHashTable *ch_ag;
 };
 
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
        SR_CONF_NUM_LOGIC_CHANNELS,
        SR_CONF_NUM_ANALOG_CHANNELS,
 };
        SR_CONF_NUM_LOGIC_CHANNELS,
        SR_CONF_NUM_ANALOG_CHANNELS,
 };
@@ -398,7 +398,7 @@ static int cleanup(void)
        return std_dev_clear(di, clear_helper);
 }
 
        return std_dev_clear(di, clear_helper);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -410,7 +410,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                return SR_ERR_ARG;
 
        devc = sdi->priv;
                return SR_ERR_ARG;
 
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
@@ -458,7 +458,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -475,7 +475,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                return SR_ERR_DEV_CLOSED;
 
        ret = SR_OK;
                return SR_ERR_DEV_CLOSED;
 
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                devc->cur_samplerate = g_variant_get_uint64(data);
                sr_dbg("Setting samplerate to %" PRIu64, devc->cur_samplerate);
        case SR_CONF_SAMPLERATE:
                devc->cur_samplerate = g_variant_get_uint64(data);
                sr_dbg("Setting samplerate to %" PRIu64, devc->cur_samplerate);
@@ -552,7 +552,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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 sr_channel *ch;
                const struct sr_channel_group *cg)
 {
        struct sr_channel *ch;
@@ -562,8 +562,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        (void)sdi;
 
        if (key == SR_CONF_SCAN_OPTIONS) {
        (void)sdi;
 
        if (key == SR_CONF_SCAN_OPTIONS) {
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                return SR_OK;
        }
 
                return SR_OK;
        }
 
@@ -573,8 +573,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        if (!cg) {
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
        if (!cg) {
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                       devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                       devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                        break;
                case SR_CONF_SAMPLERATE:
                        g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                        break;
                case SR_CONF_SAMPLERATE:
                        g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
@@ -594,11 +594,11 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                        if (ch->type == SR_CHANNEL_LOGIC)
                                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
                                                devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic),
                        if (ch->type == SR_CHANNEL_LOGIC)
                                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
                                                devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic),
-                                               sizeof(int32_t));
+                                               sizeof(uint32_t));
                        else if (ch->type == SR_CHANNEL_ANALOG)
                                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
                                                devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog),
                        else if (ch->type == SR_CHANNEL_ANALOG)
                                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
                                                devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog),
-                                               sizeof(int32_t));
+                                               sizeof(uint32_t));
                        else
                                return SR_ERR_BUG;
                        break;
                        else
                                return SR_ERR_BUG;
                        break;
index 3d739a18d26666431793ff6f04c22d8d9af6869f..505765573628e169ed55e338705830dde64902da 100644 (file)
 #include "libsigrok-internal.h"
 #include "fluke-dmm.h"
 
 #include "libsigrok-internal.h"
 #include "fluke-dmm.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -203,7 +203,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -218,7 +218,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                return SR_ERR_BUG;
        }
 
                return SR_ERR_BUG;
        }
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (g_variant_get_uint64(data) == 0) {
        case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (g_variant_get_uint64(data) == 0) {
@@ -241,7 +241,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -249,12 +249,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index d4643ff760f491e2269602000345f0739c5e6511..a233cbc878d61862bc529c7ecda95ea016b94e46 100644 (file)
@@ -73,11 +73,11 @@ static const struct fx2lafw_profile supported_fx2[] = {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
 };
 
        { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
 };
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_SAMPLERATE,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_SAMPLERATE,
@@ -385,7 +385,7 @@ static int cleanup(void)
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -399,7 +399,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_CONN:
                if (!sdi->conn)
                        return SR_ERR_ARG;
        case SR_CONF_CONN:
                if (!sdi->conn)
                        return SR_ERR_ARG;
@@ -424,7 +424,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -444,8 +444,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        ret = SR_OK;
 
 
        ret = SR_OK;
 
-       switch (id)
-       {
+       switch (key) {
                case SR_CONF_SAMPLERATE:
                        arg = g_variant_get_uint64(data);
                        for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
                case SR_CONF_SAMPLERATE:
                        arg = g_variant_get_uint64(data);
                        for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
@@ -467,7 +466,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *gvar;
                const struct sr_channel_group *cg)
 {
        GVariant *gvar;
@@ -478,12 +477,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index 96621bbfd6636f8f52a76b36dcdca496f19e99bc..f2d06c26c819dd3a766652fc20f5862ac9d2c05c 100644 (file)
 SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info;
 SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info;
 
 SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info;
 SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info;
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
 /** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
 /** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
-static const int32_t hwcaps_sm[] = {
+static const uint32_t hwcaps_sm[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_THERMOMETER,    /**< All GMC 1x/2x multimeters seem to support this */
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_MULTIMETER,
        SR_CONF_THERMOMETER,    /**< All GMC 1x/2x multimeters seem to support this */
        SR_CONF_LIMIT_SAMPLES,
@@ -49,7 +49,7 @@ static const int32_t hwcaps_sm[] = {
 };
 
 /** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */
 };
 
 /** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */
-static const int32_t hwcaps_bd[] = {
+static const uint32_t hwcaps_bd[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_THERMOMETER,    /**< All GMC 1x/2x multimeters seem to support this */
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_MULTIMETER,
        SR_CONF_THERMOMETER,    /**< All GMC 1x/2x multimeters seem to support this */
        SR_CONF_LIMIT_SAMPLES,
@@ -422,8 +422,8 @@ static int cleanup_2x_bd232(void)
 }
 
 /** Get value of configuration item */
 }
 
 /** Get value of configuration item */
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                     const struct sr_channel_group *cg)
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
+               const struct sr_channel_group *cg)
 {
        int ret;
        struct dev_context *devc;
 {
        int ret;
        struct dev_context *devc;
@@ -454,16 +454,16 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
 }
 
 /** Implementation of config_list, auxiliary function for common parts, */
 }
 
 /** Implementation of config_list, auxiliary function for common parts, */
-static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                             const struct sr_channel_group *cg)
+static int config_list_common(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
+               const struct sr_channel_group *cg)
 {
        (void)sdi;
        (void)cg;
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 {
        (void)sdi;
        (void)cg;
 
        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;
        default:
                return SR_ERR_NA;
                break;
        default:
                return SR_ERR_NA;
@@ -473,13 +473,13 @@ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst
 }
 
 /** Implementation of config_list for Metrahit 1x/2x send mode */
 }
 
 /** Implementation of config_list for Metrahit 1x/2x send mode */
-static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list_sm(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                          const struct sr_channel_group *cg)
 {
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                          const struct sr_channel_group *cg)
 {
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                                 hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                                 hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(uint32_t));
                break;
        default:
                return config_list_common(key, data, sdi, cg);
                break;
        default:
                return config_list_common(key, data, sdi, cg);
@@ -489,13 +489,13 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
 }
 
 /** Implementation of config_list for Metrahit 2x bidirectional mode */
 }
 
 /** Implementation of config_list for Metrahit 2x bidirectional mode */
-static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list_bd(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                          const struct sr_channel_group *cg)
 {
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                          const struct sr_channel_group *cg)
 {
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                                 hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                                 hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(uint32_t));
                break;
        default:
                return config_list_common(key, data, sdi, cg);
                break;
        default:
                return config_list_common(key, data, sdi, cg);
index bcdc93fcec07fb16ccef690cb03a4ce255dd95b1..06cae38b07d18f59f5de3e52fb1b192d637ac77d 100644 (file)
@@ -1500,8 +1500,8 @@ SR_PRIV const char *gmc_model_str(enum model mcode)
 
 /** @copydoc sr_dev_driver.config_set
  */
 
 /** @copydoc sr_dev_driver.config_set
  */
-SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
-                      const struct sr_channel_group *cg)
+SR_PRIV int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
+               const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
        uint8_t params[9];
 {
        struct dev_context *devc;
        uint8_t params[9];
index 6f751224bd8fafab471eb9f98d9c045d22b10080..3d0eab42f0618cf04095d8e9046f9755c3870fb5 100644 (file)
@@ -120,7 +120,7 @@ struct dev_context {
 };
 
 /* Forward declarations */
 };
 
 /* Forward declarations */
-SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+SR_PRIV int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg);
 SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf);
 SR_PRIV void dump_msg14(guchar* buf, gboolean raw);
                const struct sr_channel_group *cg);
 SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf);
 SR_PRIV void dump_msg14(guchar* buf, gboolean raw);
index 8db1e76a156daa129d1bb119dd24feaceddaa844..4950d89fb3a13cb99704df3bb361dfd9e94cc09f 100644 (file)
@@ -29,7 +29,7 @@ static const char *manufacturers[] = {
        "HAMEG",
 };
 
        "HAMEG",
 };
 
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
@@ -196,7 +196,7 @@ static int check_channel_group(struct dev_context *devc,
        return CG_INVALID;
 }
 
        return CG_INVALID;
 }
 
-static int config_get(int key, 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)
 {
        int ret, cg_type;
                      const struct sr_channel_group *cg)
 {
        int ret, cg_type;
@@ -320,7 +320,7 @@ static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n)
        return g_variant_builder_end(&gvb);
 }
 
        return g_variant_builder_end(&gvb);
 }
 
-static int config_set(int key, 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)
 {
        int ret, cg_type;
                      const struct sr_channel_group *cg)
 {
        int ret, cg_type;
@@ -492,7 +492,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        int cg_type;
                       const struct sr_channel_group *cg)
 {
        int cg_type;
@@ -509,21 +509,21 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                break;
        case SR_CONF_DEVICE_OPTIONS:
                if (cg_type == CG_NONE) {
                break;
        case SR_CONF_DEVICE_OPTIONS:
                if (cg_type == CG_NONE) {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                model->hw_caps, model->num_hwcaps,
                                model->hw_caps, model->num_hwcaps,
-                               sizeof(int32_t));
+                               sizeof(uint32_t));
                } else if (cg_type == CG_ANALOG) {
                } else if (cg_type == CG_ANALOG) {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                model->analog_hwcaps, model->num_analog_hwcaps,
                                model->analog_hwcaps, model->num_analog_hwcaps,
-                               sizeof(int32_t));
+                               sizeof(uint32_t));
                } else {
                } else {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               NULL, 0, sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               NULL, 0, sizeof(uint32_t));
                }
                break;
        case SR_CONF_COUPLING:
                }
                break;
        case SR_CONF_COUPLING:
index 1a788407a4be1db03287b51039922a661b3385e6..a1cee6aa9ef1df788043007e1f04ef22b2f5e973 100644 (file)
@@ -45,7 +45,7 @@ static const char *hameg_scpi_dialect[] = {
        [SCPI_CMD_SET_ANALOG_CHAN_STATE]    = ":CHAN%d:STAT %d",
 };
 
        [SCPI_CMD_SET_ANALOG_CHAN_STATE]    = ":CHAN%d:STAT %d",
 };
 
-static const int32_t hmo_hwcaps[] = {
+static const uint32_t hmo_hwcaps[] = {
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_TRIGGER_SOURCE,
        SR_CONF_TIMEBASE,
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_TRIGGER_SOURCE,
        SR_CONF_TIMEBASE,
@@ -56,7 +56,7 @@ static const int32_t hmo_hwcaps[] = {
        SR_CONF_LIMIT_FRAMES,
 };
 
        SR_CONF_LIMIT_FRAMES,
 };
 
-static const int32_t hmo_analog_caps[] = {
+static const uint32_t hmo_analog_caps[] = {
        SR_CONF_NUM_VDIV,
        SR_CONF_COUPLING,
        SR_CONF_VDIV,
        SR_CONF_NUM_VDIV,
        SR_CONF_COUPLING,
        SR_CONF_VDIV,
index 932e3ec3ee1c62d85d5d6633979db270ca3fcee4..1df319e38c6a21d2d2e8ae6579d9863eb40b2edd 100644 (file)
@@ -40,10 +40,10 @@ struct scope_config {
        const char *(*analog_names)[];
        const char *(*digital_names)[];
 
        const char *(*analog_names)[];
        const char *(*digital_names)[];
 
-       const int32_t (*hw_caps)[];
+       const uint32_t (*hw_caps)[];
        const uint8_t num_hwcaps;
 
        const uint8_t num_hwcaps;
 
-       const int32_t (*analog_hwcaps)[];
+       const uint32_t (*analog_hwcaps)[];
        const uint8_t num_analog_hwcaps;
 
        const char *(*coupling_options)[];
        const uint8_t num_analog_hwcaps;
 
        const char *(*coupling_options)[];
index c948e4216a8260ea591f207a5ebaf9d62feeb375..abc3c08efeee2dece29226fb84ffd01c9d2980cc 100644 (file)
 #define NUM_TIMEBASE  10
 #define NUM_VDIV      8
 
 #define NUM_TIMEBASE  10
 #define NUM_VDIV      8
 
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_LIMIT_FRAMES,
        SR_CONF_CONTINUOUS,
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_LIMIT_FRAMES,
        SR_CONF_CONTINUOUS,
@@ -422,7 +422,7 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-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 sr_usb_dev_inst *usb;
                const struct sr_channel_group *cg)
 {
        struct sr_usb_dev_inst *usb;
@@ -430,7 +430,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
 
        (void)cg;
 
 
        (void)cg;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_CONN:
                if (!sdi || !sdi->conn)
                        return SR_ERR_ARG;
        case SR_CONF_CONN:
                if (!sdi || !sdi->conn)
                        return SR_ERR_ARG;
@@ -455,7 +455,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -473,7 +473,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        ret = SR_OK;
        devc = sdi->priv;
 
        ret = SR_OK;
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_FRAMES:
                devc->limit_frames = g_variant_get_uint64(data);
                break;
        case SR_CONF_LIMIT_FRAMES:
                devc->limit_frames = g_variant_get_uint64(data);
                break;
@@ -586,7 +586,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -598,12 +598,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                break;
        case SR_CONF_DEVICE_OPTIONS:
                break;
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                break;
        case SR_CONF_BUFFERSIZE:
                if (!sdi)
                break;
        case SR_CONF_BUFFERSIZE:
                if (!sdi)
index b4c697f91a8e7b715825465bbb4c00e82c0acd78..25cebb5facc83398b36638a479b8a8dae54a2983 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_LIMIT_SAMPLES,
@@ -313,7 +313,7 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -338,7 +338,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        return ret;
 }
 
-static int config_set(int key, 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)
 {
        uint64_t samplerate, limit_samples, capture_ratio;
                const struct sr_channel_group *cg)
 {
        uint64_t samplerate, limit_samples, capture_ratio;
@@ -371,7 +371,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *gvar, *grange[2];
                const struct sr_channel_group *cg)
 {
        GVariant *gvar, *grange[2];
@@ -385,8 +385,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index ce00478eac1619da60f12365d63138cc06a42648..e4ebb267b5de9c302ae495530122921026da1d7d 100644 (file)
@@ -28,7 +28,7 @@
 
 #define SAMPLE_BUF_SIZE                        (8 * 1024 * 1024)
 
 
 #define SAMPLE_BUF_SIZE                        (8 * 1024 * 1024)
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_LIMIT_MSEC,
@@ -280,13 +280,13 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-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)
 {
        (void)sdi;
        (void)cg;
 
                const struct sr_channel_group *cg)
 {
        (void)sdi;
        (void)cg;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                /* The ScanaPLUS samplerate is 100MHz and can't be changed. */
                *data = g_variant_new_uint64(SR_MHZ(100));
        case SR_CONF_SAMPLERATE:
                /* The ScanaPLUS samplerate is 100MHz and can't be changed. */
                *data = g_variant_new_uint64(SR_MHZ(100));
@@ -298,7 +298,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -310,7 +310,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                if (g_variant_get_uint64(data) != SR_MHZ(100)) {
                        sr_err("ScanaPLUS only supports samplerate = 100MHz.");
        case SR_CONF_SAMPLERATE:
                if (g_variant_get_uint64(data) != SR_MHZ(100)) {
                        sr_err("ScanaPLUS only supports samplerate = 100MHz.");
@@ -335,7 +335,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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)
 {
        GVariant *gvar;
                const struct sr_channel_group *cg)
 {
        GVariant *gvar;
@@ -346,8 +346,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index 71bdc012f690c202f5812cac7d8ca86b380a590f..293d3c8549b7ca4adceccb5497275d872d6cfec9 100644 (file)
@@ -24,7 +24,7 @@
 #define VENDOR "Kecheng"
 #define USB_INTERFACE 0
 
 #define VENDOR "Kecheng"
 #define USB_INTERFACE 0
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
@@ -248,7 +248,7 @@ static int cleanup(void)
        return ret;
 }
 
        return ret;
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -297,7 +297,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -377,7 +377,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *tuple, *rational[2];
                const struct sr_channel_group *cg)
 {
        GVariant *tuple, *rational[2];
@@ -389,8 +389,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLE_INTERVAL:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
                break;
        case SR_CONF_SAMPLE_INTERVAL:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
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;
 
 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,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_HYGROMETER,
        SR_CONF_DATALOG,
        SR_CONF_THERMOMETER,
        SR_CONF_HYGROMETER,
        SR_CONF_DATALOG,
@@ -158,7 +158,7 @@ static int cleanup(void)
        return ret;
 }
 
        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;
                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;
        (void)cg;
 
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_CONN:
                if (!sdi || !sdi->conn)
                        return SR_ERR_ARG;
        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;
 }
 
        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;
                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;
 
        devc = sdi->priv;
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_DATALOG:
                if (g_variant_get_boolean(data)) {
                        /* Start logging. */
        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;
 }
 
        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;
                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:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 13c2972001a506627ea325f1c35467606d751a14..829530e028d7ff7ea351b15fff6113070abb6e9c 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
@@ -380,8 +380,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index faa093f1187e4da73951e81ae875d7564567a287..7218d9b5c99515ea36419ebc498a8d7a52c12be7 100644 (file)
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
        /* Device class */
        SR_CONF_POWER_SUPPLY,
        /* Aquisition modes. */
        /* Device class */
        SR_CONF_POWER_SUPPLY,
        /* Aquisition modes. */
@@ -216,7 +216,7 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -257,7 +257,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -320,7 +320,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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)
 {
        struct dev_context *devc;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -337,12 +337,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                break;
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                       devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                       devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                break;
        case SR_CONF_OUTPUT_CURRENT_MAX:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
                break;
        case SR_CONF_OUTPUT_CURRENT_MAX:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
index 3917314598b845f0d8feeae25304d2b3993db88f..0a1e25825ffaff488f6a35d1169638f5d05a02be 100644 (file)
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_HYGROMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_THERMOMETER,
        SR_CONF_HYGROMETER,
        SR_CONF_LIMIT_SAMPLES,
@@ -160,7 +160,7 @@ static int cleanup(int idx)
        return dev_clear(idx);
 }
 
        return dev_clear(idx);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -172,7 +172,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                sr_dbg("Setting sample limit to %" PRIu64 ".",
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                sr_dbg("Setting sample limit to %" PRIu64 ".",
@@ -190,7 +190,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -198,12 +198,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index ae08317a0ae4348520669ab4de61fd5ade5d9e5a..a52b2f28470ea13846f218a7ca759a89345d6a11 100644 (file)
@@ -44,13 +44,13 @@ SR_PRIV int lps_query_status(struct sr_dev_inst* sdi);
 #define VENDOR_MOTECH "Motech"
 
 /** Driver scanning options. */
 #define VENDOR_MOTECH "Motech"
 
 /** Driver scanning options. */
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
 /** Hardware capabilities generic. */
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
 /** Hardware capabilities generic. */
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        /* Device class */
        SR_CONF_POWER_SUPPLY,
        /* Aquisition modes. */
        /* Device class */
        SR_CONF_POWER_SUPPLY,
        /* Aquisition modes. */
@@ -62,7 +62,7 @@ static const int32_t hwcaps[] = {
 };
 
 /** Hardware capabilities channel 1, 2. */
 };
 
 /** Hardware capabilities channel 1, 2. */
-static const int32_t hwcaps_ch12[] = {
+static const uint32_t hwcaps_ch12[] = {
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_VOLTAGE_MAX,
        SR_CONF_OUTPUT_CURRENT,
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_VOLTAGE_MAX,
        SR_CONF_OUTPUT_CURRENT,
@@ -71,7 +71,7 @@ static const int32_t hwcaps_ch12[] = {
 };
 
 /** Hardware capabilities channel 3. (LPS-304/305 only). */
 };
 
 /** Hardware capabilities channel 3. (LPS-304/305 only). */
-static const int32_t hwcaps_ch3[] = {
+static const uint32_t hwcaps_ch3[] = {
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_ENABLED,
 };
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_ENABLED,
 };
@@ -540,7 +540,7 @@ static int cleanup(void)
        return dev_clear_lps301();
 }
 
        return dev_clear_lps301();
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -595,7 +595,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -717,7 +717,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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)
 {
        struct dev_context *devc;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -731,8 +731,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        /* Driver options, no device instance necessary. */
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
        /* Driver options, no device instance necessary. */
        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));
                return SR_OK;
        default:
                if (sdi == NULL)
                return SR_OK;
        default:
                if (sdi == NULL)
@@ -741,12 +741,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                devc = sdi->priv;
        }
 
                devc = sdi->priv;
        }
 
-       /* Device options, independant from channel groups. */
+       /* Device options, independent from channel groups. */
        if (cg == NULL) {
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
        if (cg == NULL) {
                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));
                        return SR_OK;
                case SR_CONF_OUTPUT_CHANNEL_CONFIG:
                        if (devc->model->modelid <= LPS_303) {
                        return SR_OK;
                case SR_CONF_OUTPUT_CHANNEL_CONFIG:
                        if (devc->model->modelid <= LPS_303) {
@@ -769,11 +769,11 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                 hwcaps_ch12, ARRAY_SIZE(hwcaps_ch12), sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                 hwcaps_ch12, ARRAY_SIZE(hwcaps_ch12), sizeof(uint32_t));
                else /* Must be CH3 */
                else /* Must be CH3 */
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                 hwcaps_ch3, ARRAY_SIZE(hwcaps_ch3), sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                 hwcaps_ch3, ARRAY_SIZE(hwcaps_ch3), sizeof(uint32_t));
                break;
        case SR_CONF_OUTPUT_VOLTAGE_MAX:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
                break;
        case SR_CONF_OUTPUT_VOLTAGE_MAX:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
index 798b60e151b7082ab8dfc1d1804b0d3db8397edd..1eda0cf95cea291221e0d48678b724749768453f 100644 (file)
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -235,7 +235,7 @@ static int cleanup_siemens_b102x(void)
        return std_dev_clear(&siemens_b102x_driver_info, NULL);
 }
 
        return std_dev_clear(&siemens_b102x_driver_info, NULL);
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -272,7 +272,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -280,12 +280,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index cd9d817e22c17c2de8e87cc562c91ff68d5d7182..ac69250cf19ecc3d36e72acdaa8bee65a01025aa 100644 (file)
 
 #define SERIALCOMM "115200/8n1"
 
 
 #define SERIALCOMM "115200/8n1"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        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,
        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);
 }
 
        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;
                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;
                return SR_ERR_ARG;
 
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
        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;
 }
 
        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;
                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;
 
 
        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])
        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;
 }
 
        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;
                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:
 
        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:
                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}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index 01d82a6f217a1a7fc848caf14f0dfdc6274ee804..892821793bca73c15ae2aff28d145749ba409ca7 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -236,7 +236,7 @@ static int cleanup(void)
 }
 
 
 }
 
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -247,7 +247,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                return SR_ERR_ARG;
 
        devc = sdi->priv;
                return SR_ERR_ARG;
 
        devc = sdi->priv;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
@@ -278,7 +278,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -294,7 +294,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        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])
        case SR_CONF_SAMPLERATE:
                tmp_u64 = g_variant_get_uint64(data);
                if (tmp_u64 < samplerates[0] || tmp_u64 > samplerates[1])
@@ -375,7 +375,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -387,8 +387,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index 500362be7ebb7526956b996f165837df29beaeff..f11d233dece73a2fee376dbaa9c98b7794245b9a 100644 (file)
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_TIMEBASE,
        SR_CONF_TRIGGER_SOURCE,
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_TIMEBASE,
        SR_CONF_TRIGGER_SOURCE,
@@ -45,7 +45,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_SAMPLERATE,
 };
 
        SR_CONF_SAMPLERATE,
 };
 
-static const int32_t analog_hwcaps[] = {
+static const uint32_t analog_hwcaps[] = {
        SR_CONF_NUM_VDIV,
        SR_CONF_VDIV,
        SR_CONF_COUPLING,
        SR_CONF_NUM_VDIV,
        SR_CONF_VDIV,
        SR_CONF_COUPLING,
@@ -489,7 +489,7 @@ static int digital_frame_size(const struct sr_dev_inst *sdi)
        }
 }
 
        }
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -521,7 +521,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                }
        }
 
                }
        }
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_NUM_TIMEBASE:
                *data = g_variant_new_int32(devc->model->series->num_horizontal_divs);
                break;
        case SR_CONF_NUM_TIMEBASE:
                *data = g_variant_new_int32(devc->model->series->num_horizontal_divs);
                break;
@@ -609,7 +609,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -633,7 +633,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        }
 
        ret = SR_OK;
        }
 
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_FRAMES:
                devc->limit_frames = g_variant_get_uint64(data);
                break;
        case SR_CONF_LIMIT_FRAMES:
                devc->limit_frames = g_variant_get_uint64(data);
                break;
@@ -759,7 +759,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *tuple, *rational[2];
                const struct sr_channel_group *cg)
 {
        GVariant *tuple, *rational[2];
@@ -771,12 +771,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                devc = sdi->priv;
 
        if (key == SR_CONF_SCAN_OPTIONS) {
                devc = sdi->priv;
 
        if (key == 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));
                return SR_OK;
        } else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) {
                return SR_OK;
        } else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) {
-               *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));
                return SR_OK;
        }
 
                return SR_OK;
        }
 
@@ -802,14 +802,14 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                        return SR_ERR_CHANNEL_GROUP;
                }
                if (cg == devc->digital_group) {
                        return SR_ERR_CHANNEL_GROUP;
                }
                if (cg == devc->digital_group) {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               NULL, 0, sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               NULL, 0, sizeof(uint32_t));
                        return SR_OK;
                } else {
                        for (i = 0; i < devc->model->analog_channels; i++) {
                                if (cg == devc->analog_groups[i]) {
                        return SR_OK;
                } else {
                        for (i = 0; i < devc->model->analog_channels; i++) {
                                if (cg == devc->analog_groups[i]) {
-                                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                               analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t));
+                                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                                               analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(uint32_t));
                                        return SR_OK;
                                }
                        }
                                        return SR_OK;
                                }
                        }
index 6bd539ca29d10d29b64d65b5528c9c14a526ca11..f20eadcb40ab424f2ad5f172ff688104fdecd47b 100644 (file)
 SR_PRIV struct sr_dev_driver saleae_logic16_driver_info;
 static struct sr_dev_driver *di = &saleae_logic16_driver_info;
 
 SR_PRIV struct sr_dev_driver saleae_logic16_driver_info;
 static struct sr_dev_driver *di = &saleae_logic16_driver_info;
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_VOLTAGE_THRESHOLD,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_VOLTAGE_THRESHOLD,
@@ -436,7 +436,7 @@ static int cleanup(void)
        return ret;
 }
 
        return ret;
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -490,7 +490,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        return ret;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -533,7 +533,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        GVariant *gvar, *range[2];
                const struct sr_channel_group *cg)
 {
        GVariant *gvar, *range[2];
@@ -547,12 +547,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        ret = SR_OK;
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
        ret = SR_OK;
        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:
                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}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index 2f4bdc9308e93e6c36203a43b21529b900f6251a..aea3bd5e26833c95cee54ea3c7e850dc98cfcd61 100644 (file)
@@ -25,7 +25,7 @@ static struct sr_dev_driver *di = &scpi_pps_driver_info;
 extern unsigned int num_pps_profiles;
 extern const struct scpi_pps pps_profiles[];
 
 extern unsigned int num_pps_profiles;
 extern const struct scpi_pps pps_profiles[];
 
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
@@ -190,7 +190,7 @@ static int cleanup(void)
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -313,7 +313,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        return ret;
 }
 
-static int config_set(int key, 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 sr_channel *ch;
                const struct sr_channel_group *cg)
 {
        struct sr_channel *ch;
@@ -396,7 +396,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -409,8 +409,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        /* Always available, even without sdi. */
        if (key == SR_CONF_SCAN_OPTIONS) {
 
        /* Always available, even without sdi. */
        if (key == SR_CONF_SCAN_OPTIONS) {
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                return SR_OK;
        }
 
                return SR_OK;
        }
 
@@ -423,9 +423,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                /* No channel group: global options. */
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
                /* No channel group: global options. */
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                        devc->device->devopts, devc->device->num_devopts,
                                        devc->device->devopts, devc->device->num_devopts,
-                                       sizeof(int32_t));
+                                       sizeof(uint32_t));
                        break;
                case SR_CONF_OUTPUT_CHANNEL_CONFIG:
                        /* Not used. */
                        break;
                case SR_CONF_OUTPUT_CHANNEL_CONFIG:
                        /* Not used. */
@@ -460,9 +460,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
 
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                        devc->device->devopts_cg, devc->device->num_devopts_cg,
                                        devc->device->devopts_cg, devc->device->num_devopts_cg,
-                                       sizeof(int32_t));
+                                       sizeof(uint32_t));
                        break;
                case SR_CONF_OUTPUT_VOLTAGE_MAX:
                        ch_spec = &(devc->device->channels[ch->index]);
                        break;
                case SR_CONF_OUTPUT_VOLTAGE_MAX:
                        ch_spec = &(devc->device->channels[ch->index]);
index 34f4a6a374a306e1408758469a6abe0bd001fafa..925b6db84599666261b326f4802c9458c9826b05 100644 (file)
@@ -39,16 +39,16 @@ const char *get_vendor(const char *raw_vendor)
        return raw_vendor;
 }
 
        return raw_vendor;
 }
 
-static const int32_t devopts_none[] = { };
+static const uint32_t devopts_none[] = { };
 
 /* Rigol DP800 series */
 
 /* Rigol DP800 series */
-static const int32_t rigol_dp800_devopts[] = {
+static const uint32_t rigol_dp800_devopts[] = {
        SR_CONF_POWER_SUPPLY,
        SR_CONF_CONTINUOUS,
        SR_CONF_OVER_TEMPERATURE_PROTECTION,
 };
 
        SR_CONF_POWER_SUPPLY,
        SR_CONF_CONTINUOUS,
        SR_CONF_OVER_TEMPERATURE_PROTECTION,
 };
 
-static const int32_t rigol_dp800_devopts_cg[] = {
+static const uint32_t rigol_dp800_devopts_cg[] = {
        SR_CONF_OUTPUT_REGULATION,
        SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED,
        SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE,
        SR_CONF_OUTPUT_REGULATION,
        SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED,
        SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE,
@@ -108,7 +108,7 @@ struct scpi_command rigol_dp800_cmd[] = {
 };
 
 /* HP 663xx series */
 };
 
 /* HP 663xx series */
-static const int32_t hp_6632b_devopts[] = {
+static const uint32_t hp_6632b_devopts[] = {
        SR_CONF_POWER_SUPPLY,
        SR_CONF_CONTINUOUS,
        SR_CONF_OUTPUT_ENABLED,
        SR_CONF_POWER_SUPPLY,
        SR_CONF_CONTINUOUS,
        SR_CONF_OUTPUT_ENABLED,
index d6695addbcca951e0dca1aee9ce72f6c9879ed7f..552d5030a0e752f08360442cf22150afb122e9ea 100644 (file)
@@ -71,9 +71,9 @@ struct scpi_pps {
        char *vendor;
        char *model;
        uint64_t features;
        char *vendor;
        char *model;
        uint64_t features;
-       const int32_t *devopts;
+       const uint32_t *devopts;
        unsigned int num_devopts;
        unsigned int num_devopts;
-       const int32_t *devopts_cg;
+       const uint32_t *devopts_cg;
        unsigned int num_devopts_cg;
        struct channel_spec *channels;
        unsigned int num_channels;
        unsigned int num_devopts_cg;
        struct channel_spec *channels;
        unsigned int num_channels;
index a401dd65bf12ee9a337f3fa32d35b92c4324ace6..d92b6fc137c72434bbf959fea6e1709185fe9f75 100644 (file)
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -465,7 +465,7 @@ static int cleanup(int dmm)
        return dev_clear(dmm);
 }
 
        return dev_clear(dmm);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -480,7 +480,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                return SR_ERR_BUG;
        }
 
                return SR_ERR_BUG;
        }
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                sr_dbg("Setting sample limit to %" PRIu64 ".",
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                sr_dbg("Setting sample limit to %" PRIu64 ".",
@@ -498,7 +498,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -506,12 +506,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index a4346a012329c083349fd40a80831c1e504f02c9..d2aeb3013d55c034ed2af004c783a59659955898 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
 #include <stdlib.h>
 #include <string.h>
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_EXTERNAL_CLOCK,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_EXTERNAL_CLOCK,
@@ -271,7 +271,7 @@ static int cleanup(void)
        return dev_clear();
 }
 
        return dev_clear();
 }
 
-static int config_get(int key, 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;
                      const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -343,7 +343,7 @@ static int lookup_index(GVariant *value, const char *const *table, int len)
        return -1;
 }
 
        return -1;
 }
 
-static int config_set(int key, 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)
 {
        uint64_t value;
                      const struct sr_channel_group *cg)
 {
        uint64_t value;
@@ -445,7 +445,7 @@ static int config_commit(const struct sr_dev_inst *sdi)
        return lwla_set_clock_config(sdi);
 }
 
        return lwla_set_clock_config(sdi);
 }
 
-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)
 {
        GVariant *gvar;
                       const struct sr_channel_group *cg)
 {
        GVariant *gvar;
@@ -456,12 +456,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwopts, G_N_ELEMENTS(hwopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwopts, G_N_ELEMENTS(hwopts), sizeof(uint32_t));
                break;
        case SR_CONF_DEVICE_OPTIONS:
                break;
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwcaps, G_N_ELEMENTS(hwcaps), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwcaps, G_N_ELEMENTS(hwcaps), sizeof(uint32_t));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
index c4fd846716878241d1151bba3679e8e5cc7a8e1b..48d775434cad5e3b8f6889775024e14002ab9ec2 100644 (file)
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_ENERGYMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_ENERGYMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -177,7 +177,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -208,7 +208,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -216,12 +216,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 2b4c9634c09a75b83019e53a95b1e144bb83b941..c0604da68e9878566a0ec8de3c24b9e370728e63 100644 (file)
@@ -26,11 +26,11 @@ SR_PRIV struct sr_dev_driver testo_driver_info;
 static struct sr_dev_driver *di = &testo_driver_info;
 static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
 
 static struct sr_dev_driver *di = &testo_driver_info;
 static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
 
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_LIMIT_SAMPLES,
@@ -241,7 +241,7 @@ static int cleanup(void)
        return ret;
 }
 
        return ret;
 }
 
-static int config_get(int key, 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 sr_usb_dev_inst *usb;
                const struct sr_channel_group *cg)
 {
        struct sr_usb_dev_inst *usb;
@@ -264,7 +264,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -303,7 +303,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -311,12 +311,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
                break;
        case SR_CONF_DEVICE_OPTIONS:
                break;
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                break;
        default:
                return SR_ERR_NA;
                break;
        default:
                return SR_ERR_NA;
index 7917c8d2606bc24dac697b5964a776787bde5265..11885c729a616b4a1f97beeac63a8aff1f5a9e5f 100644 (file)
 
 #define SERIALCOMM "9600/8e1"
 
 
 #define SERIALCOMM "9600/8e1"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
        SR_CONF_SOUNDLEVELMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
@@ -128,7 +128,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        return std_dev_clear(di, NULL);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -140,7 +140,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                sr_dbg("Setting sample limit to %" PRIu64 ".",
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
                sr_dbg("Setting sample limit to %" PRIu64 ".",
@@ -153,7 +153,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -161,12 +161,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index f0fcc1fdfb46e30e34a445a5adc139b9849dac8a..46158f32bb75c2933363051a21042992bbcefd62 100644 (file)
 
 #define UNI_T_UT_D04_NEW "1a86.e008"
 
 
 #define UNI_T_UT_D04_NEW "1a86.e008"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_LIMIT_MSEC,
@@ -267,7 +267,7 @@ static int cleanup(int dmm)
        return dev_clear(dmm);
 }
 
        return dev_clear(dmm);
 }
 
-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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -276,7 +276,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_MSEC:
                if (g_variant_get_uint64(data) == 0) {
                        sr_err("Time limit cannot be 0.");
        case SR_CONF_LIMIT_MSEC:
                if (g_variant_get_uint64(data) == 0) {
                        sr_err("Time limit cannot be 0.");
@@ -302,7 +302,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -310,12 +310,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 81024dc7cc0548afb6d2515d636bc96519c9f4db..52f0c476867b16f5c3fe0b846f2242a80352c3a2 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <string.h>
 
 
 #include <string.h>
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
        SR_CONF_THERMOMETER,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
@@ -199,7 +199,7 @@ static int cleanup(void)
        return ret;
 }
 
        return ret;
 }
 
-static int config_get(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -224,7 +224,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int config_set(int key, 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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -265,7 +265,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
 
                const struct sr_channel_group *cg)
 {
 
@@ -274,8 +274,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_DATA_SOURCE:
                *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
                break;
        case SR_CONF_DATA_SOURCE:
                *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
index 56c53e503c90d98ab60338e56198071c8bd4f789..92a1ace89c5c091c128a76d01373a3bda8aa99cf 100644 (file)
@@ -35,11 +35,11 @@ SR_PRIV struct sr_dev_driver victor_dmm_driver_info;
 static struct sr_dev_driver *di = &victor_dmm_driver_info;
 static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
 
 static struct sr_dev_driver *di = &victor_dmm_driver_info;
 static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_MULTIMETER,
        SR_CONF_LIMIT_MSEC,
        SR_CONF_LIMIT_SAMPLES,
@@ -201,7 +201,7 @@ static int cleanup(void)
        return ret;
 }
 
        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 sr_usb_dev_inst *usb;
                const struct sr_channel_group *cg)
 {
        struct sr_usb_dev_inst *usb;
@@ -209,7 +209,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
 
        (void)cg;
 
 
        (void)cg;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_CONN:
                if (!sdi || !sdi->conn)
                        return SR_ERR_ARG;
        case SR_CONF_CONN:
                if (!sdi || !sdi->conn)
                        return SR_ERR_ARG;
@@ -224,7 +224,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -243,7 +243,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
        ret = SR_OK;
 
        devc = sdi->priv;
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_LIMIT_MSEC:
                devc->limit_msec = g_variant_get_uint64(data);
                now = g_get_monotonic_time() / 1000;
        case SR_CONF_LIMIT_MSEC:
                devc->limit_msec = g_variant_get_uint64(data);
                now = g_get_monotonic_time() / 1000;
@@ -263,7 +263,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -271,12 +271,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
 
        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:
                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;
                break;
        default:
                return SR_ERR_NA;
index 070c6bd0979e111504942d237273dc4f733b0e09..276ff0ffbcdb4456a2583f52d225c8b477972061 100644 (file)
@@ -189,7 +189,7 @@ static int check_channel_group(struct dev_context *devc,
        return CG_INVALID;
 }
 
        return CG_INVALID;
 }
 
-static int config_get(int key, 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)
 {
        int ret, cg_type;
                const struct sr_channel_group *cg)
 {
        int ret, cg_type;
@@ -307,7 +307,7 @@ static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n)
        return g_variant_builder_end(&gvb);
 }
 
        return g_variant_builder_end(&gvb);
 }
 
-static int config_set(int key, 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)
 {
        int ret, cg_type;
                const struct sr_channel_group *cg)
 {
        int ret, cg_type;
@@ -461,7 +461,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
        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)
 {
        int cg_type;
                const struct sr_channel_group *cg)
 {
        int cg_type;
@@ -482,14 +482,14 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_DEVICE_OPTIONS:
                if (cg_type == CG_NONE) {
                break;
        case SR_CONF_DEVICE_OPTIONS:
                if (cg_type == CG_NONE) {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               model->hw_caps, model->num_hwcaps, sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               model->hw_caps, model->num_hwcaps, sizeof(uint32_t));
                } else if (cg_type == CG_ANALOG) {
                } else if (cg_type == CG_ANALOG) {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               model->analog_hwcaps, model->num_analog_hwcaps, sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               model->analog_hwcaps, model->num_analog_hwcaps, sizeof(uint32_t));
                } else {
                } else {
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               NULL, 0, sizeof(int32_t));
+                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               NULL, 0, sizeof(uint32_t));
                }
                break;
        case SR_CONF_COUPLING:
                }
                break;
        case SR_CONF_COUPLING:
index 8f95f187a614302ec742b15244a224966b1df3c0..5148c8d7fc039cb37bc7b850b2674ed37e64c114 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "protocol.h"
 
 
 #include "protocol.h"
 
-static const int32_t dlm_hwcaps[] = {
+static const uint32_t dlm_hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_TRIGGER_SLOPE,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_TRIGGER_SLOPE,
@@ -35,7 +35,7 @@ static const int32_t dlm_hwcaps[] = {
        SR_CONF_HORIZ_TRIGGERPOS,
 };
 
        SR_CONF_HORIZ_TRIGGERPOS,
 };
 
-static const int32_t dlm_analog_caps[] = {
+static const uint32_t dlm_analog_caps[] = {
        SR_CONF_VDIV,
        SR_CONF_COUPLING,
        SR_CONF_NUM_VDIV,
        SR_CONF_VDIV,
        SR_CONF_COUPLING,
        SR_CONF_NUM_VDIV,
index 0950267a3a0065a90df5cb7806bb829e066553a1..523403d5cff4699d989fe9daa43dc2eaf22bf782 100644 (file)
@@ -57,10 +57,10 @@ struct scope_config {
        const char *(*analog_names)[];
        const char *(*digital_names)[];
 
        const char *(*analog_names)[];
        const char *(*digital_names)[];
 
-       const int32_t (*hw_caps)[];
+       const uint32_t (*hw_caps)[];
        const uint8_t num_hwcaps;
 
        const uint8_t num_hwcaps;
 
-       const int32_t (*analog_hwcaps)[];
+       const uint32_t (*analog_hwcaps)[];
        const uint8_t num_analog_hwcaps;
 
        const char *(*coupling_options)[];
        const uint8_t num_analog_hwcaps;
 
        const char *(*coupling_options)[];
index a49f07481c0469a1adcede4fa25cda98c227a0c0..3a0e4d8c714ffa7dacfc4252233d9bd5a6950d79 100644 (file)
@@ -52,7 +52,7 @@ static const struct zp_model zeroplus_models[] = {
        { 0, 0, 0, 0, 0, 0 }
 };
 
        { 0, 0, 0, 0, 0, 0 }
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -382,14 +382,14 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
        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;
 
        (void)cg;
 
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
        (void)cg;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -423,7 +423,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -439,7 +439,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                return SR_ERR_ARG;
        }
 
                return SR_ERR_ARG;
        }
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                return zp_set_samplerate(devc, g_variant_get_uint64(data));
        case SR_CONF_LIMIT_SAMPLES:
        case SR_CONF_SAMPLERATE:
                return zp_set_samplerate(devc, g_variant_get_uint64(data));
        case SR_CONF_LIMIT_SAMPLES:
@@ -456,7 +456,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
        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)
 {
        struct dev_context *devc;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -469,8 +469,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
 
        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;
        case SR_CONF_SAMPLERATE:
                devc = sdi->priv;
                break;
        case SR_CONF_SAMPLERATE:
                devc = sdi->priv;
index bf0ce04dafd3b0ad0a8971fcafa8726644325c13..e36990a258404842dd4a9ea25624dc23f86794a4 100644 (file)
@@ -166,7 +166,7 @@ SR_PRIV const GVariantType *sr_variant_type_get(int datatype)
        }
 }
 
        }
 }
 
-SR_PRIV int sr_variant_type_check(int key, GVariant *value)
+SR_PRIV int sr_variant_type_check(uint32_t key, GVariant *value)
 {
        const struct sr_config_info *info;
        const GVariantType *type, *expected;
 {
        const struct sr_config_info *info;
        const GVariantType *type, *expected;
@@ -312,7 +312,7 @@ SR_PRIV void sr_hw_cleanup_all(void)
  *  A floating reference can be passed in for data.
  *  @private
  */
  *  A floating reference can be passed in for data.
  *  @private
  */
-SR_PRIV struct sr_config *sr_config_new(int key, GVariant *data)
+SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data)
 {
        struct sr_config *src;
 
 {
        struct sr_config *src;
 
@@ -367,7 +367,7 @@ SR_PRIV void sr_config_free(struct sr_config *src)
 SR_API int sr_config_get(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
 SR_API int sr_config_get(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
-               int key, GVariant **data)
+               uint32_t key, GVariant **data)
 {
        int ret;
 
 {
        int ret;
 
@@ -407,7 +407,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
  */
 SR_API int sr_config_set(const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
  */
 SR_API int sr_config_set(const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
-               int key, GVariant *data)
+               uint32_t key, GVariant *data)
 {
        int ret;
 
 {
        int ret;
 
@@ -474,7 +474,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
 SR_API int sr_config_list(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
 SR_API int sr_config_list(const struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg,
-               int key, GVariant **data)
+               uint32_t key, GVariant **data)
 {
        int ret;
 
 {
        int ret;
 
@@ -498,7 +498,7 @@ SR_API int sr_config_list(const struct sr_dev_driver *driver,
  *
  * @since 0.2.0
  */
  *
  * @since 0.2.0
  */
-SR_API const struct sr_config_info *sr_config_info_get(int key)
+SR_API const struct sr_config_info *sr_config_info_get(uint32_t key)
 {
        int i;
 
 {
        int i;
 
index 4bd7a7daa340186a1880bd124b44c06efd45631a..1fc049e46e007cde6a505e01f875fd03ea58b26d 100644 (file)
@@ -517,9 +517,9 @@ SR_PRIV void sr_usbtmc_dev_inst_free(struct sr_usbtmc_dev_inst *usbtmc);
 /*--- hwdriver.c ------------------------------------------------------------*/
 
 SR_PRIV const GVariantType *sr_variant_type_get(int datatype);
 /*--- hwdriver.c ------------------------------------------------------------*/
 
 SR_PRIV const GVariantType *sr_variant_type_get(int datatype);
-SR_PRIV int sr_variant_type_check(int key, GVariant *data);
+SR_PRIV int sr_variant_type_check(uint32_t key, GVariant *data);
 SR_PRIV void sr_hw_cleanup_all(void);
 SR_PRIV void sr_hw_cleanup_all(void);
-SR_PRIV struct sr_config *sr_config_new(int key, GVariant *data);
+SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data);
 SR_PRIV void sr_config_free(struct sr_config *src);
 SR_PRIV int sr_source_remove(int fd);
 SR_PRIV int sr_source_remove_pollfd(GPollFD *pollfd);
 SR_PRIV void sr_config_free(struct sr_config *src);
 SR_PRIV int sr_source_remove(int fd);
 SR_PRIV int sr_source_remove_pollfd(GPollFD *pollfd);
index 9120ea14575b4f2e71fbfa3d0fcdfc28100b8467..6a320aa5b3d17908dc401fa75bea5bd1ec0d3853 100644 (file)
@@ -49,7 +49,7 @@ struct session_vdev {
        gboolean finished;
 };
 
        gboolean finished;
 };
 
-static const int hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_CAPTUREFILE,
        SR_CONF_CAPTURE_UNITSIZE,
        SR_CONF_SAMPLERATE,
        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;
 }
 
        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;
 
                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;
        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;
 }
 
        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;
                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;
 
 
        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);
        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;
 }
 
        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;
                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:
 
        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;
                break;
        default:
                return SR_ERR_NA;