Change type of SR_CONF keys to uint32_t.

This commit is contained in:
Bert Vermeulen 2014-09-16 17:49:20 +02:00
parent a4e4745458
commit 584560f142
55 changed files with 437 additions and 438 deletions

View File

@ -486,7 +486,7 @@ struct sr_channel_group {
/** Used for setting or getting value of a config item. */ /** Used for setting or getting value of a config item. */
struct sr_config { struct sr_config {
/** Config key like SR_CONF_CONN, etc. */ /** Config key like SR_CONF_CONN, etc. */
int key; uint32_t key;
/** Key-specific data. */ /** Key-specific data. */
GVariant *data; GVariant *data;
}; };
@ -494,7 +494,7 @@ struct sr_config {
/** Information about a config key. */ /** Information about a config key. */
struct sr_config_info { struct sr_config_info {
/** Config key like SR_CONF_CONN, etc. */ /** Config key like SR_CONF_CONN, etc. */
int key; uint32_t key;
/** Data type like SR_T_STRING, etc. */ /** Data type like SR_T_STRING, etc. */
int datatype; int datatype;
/** Id string, e.g. "serialcomm". */ /** 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. /** Query value of a configuration key in driver or given device instance.
* @see sr_config_get(). * @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_dev_inst *sdi,
const struct sr_channel_group *cg); const struct sr_channel_group *cg);
/** Set value of a configuration key in driver or a given device instance. /** Set value of a configuration key in driver or a given device instance.
* @see sr_config_set(). */ * @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_dev_inst *sdi,
const struct sr_channel_group *cg); const struct sr_channel_group *cg);
/** Channel status change. /** Channel status change.
@ -948,7 +948,7 @@ struct sr_dev_driver {
/** List all possible values for a configuration key in a device instance. /** List all possible values for a configuration key in a device instance.
* @see sr_config_list(). * @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_dev_inst *sdi,
const struct sr_channel_group *cg); const struct sr_channel_group *cg);

View 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, SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg, 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, SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg, 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_commit(const struct sr_dev_inst *sdi);
SR_API int sr_config_list(const struct sr_dev_driver *driver, SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg, const struct sr_channel_group *cg,
int key, GVariant **data); uint32_t key, GVariant **data);
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);
SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname); SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);
/*--- session.c -------------------------------------------------------------*/ /*--- session.c -------------------------------------------------------------*/

View File

@ -27,12 +27,12 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "agilent-dmm.h" #include "agilent-dmm.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER, SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */ /* TODO: not yet implemented */
if (g_variant_get_uint64(data) == 0) { 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -224,12 +224,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -20,12 +20,12 @@
#include <string.h> #include <string.h>
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER, SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc = sdi->priv; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -213,12 +213,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_DATA_SOURCE: case SR_CONF_DATA_SOURCE:
*data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources)); *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));

View 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; return SR_ERR;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate); *data = g_variant_new_uint64(devc->cur_samplerate);
break; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; devc = sdi->priv;
ret = SR_OK; ret = SR_OK;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
ret = set_samplerate(sdi, g_variant_get_uint64(data)); ret = set_samplerate(sdi, g_variant_get_uint64(data));
break; 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
@ -896,8 +896,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); 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); *data = g_variant_builder_end(&gvb);
break; break;
case SR_CONF_TRIGGER_MATCH: 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), trigger_matches, ARRAY_SIZE(trigger_matches),
sizeof(int32_t)); sizeof(int32_t));
break; break;

View File

@ -31,19 +31,19 @@
*/ */
#define SERIALCOMM "9600/8n2" #define SERIALCOMM "9600/8n2"
static const int32_t scanopts[] = { static const uint32_t scanopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t devopts[] = { static const uint32_t devopts[] = {
SR_CONF_POWER_SUPPLY, SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS, SR_CONF_CONTINUOUS,
SR_CONF_OUTPUT_CHANNEL_CONFIG, SR_CONF_OUTPUT_CHANNEL_CONFIG,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED, 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,
SR_CONF_OUTPUT_VOLTAGE_MAX, SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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. */ /* Always available, even without sdi. */
if (key == SR_CONF_SCAN_OPTIONS) { if (key == SR_CONF_SCAN_OPTIONS) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); 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. */ /* No channel group: global options. */
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
devopts, ARRAY_SIZE(devopts), sizeof(int32_t)); devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break; break;
case SR_CONF_OUTPUT_CHANNEL_CONFIG: case SR_CONF_OUTPUT_CHANNEL_CONFIG:
if (devc->model->channel_modes == CHANMODE_INDEPENDENT) { 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) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t)); devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
break; break;
case SR_CONF_OUTPUT_VOLTAGE_MAX: case SR_CONF_OUTPUT_VOLTAGE_MAX:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);

View File

@ -24,7 +24,7 @@ SR_PRIV struct sr_dev_driver beaglelogic_driver_info;
static struct sr_dev_driver *di = &beaglelogic_driver_info; static struct sr_dev_driver *di = &beaglelogic_driver_info;
/* Hardware capabiities */ /* Hardware capabiities */
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER, SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc = sdi->priv; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc = sdi->priv; 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) const struct sr_channel_group *cg)
{ {
int ret; int ret;
@ -303,8 +303,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
ret = SR_OK; ret = SR_OK;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); 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); *data = g_variant_builder_end(&gvb);
break; break;
case SR_CONF_TRIGGER_MATCH: 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), soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
sizeof(int32_t)); sizeof(int32_t));
break; break;

View File

@ -21,11 +21,11 @@
#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_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc = sdi->priv; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -242,12 +242,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -19,12 +19,12 @@
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER, SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data); devc->limit_samples = g_variant_get_uint64(data);
break; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -188,12 +188,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -24,11 +24,11 @@
/* 23ms is the longest interval between tokens. */ /* 23ms is the longest interval between tokens. */
#define MAX_SCAN_TIME 25 * 1000 #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_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
GVariant *tuple, *range[2]; 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; ret = SR_OK;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SPL_WEIGHT_FREQ: case SR_CONF_SPL_WEIGHT_FREQ:
*data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq)); *data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq));

View File

@ -20,12 +20,12 @@
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER, SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_SAMPLES:
if (g_variant_get_uint64(data) == 0) if (g_variant_get_uint64(data) == 0)
return SR_ERR_ARG; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -196,12 +196,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -23,7 +23,7 @@
SR_PRIV struct sr_dev_driver 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 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)cg; (void)cg;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (!sdi || !(devc = sdi->priv)) if (!sdi || !(devc = sdi->priv))
return SR_ERR_BUG; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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)) if (!(devc = sdi->priv))
return SR_ERR_BUG; return SR_ERR_BUG;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (cv_set_samplerate(sdi, g_variant_get_uint64(data)) < 0) if (cv_set_samplerate(sdi, g_variant_get_uint64(data)) < 0)
return SR_ERR; 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar, *grange[2]; GVariant *gvar, *grange[2];
@ -351,8 +351,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (!sdi || !sdi->priv || !(devc = sdi->priv)) 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: case SR_CONF_TRIGGER_MATCH:
if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof) if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof)
return SR_ERR_BUG; 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, trigger_matches, devc->prof->num_trigger_matches,
sizeof(int32_t)); sizeof(int32_t));
break; break;

View File

@ -30,12 +30,12 @@
/* The Colead SL-5868P uses this. */ /* The Colead SL-5868P uses this. */
#define SERIALCOMM "2400/8n1" #define SERIALCOMM "2400/8n1"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER, SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */ /* TODO: not yet implemented */
if (g_variant_get_uint64(data) == 0) { 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -175,12 +175,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -26,12 +26,12 @@
#define SERIALCOMM "9600/8n1" #define SERIALCOMM "9600/8n1"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_POWER_SUPPLY, SR_CONF_POWER_SUPPLY,
SR_CONF_OUTPUT_VOLTAGE, SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_CURRENT, 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) const struct sr_channel_group *cg)
{ {
int ret; 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) const struct sr_channel_group *cg)
{ {
int ret; int ret;
@ -175,12 +175,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
ret = SR_OK; ret = SR_OK;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View 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_LOGIC_CHANNELS,
SR_CONF_NUM_ANALOG_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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; return SR_ERR_ARG;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate); *data = g_variant_new_uint64(devc->cur_samplerate);
break; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; return SR_ERR_DEV_CLOSED;
ret = SR_OK; ret = SR_OK;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
devc->cur_samplerate = g_variant_get_uint64(data); devc->cur_samplerate = g_variant_get_uint64(data);
sr_dbg("Setting samplerate to %" PRIu64, devc->cur_samplerate); 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) const struct sr_channel_group *cg)
{ {
struct sr_channel *ch; struct sr_channel *ch;
@ -562,8 +562,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
(void)sdi; (void)sdi;
if (key == SR_CONF_SCAN_OPTIONS) { if (key == SR_CONF_SCAN_OPTIONS) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); 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) { if (!cg) {
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
devopts, ARRAY_SIZE(devopts), sizeof(int32_t)); devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); 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) if (ch->type == SR_CHANNEL_LOGIC)
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic), devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic),
sizeof(int32_t)); sizeof(uint32_t));
else if (ch->type == SR_CHANNEL_ANALOG) else if (ch->type == SR_CHANNEL_ANALOG)
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog),
sizeof(int32_t)); sizeof(uint32_t));
else else
return SR_ERR_BUG; return SR_ERR_BUG;
break; break;

View File

@ -27,12 +27,12 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "fluke-dmm.h" #include "fluke-dmm.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER, SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */ /* TODO: not yet implemented */
if (g_variant_get_uint64(data) == 0) { 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -249,12 +249,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View 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_LOGIC_ANALYZER,
SR_CONF_TRIGGER_MATCH, SR_CONF_TRIGGER_MATCH,
SR_CONF_SAMPLERATE, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_CONN:
if (!sdi->conn) if (!sdi->conn)
return SR_ERR_ARG; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_SAMPLERATE:
arg = g_variant_get_uint64(data); arg = g_variant_get_uint64(data);
for (i = 0; i < ARRAY_SIZE(samplerates); i++) { 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
@ -478,12 +477,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -34,13 +34,13 @@
SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_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; 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_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
/** Hardware capabilities for Metrahit 1x/2x devices in send mode. */ /** 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_MULTIMETER,
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */ SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_LIMIT_SAMPLES, 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_MULTIMETER,
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */ SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_LIMIT_SAMPLES, 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, static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg) const struct sr_channel_group *cg)
{ {
int ret; int ret;
struct dev_context *devc; 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, static int config_list_common(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)cg; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; 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) const struct sr_channel_group *cg)
{ {
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t)); hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(uint32_t));
break; break;
default: default:
return config_list_common(key, data, sdi, cg); 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) const struct sr_channel_group *cg)
{ {
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t)); hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(uint32_t));
break; break;
default: default:
return config_list_common(key, data, sdi, cg); return config_list_common(key, data, sdi, cg);

View 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, SR_PRIV int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
uint8_t params[9]; uint8_t params[9];

View 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); const struct sr_channel_group *cg);
SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf); SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf);
SR_PRIV void dump_msg14(guchar* buf, gboolean raw); SR_PRIV void dump_msg14(guchar* buf, gboolean raw);

View 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_CONN,
SR_CONF_SERIALCOMM, 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) const struct sr_channel_group *cg)
{ {
int ret, cg_type; 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) const struct sr_channel_group *cg)
{ {
int ret, cg_type; 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) const struct sr_channel_group *cg)
{ {
int cg_type; int cg_type;
@ -509,21 +509,21 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_NONE) { 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, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
NULL, 0, sizeof(int32_t)); NULL, 0, sizeof(uint32_t));
} }
break; break;
case SR_CONF_COUPLING: case SR_CONF_COUPLING:

View 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_OSCILLOSCOPE,
SR_CONF_TRIGGER_SOURCE, SR_CONF_TRIGGER_SOURCE,
SR_CONF_TIMEBASE, 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_NUM_VDIV,
SR_CONF_COUPLING, SR_CONF_COUPLING,
SR_CONF_VDIV, SR_CONF_VDIV,

View File

@ -40,10 +40,10 @@ struct scope_config {
const char *(*analog_names)[]; const char *(*analog_names)[];
const char *(*digital_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 uint8_t num_analog_hwcaps;
const char *(*coupling_options)[]; const char *(*coupling_options)[];

View File

@ -40,11 +40,11 @@
#define NUM_TIMEBASE 10 #define NUM_TIMEBASE 10
#define NUM_VDIV 8 #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_OSCILLOSCOPE,
SR_CONF_LIMIT_FRAMES, SR_CONF_LIMIT_FRAMES,
SR_CONF_CONTINUOUS, 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) const struct sr_channel_group *cg)
{ {
struct sr_usb_dev_inst *usb; 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: case SR_CONF_CONN:
if (!sdi || !sdi->conn) if (!sdi || !sdi->conn)
return SR_ERR_ARG; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; ret = SR_OK;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (key) {
case SR_CONF_LIMIT_FRAMES: case SR_CONF_LIMIT_FRAMES:
devc->limit_frames = g_variant_get_uint64(data); devc->limit_frames = g_variant_get_uint64(data);
break; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
@ -598,12 +598,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
devopts, ARRAY_SIZE(devopts), sizeof(int32_t)); devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break; break;
case SR_CONF_BUFFERSIZE: case SR_CONF_BUFFERSIZE:
if (!sdi) if (!sdi)

View 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_SAMPLES, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
uint64_t samplerate, limit_samples, capture_ratio; 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar, *grange[2]; GVariant *gvar, *grange[2];
@ -385,8 +385,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, hwcaps, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)cg; (void)cg;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
/* The ScanaPLUS samplerate is 100MHz and can't be changed. */ /* The ScanaPLUS samplerate is 100MHz and can't be changed. */
*data = g_variant_new_uint64(SR_MHZ(100)); *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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_SAMPLERATE:
if (g_variant_get_uint64(data) != SR_MHZ(100)) { if (g_variant_get_uint64(data) != SR_MHZ(100)) {
sr_err("ScanaPLUS only supports samplerate = 100MHz."); 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
@ -346,8 +346,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -24,7 +24,7 @@
#define VENDOR "Kecheng" #define VENDOR "Kecheng"
#define USB_INTERFACE 0 #define USB_INTERFACE 0
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER, SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
GVariant *tuple, *rational[2]; GVariant *tuple, *rational[2];
@ -389,8 +389,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLE_INTERVAL: case SR_CONF_SAMPLE_INTERVAL:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);

View File

@ -26,11 +26,11 @@
SR_PRIV struct sr_dev_driver 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 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_THERMOMETER,
SR_CONF_HYGROMETER, SR_CONF_HYGROMETER,
SR_CONF_DATALOG, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
@ -169,7 +169,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
(void)cg; (void)cg;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (key) {
case SR_CONF_CONN: case SR_CONF_CONN:
if (!sdi || !sdi->conn) if (!sdi || !sdi->conn)
return SR_ERR_ARG; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; devc = sdi->priv;
ret = SR_OK; ret = SR_OK;
switch (id) { switch (key) {
case SR_CONF_DATALOG: case SR_CONF_DATALOG:
if (g_variant_get_boolean(data)) { if (g_variant_get_boolean(data)) {
/* Start logging. */ /* 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -242,12 +242,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View 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_OSCILLOSCOPE,
SR_CONF_LOGIC_ANALYZER, SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
@ -380,8 +380,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -26,12 +26,12 @@
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t devopts[] = { static const uint32_t devopts[] = {
/* Device class */ /* Device class */
SR_CONF_POWER_SUPPLY, SR_CONF_POWER_SUPPLY,
/* Aquisition modes. */ /* 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
@ -337,12 +337,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
devopts, ARRAY_SIZE(devopts), sizeof(int32_t)); devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break; break;
case SR_CONF_OUTPUT_CURRENT_MAX: case SR_CONF_OUTPUT_CURRENT_MAX:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);

View File

@ -20,12 +20,12 @@
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER, SR_CONF_THERMOMETER,
SR_CONF_HYGROMETER, SR_CONF_HYGROMETER,
SR_CONF_LIMIT_SAMPLES, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data); devc->limit_samples = g_variant_get_uint64(data);
sr_dbg("Setting sample limit to %" PRIu64 ".", 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -198,12 +198,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -44,13 +44,13 @@ SR_PRIV int lps_query_status(struct sr_dev_inst* sdi);
#define VENDOR_MOTECH "Motech" #define VENDOR_MOTECH "Motech"
/** Driver scanning options. */ /** Driver scanning options. */
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
/** Hardware capabilities generic. */ /** Hardware capabilities generic. */
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
/* Device class */ /* Device class */
SR_CONF_POWER_SUPPLY, SR_CONF_POWER_SUPPLY,
/* Aquisition modes. */ /* 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,
SR_CONF_OUTPUT_VOLTAGE_MAX, SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT, 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_VOLTAGE,
SR_CONF_OUTPUT_ENABLED, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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. */ /* Driver options, no device instance necessary. */
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
return SR_OK; return SR_OK;
default: default:
if (sdi == NULL) 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) { if (cg == NULL) {
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
return SR_OK; return SR_OK;
case SR_CONF_OUTPUT_CHANNEL_CONFIG: case SR_CONF_OUTPUT_CHANNEL_CONFIG:
if (devc->model->modelid <= LPS_303) { 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) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */ if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwcaps_ch12, ARRAY_SIZE(hwcaps_ch12), sizeof(int32_t)); 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, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwcaps_ch3, ARRAY_SIZE(hwcaps_ch3), sizeof(int32_t)); hwcaps_ch3, ARRAY_SIZE(hwcaps_ch3), sizeof(uint32_t));
break; break;
case SR_CONF_OUTPUT_VOLTAGE_MAX: case SR_CONF_OUTPUT_VOLTAGE_MAX:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);

View File

@ -24,12 +24,12 @@
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER, SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -280,12 +280,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -22,12 +22,12 @@
#define SERIALCOMM "115200/8n1" #define SERIALCOMM "115200/8n1"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER, SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; return SR_ERR_ARG;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate); *data = g_variant_new_uint64(devc->cur_samplerate);
break; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_SAMPLERATE:
tmp_u64 = g_variant_get_uint64(data); tmp_u64 = g_variant_get_uint64(data);
if (tmp_u64 < samplerates[0] || tmp_u64 > samplerates[1]) 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
@ -363,12 +363,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; return SR_ERR_ARG;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate); *data = g_variant_new_uint64(devc->cur_samplerate);
break; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_SAMPLERATE:
tmp_u64 = g_variant_get_uint64(data); tmp_u64 = g_variant_get_uint64(data);
if (tmp_u64 < samplerates[0] || tmp_u64 > samplerates[1]) 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
@ -387,8 +387,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -29,12 +29,12 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM SR_CONF_SERIALCOMM
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_OSCILLOSCOPE, SR_CONF_OSCILLOSCOPE,
SR_CONF_TIMEBASE, SR_CONF_TIMEBASE,
SR_CONF_TRIGGER_SOURCE, 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_NUM_VDIV,
SR_CONF_VDIV, SR_CONF_VDIV,
SR_CONF_COUPLING, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_NUM_TIMEBASE:
*data = g_variant_new_int32(devc->model->series->num_horizontal_divs); *data = g_variant_new_int32(devc->model->series->num_horizontal_divs);
break; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_FRAMES:
devc->limit_frames = g_variant_get_uint64(data); devc->limit_frames = g_variant_get_uint64(data);
break; 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) const struct sr_channel_group *cg)
{ {
GVariant *tuple, *rational[2]; 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; devc = sdi->priv;
if (key == SR_CONF_SCAN_OPTIONS) { if (key == SR_CONF_SCAN_OPTIONS) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
return SR_OK; return SR_OK;
} else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) { } else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); 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; return SR_ERR_CHANNEL_GROUP;
} }
if (cg == devc->digital_group) { if (cg == devc->digital_group) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
NULL, 0, sizeof(int32_t)); NULL, 0, sizeof(uint32_t));
return SR_OK; return SR_OK;
} else { } else {
for (i = 0; i < devc->model->analog_channels; i++) { for (i = 0; i < devc->model->analog_channels; i++) {
if (cg == devc->analog_groups[i]) { if (cg == devc->analog_groups[i]) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t)); analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(uint32_t));
return SR_OK; return SR_OK;
} }
} }

View File

@ -41,11 +41,11 @@
SR_PRIV struct sr_dev_driver 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 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_VOLTAGE_THRESHOLD, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar, *range[2]; 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; ret = SR_OK;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -25,7 +25,7 @@ static struct sr_dev_driver *di = &scpi_pps_driver_info;
extern unsigned int num_pps_profiles; extern unsigned int num_pps_profiles;
extern const struct scpi_pps pps_profiles[]; extern const struct scpi_pps pps_profiles[];
static const int32_t scanopts[] = { static const uint32_t scanopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct sr_channel *ch; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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. */ /* Always available, even without sdi. */
if (key == SR_CONF_SCAN_OPTIONS) { if (key == SR_CONF_SCAN_OPTIONS) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); 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. */ /* No channel group: global options. */
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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; break;
case SR_CONF_OUTPUT_CHANNEL_CONFIG: case SR_CONF_OUTPUT_CHANNEL_CONFIG:
/* Not used. */ /* Not used. */
@ -460,9 +460,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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; break;
case SR_CONF_OUTPUT_VOLTAGE_MAX: case SR_CONF_OUTPUT_VOLTAGE_MAX:
ch_spec = &(devc->device->channels[ch->index]); ch_spec = &(devc->device->channels[ch->index]);

View 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_POWER_SUPPLY,
SR_CONF_CONTINUOUS, SR_CONF_CONTINUOUS,
SR_CONF_OVER_TEMPERATURE_PROTECTION, 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_OUTPUT_REGULATION,
SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED, SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED,
SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE, 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_POWER_SUPPLY,
SR_CONF_CONTINUOUS, SR_CONF_CONTINUOUS,
SR_CONF_OUTPUT_ENABLED, SR_CONF_OUTPUT_ENABLED,

View File

@ -71,9 +71,9 @@ struct scpi_pps {
char *vendor; char *vendor;
char *model; char *model;
uint64_t features; 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; unsigned int num_devopts_cg;
struct channel_spec *channels; struct channel_spec *channels;
unsigned int num_channels; unsigned int num_channels;

View File

@ -29,12 +29,12 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER, SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data); devc->limit_samples = g_variant_get_uint64(data);
sr_dbg("Setting sample limit to %" PRIu64 ".", 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -506,12 +506,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -25,11 +25,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_EXTERNAL_CLOCK, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
uint64_t value; 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) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
@ -456,12 +456,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, G_N_ELEMENTS(hwopts), sizeof(int32_t)); hwopts, G_N_ELEMENTS(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, G_N_ELEMENTS(hwcaps), sizeof(int32_t)); hwcaps, G_N_ELEMENTS(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -23,12 +23,12 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "protocol.h" #include "protocol.h"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_ENERGYMETER, SR_CONF_ENERGYMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -216,12 +216,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -26,11 +26,11 @@ SR_PRIV struct sr_dev_driver testo_driver_info;
static struct sr_dev_driver *di = &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 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_MULTIMETER,
SR_CONF_LIMIT_MSEC, SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES, 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) const struct sr_channel_group *cg)
{ {
struct sr_usb_dev_inst *usb; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -311,12 +311,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
devopts, ARRAY_SIZE(devopts), sizeof(int32_t)); devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -26,12 +26,12 @@
#define SERIALCOMM "9600/8e1" #define SERIALCOMM "9600/8e1"
static const int32_t hwopts[] = { static const uint32_t hwopts[] = {
SR_CONF_CONN, SR_CONF_CONN,
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const int32_t hwcaps[] = { static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER, SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data); devc->limit_samples = g_variant_get_uint64(data);
sr_dbg("Setting sample limit to %" PRIu64 ".", 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -161,12 +161,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View File

@ -26,11 +26,11 @@
#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_MULTIMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_LIMIT_MSEC:
if (g_variant_get_uint64(data) == 0) { if (g_variant_get_uint64(data) == 0) {
sr_err("Time limit cannot be 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -310,12 +310,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View 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_THERMOMETER,
SR_CONF_LIMIT_SAMPLES, SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_DATA_SOURCE: case SR_CONF_DATA_SOURCE:
*data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources)); *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));

View 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 struct sr_dev_driver *di = &victor_dmm_driver_info;
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data); 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_MULTIMETER,
SR_CONF_LIMIT_MSEC, SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES, 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) const struct sr_channel_group *cg)
{ {
struct sr_usb_dev_inst *usb; 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: case SR_CONF_CONN:
if (!sdi || !sdi->conn) if (!sdi || !sdi->conn)
return SR_ERR_ARG; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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; devc = sdi->priv;
ret = SR_OK; ret = SR_OK;
switch (id) { switch (key) {
case SR_CONF_LIMIT_MSEC: case SR_CONF_LIMIT_MSEC:
devc->limit_msec = g_variant_get_uint64(data); devc->limit_msec = g_variant_get_uint64(data);
now = g_get_monotonic_time() / 1000; 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -271,12 +271,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;

View 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) const struct sr_channel_group *cg)
{ {
int ret, cg_type; 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) const struct sr_channel_group *cg)
{ {
int ret, cg_type; 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) const struct sr_channel_group *cg)
{ {
int cg_type; int cg_type;
@ -482,14 +482,14 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
break; break;
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_NONE) { 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, sizeof(int32_t)); 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, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
model->analog_hwcaps, model->num_analog_hwcaps, sizeof(int32_t)); model->analog_hwcaps, model->num_analog_hwcaps, sizeof(uint32_t));
} else { } else {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
NULL, 0, sizeof(int32_t)); NULL, 0, sizeof(uint32_t));
} }
break; break;
case SR_CONF_COUPLING: case SR_CONF_COUPLING:

View 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_LOGIC_ANALYZER,
SR_CONF_OSCILLOSCOPE, SR_CONF_OSCILLOSCOPE,
SR_CONF_TRIGGER_SLOPE, 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_VDIV,
SR_CONF_COUPLING, SR_CONF_COUPLING,
SR_CONF_NUM_VDIV, SR_CONF_NUM_VDIV,

View File

@ -57,10 +57,10 @@ struct scope_config {
const char *(*analog_names)[]; const char *(*analog_names)[];
const char *(*digital_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 uint8_t num_analog_hwcaps;
const char *(*coupling_options)[]; const char *(*coupling_options)[];

View 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_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE, SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH, 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)cg; (void)cg;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; 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: case SR_CONF_SAMPLERATE:
return zp_set_samplerate(devc, g_variant_get_uint64(data)); return zp_set_samplerate(devc, g_variant_get_uint64(data));
case SR_CONF_LIMIT_SAMPLES: 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) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
@ -469,8 +469,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
devc = sdi->priv; devc = sdi->priv;

View 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 struct sr_config_info *info;
const GVariantType *type, *expected; 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. * A floating reference can be passed in for data.
* @private * @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, SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg, 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, SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg, 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, SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg, 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;

View File

@ -517,9 +517,9 @@ SR_PRIV void sr_usbtmc_dev_inst_free(struct sr_usbtmc_dev_inst *usbtmc);
/*--- hwdriver.c ------------------------------------------------------------*/ /*--- hwdriver.c ------------------------------------------------------------*/
SR_PRIV const GVariantType *sr_variant_type_get(int datatype); 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 void sr_config_free(struct sr_config *src);
SR_PRIV int sr_source_remove(int fd); SR_PRIV int sr_source_remove(int fd);
SR_PRIV int sr_source_remove_pollfd(GPollFD *pollfd); SR_PRIV int sr_source_remove_pollfd(GPollFD *pollfd);

View 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_CAPTUREFILE,
SR_CONF_CAPTURE_UNITSIZE, SR_CONF_CAPTURE_UNITSIZE,
SR_CONF_SAMPLERATE, 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) const struct sr_channel_group *cg)
{ {
struct session_vdev *vdev; struct session_vdev *vdev;
(void)cg; (void)cg;
switch (id) { switch (key) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
vdev = sdi->priv; 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) const struct sr_channel_group *cg)
{ {
struct session_vdev *vdev; 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: case SR_CONF_SAMPLERATE:
vdev->samplerate = g_variant_get_uint64(data); vdev->samplerate = g_variant_get_uint64(data);
sr_info("Setting samplerate to %" PRIu64 ".", vdev->samplerate); 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) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
@ -276,8 +276,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: 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,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break; break;
default: default:
return SR_ERR_NA; return SR_ERR_NA;