/** Used for setting or getting value of a config item. */
struct sr_config {
/** Config key like SR_CONF_CONN, etc. */
- int key;
+ uint32_t key;
/** Key-specific data. */
GVariant *data;
};
/** Information about a config key. */
struct sr_config_info {
/** Config key like SR_CONF_CONN, etc. */
- int key;
+ uint32_t key;
/** Data type like SR_T_STRING, etc. */
int datatype;
/** Id string, e.g. "serialcomm". */
/** Query value of a configuration key in driver or given device instance.
* @see sr_config_get().
*/
- int (*config_get) (int id, GVariant **data,
+ int (*config_get) (uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);
/** Set value of a configuration key in driver or a given device instance.
* @see sr_config_set(). */
- int (*config_set) (int id, GVariant *data,
+ int (*config_set) (uint32_t key, GVariant *data,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);
/** Channel status change.
/** List all possible values for a configuration key in a device instance.
* @see sr_config_list().
*/
- int (*config_list) (int info_id, GVariant **data,
+ int (*config_list) (uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);
SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
- int key, GVariant **data);
+ uint32_t key, GVariant **data);
SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
- int key, GVariant *data);
+ uint32_t key, GVariant *data);
SR_API int sr_config_commit(const struct sr_dev_inst *sdi);
SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
- int key, GVariant **data);
-SR_API const struct sr_config_info *sr_config_info_get(int key);
+ uint32_t key, GVariant **data);
+SR_API const struct sr_config_info *sr_config_info_get(uint32_t key);
SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);
/*--- session.c -------------------------------------------------------------*/
#include "libsigrok-internal.h"
#include "agilent-dmm.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(di, NULL);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_BUG;
}
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */
if (g_variant_get_uint64(data) == 0) {
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#include <string.h>
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(di, NULL);
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc = sdi->priv;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_DATA_SOURCE:
*data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
"9", "10", "11", "12", "13", "14", "15", "16",
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
ret = SR_OK;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
ret = set_samplerate(sdi, g_variant_get_uint64(data));
break;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
*data = g_variant_builder_end(&gvb);
break;
case SR_CONF_TRIGGER_MATCH:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
trigger_matches, ARRAY_SIZE(trigger_matches),
sizeof(int32_t));
break;
*/
#define SERIALCOMM "9600/8n2"
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS,
SR_CONF_OUTPUT_CHANNEL_CONFIG,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
};
-static const int32_t devopts_cg[] = {
+static const uint32_t devopts_cg[] = {
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT,
return std_dev_clear(di, NULL);
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return idx;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
/* Always available, even without sdi. */
if (key == SR_CONF_SCAN_OPTIONS) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
return SR_OK;
}
/* No channel group: global options. */
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
case SR_CONF_OUTPUT_CHANNEL_CONFIG:
if (devc->model->channel_modes == CHANMODE_INDEPENDENT) {
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
break;
case SR_CONF_OUTPUT_VOLTAGE_MAX:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
static struct sr_dev_driver *di = &beaglelogic_driver_info;
/* Hardware capabiities */
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
return SR_OK;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc = sdi->priv;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc = sdi->priv;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret;
ret = SR_OK;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
*data = g_variant_builder_end(&gvb);
break;
case SR_CONF_TRIGGER_MATCH:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
sizeof(int32_t));
break;
#define BRYMEN_BC86X "0820.0001"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(di, NULL);
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc = sdi->priv;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
return std_dev_clear(di, NULL);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
}
ret = SR_OK;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
break;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
/* 23ms is the longest interval between tokens. */
#define MAX_SCAN_TIME 25 * 1000
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
return std_dev_clear(di, NULL);
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *tuple, *range[2];
ret = SR_OK;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SPL_WEIGHT_FREQ:
*data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq));
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return dev_clear(idx);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_SAMPLES:
if (g_variant_get_uint64(data) == 0)
return SR_ERR_ARG;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
SR_PRIV struct sr_dev_driver chronovu_la_driver_info;
static struct sr_dev_driver *di = &chronovu_la_driver_info;
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
(void)cg;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
if (!sdi || !(devc = sdi->priv))
return SR_ERR_BUG;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
if (!(devc = sdi->priv))
return SR_ERR_BUG;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
if (cv_set_samplerate(sdi, g_variant_get_uint64(data)) < 0)
return SR_ERR;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar, *grange[2];
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
if (!sdi || !sdi->priv || !(devc = sdi->priv))
case SR_CONF_TRIGGER_MATCH:
if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof)
return SR_ERR_BUG;
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
trigger_matches, devc->prof->num_trigger_matches,
sizeof(int32_t));
break;
/* The Colead SL-5868P uses this. */
#define SERIALCOMM "2400/8n1"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(di, NULL);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_BUG;
}
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */
if (g_variant_get_uint64(data) == 0) {
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#define SERIALCOMM "9600/8n1"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_CURRENT,
return std_dev_clear(di, NULL);
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret;
ret = SR_OK;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
GHashTable *ch_ag;
};
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_NUM_LOGIC_CHANNELS,
SR_CONF_NUM_ANALOG_CHANNELS,
};
return std_dev_clear(di, clear_helper);
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_ARG;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_DEV_CLOSED;
ret = SR_OK;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
devc->cur_samplerate = g_variant_get_uint64(data);
sr_dbg("Setting samplerate to %" PRIu64, devc->cur_samplerate);
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct sr_channel *ch;
(void)sdi;
if (key == SR_CONF_SCAN_OPTIONS) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
return SR_OK;
}
if (!cg) {
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
if (ch->type == SR_CHANNEL_LOGIC)
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic),
- sizeof(int32_t));
+ sizeof(uint32_t));
else if (ch->type == SR_CHANNEL_ANALOG)
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog),
- sizeof(int32_t));
+ sizeof(uint32_t));
else
return SR_ERR_BUG;
break;
#include "libsigrok-internal.h"
#include "fluke-dmm.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(di, NULL);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_BUG;
}
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */
if (g_variant_get_uint64(data) == 0) {
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_TRIGGER_MATCH,
SR_CONF_SAMPLERATE,
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_CONN:
if (!sdi->conn)
return SR_ERR_ARG;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
ret = SR_OK;
- switch (id)
- {
+ switch (key) {
case SR_CONF_SAMPLERATE:
arg = g_variant_get_uint64(data);
for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info;
SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info;
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
/** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
-static const int32_t hwcaps_sm[] = {
+static const uint32_t hwcaps_sm[] = {
SR_CONF_MULTIMETER,
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_LIMIT_SAMPLES,
};
/** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */
-static const int32_t hwcaps_bd[] = {
+static const uint32_t hwcaps_bd[] = {
SR_CONF_MULTIMETER,
SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_LIMIT_SAMPLES,
}
/** Get value of configuration item */
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *cg)
{
int ret;
struct dev_context *devc;
}
/** Implementation of config_list, auxiliary function for common parts, */
-static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_list_common(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *cg)
{
(void)sdi;
(void)cg;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
}
/** Implementation of config_list for Metrahit 1x/2x send mode */
-static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list_sm(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(uint32_t));
break;
default:
return config_list_common(key, data, sdi, cg);
}
/** Implementation of config_list for Metrahit 2x bidirectional mode */
-static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list_bd(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(uint32_t));
break;
default:
return config_list_common(key, data, sdi, cg);
/** @copydoc sr_dev_driver.config_set
*/
-SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+SR_PRIV int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *cg)
{
struct dev_context *devc;
uint8_t params[9];
};
/* Forward declarations */
-SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+SR_PRIV int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg);
SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf);
SR_PRIV void dump_msg14(guchar* buf, gboolean raw);
"HAMEG",
};
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
return CG_INVALID;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret, cg_type;
return g_variant_builder_end(&gvb);
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret, cg_type;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int cg_type;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_NONE) {
- *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));
+ sizeof(uint32_t));
} 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));
+ sizeof(uint32_t));
} else {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- NULL, 0, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ NULL, 0, sizeof(uint32_t));
}
break;
case SR_CONF_COUPLING:
[SCPI_CMD_SET_ANALOG_CHAN_STATE] = ":CHAN%d:STAT %d",
};
-static const int32_t hmo_hwcaps[] = {
+static const uint32_t hmo_hwcaps[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_TIMEBASE,
SR_CONF_LIMIT_FRAMES,
};
-static const int32_t hmo_analog_caps[] = {
+static const uint32_t hmo_analog_caps[] = {
SR_CONF_NUM_VDIV,
SR_CONF_COUPLING,
SR_CONF_VDIV,
const char *(*analog_names)[];
const char *(*digital_names)[];
- const int32_t (*hw_caps)[];
+ const uint32_t (*hw_caps)[];
const uint8_t num_hwcaps;
- const int32_t (*analog_hwcaps)[];
+ const uint32_t (*analog_hwcaps)[];
const uint8_t num_analog_hwcaps;
const char *(*coupling_options)[];
#define NUM_TIMEBASE 10
#define NUM_VDIV 8
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_LIMIT_FRAMES,
SR_CONF_CONTINUOUS,
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct sr_usb_dev_inst *usb;
(void)cg;
- switch (id) {
+ switch (key) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_ERR_ARG;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
ret = SR_OK;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_FRAMES:
devc->limit_frames = g_variant_get_uint64(data);
break;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
case SR_CONF_BUFFERSIZE:
if (!sdi)
#include "protocol.h"
-static const int hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_SAMPLES,
return dev_clear();
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
uint64_t samplerate, limit_samples, capture_ratio;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar, *grange[2];
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, hwcaps,
- ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
#define SAMPLE_BUF_SIZE (8 * 1024 * 1024)
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_MSEC,
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
(void)cg;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
/* The ScanaPLUS samplerate is 100MHz and can't be changed. */
*data = g_variant_new_uint64(SR_MHZ(100));
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
if (g_variant_get_uint64(data) != SR_MHZ(100)) {
sr_err("ScanaPLUS only supports samplerate = 100MHz.");
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
#define VENDOR "Kecheng"
#define USB_INTERFACE 0
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
return ret;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *tuple, *rational[2];
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLE_INTERVAL:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info;
static struct sr_dev_driver *di = &lascar_el_usb_driver_info;
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER,
SR_CONF_HYGROMETER,
SR_CONF_DATALOG,
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
(void)cg;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_ERR_ARG;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
ret = SR_OK;
- switch (id) {
+ switch (key) {
case SR_CONF_DATALOG:
if (g_variant_get_boolean(data)) {
/* Start logging. */
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#include "protocol.h"
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
/* Device class */
SR_CONF_POWER_SUPPLY,
/* Aquisition modes. */
return dev_clear();
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
case SR_CONF_OUTPUT_CURRENT_MAX:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER,
SR_CONF_HYGROMETER,
SR_CONF_LIMIT_SAMPLES,
return dev_clear(idx);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
sr_dbg("Setting sample limit to %" PRIu64 ".",
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#define VENDOR_MOTECH "Motech"
/** Driver scanning options. */
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
/** Hardware capabilities generic. */
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
/* Device class */
SR_CONF_POWER_SUPPLY,
/* Aquisition modes. */
};
/** Hardware capabilities channel 1, 2. */
-static const int32_t hwcaps_ch12[] = {
+static const uint32_t hwcaps_ch12[] = {
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_VOLTAGE_MAX,
SR_CONF_OUTPUT_CURRENT,
};
/** Hardware capabilities channel 3. (LPS-304/305 only). */
-static const int32_t hwcaps_ch3[] = {
+static const uint32_t hwcaps_ch3[] = {
SR_CONF_OUTPUT_VOLTAGE,
SR_CONF_OUTPUT_ENABLED,
};
return dev_clear_lps301();
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
/* Driver options, no device instance necessary. */
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
return SR_OK;
default:
if (sdi == NULL)
devc = sdi->priv;
}
- /* Device options, independant from channel groups. */
+ /* Device options, independent from channel groups. */
if (cg == NULL) {
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
return SR_OK;
case SR_CONF_OUTPUT_CHANNEL_CONFIG:
if (devc->model->modelid <= LPS_303) {
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps_ch12, ARRAY_SIZE(hwcaps_ch12), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps_ch12, ARRAY_SIZE(hwcaps_ch12), sizeof(uint32_t));
else /* Must be CH3 */
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps_ch3, ARRAY_SIZE(hwcaps_ch3), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps_ch3, ARRAY_SIZE(hwcaps_ch3), sizeof(uint32_t));
break;
case SR_CONF_OUTPUT_VOLTAGE_MAX:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(&siemens_b102x_driver_info, NULL);
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#define SERIALCOMM "115200/8n1"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
return std_dev_clear(di, NULL);
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_ARG;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
tmp_u64 = g_variant_get_uint64(data);
if (tmp_u64 < samplerates[0] || tmp_u64 > samplerates[1])
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
#include "protocol.h"
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_ARG;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
tmp_u64 = g_variant_get_uint64(data);
if (tmp_u64 < samplerates[0] || tmp_u64 > samplerates[1])
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
#include "libsigrok-internal.h"
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_OSCILLOSCOPE,
SR_CONF_TIMEBASE,
SR_CONF_TRIGGER_SOURCE,
SR_CONF_SAMPLERATE,
};
-static const int32_t analog_hwcaps[] = {
+static const uint32_t analog_hwcaps[] = {
SR_CONF_NUM_VDIV,
SR_CONF_VDIV,
SR_CONF_COUPLING,
}
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
}
}
- switch (id) {
+ switch (key) {
case SR_CONF_NUM_TIMEBASE:
*data = g_variant_new_int32(devc->model->series->num_horizontal_divs);
break;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
}
ret = SR_OK;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_FRAMES:
devc->limit_frames = g_variant_get_uint64(data);
break;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *tuple, *rational[2];
devc = sdi->priv;
if (key == SR_CONF_SCAN_OPTIONS) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
return SR_OK;
} else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
return SR_OK;
}
return SR_ERR_CHANNEL_GROUP;
}
if (cg == devc->digital_group) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- NULL, 0, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ NULL, 0, sizeof(uint32_t));
return SR_OK;
} else {
for (i = 0; i < devc->model->analog_channels; i++) {
if (cg == devc->analog_groups[i]) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(uint32_t));
return SR_OK;
}
}
SR_PRIV struct sr_dev_driver saleae_logic16_driver_info;
static struct sr_dev_driver *di = &saleae_logic16_driver_info;
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_VOLTAGE_THRESHOLD,
return ret;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar, *range[2];
ret = SR_OK;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
extern unsigned int num_pps_profiles;
extern const struct scpi_pps pps_profiles[];
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
return SR_OK;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct sr_channel *ch;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
/* Always available, even without sdi. */
if (key == SR_CONF_SCAN_OPTIONS) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
return SR_OK;
}
/* No channel group: global options. */
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devc->device->devopts, devc->device->num_devopts,
- sizeof(int32_t));
+ sizeof(uint32_t));
break;
case SR_CONF_OUTPUT_CHANNEL_CONFIG:
/* Not used. */
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devc->device->devopts_cg, devc->device->num_devopts_cg,
- sizeof(int32_t));
+ sizeof(uint32_t));
break;
case SR_CONF_OUTPUT_VOLTAGE_MAX:
ch_spec = &(devc->device->channels[ch->index]);
return raw_vendor;
}
-static const int32_t devopts_none[] = { };
+static const uint32_t devopts_none[] = { };
/* Rigol DP800 series */
-static const int32_t rigol_dp800_devopts[] = {
+static const uint32_t rigol_dp800_devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS,
SR_CONF_OVER_TEMPERATURE_PROTECTION,
};
-static const int32_t rigol_dp800_devopts_cg[] = {
+static const uint32_t rigol_dp800_devopts_cg[] = {
SR_CONF_OUTPUT_REGULATION,
SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED,
SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE,
};
/* HP 663xx series */
-static const int32_t hp_6632b_devopts[] = {
+static const uint32_t hp_6632b_devopts[] = {
SR_CONF_POWER_SUPPLY,
SR_CONF_CONTINUOUS,
SR_CONF_OUTPUT_ENABLED,
char *vendor;
char *model;
uint64_t features;
- const int32_t *devopts;
+ const uint32_t *devopts;
unsigned int num_devopts;
- const int32_t *devopts_cg;
+ const uint32_t *devopts_cg;
unsigned int num_devopts_cg;
struct channel_spec *channels;
unsigned int num_channels;
#include "libsigrok-internal.h"
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return dev_clear(dmm);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_BUG;
}
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
sr_dbg("Setting sample limit to %" PRIu64 ".",
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#include <stdlib.h>
#include <string.h>
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_EXTERNAL_CLOCK,
return dev_clear();
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return -1;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
uint64_t value;
return lwla_set_clock_config(sdi);
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
GVariant *gvar;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, G_N_ELEMENTS(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, G_N_ELEMENTS(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, G_N_ELEMENTS(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, G_N_ELEMENTS(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
#include "libsigrok-internal.h"
#include "protocol.h"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_ENERGYMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return std_dev_clear(di, NULL);
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
static struct sr_dev_driver *di = &testo_driver_info;
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
-static const int32_t scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
-static const int32_t devopts[] = {
+static const uint32_t devopts[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES,
return ret;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct sr_usb_dev_inst *usb;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#define SERIALCOMM "9600/8e1"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_SOUNDLEVELMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
return std_dev_clear(di, NULL);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
sr_dbg("Setting sample limit to %" PRIu64 ".",
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#define UNI_T_UT_D04_NEW "1a86.e008"
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_LIMIT_MSEC,
return dev_clear(dmm);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_MSEC:
if (g_variant_get_uint64(data) == 0) {
sr_err("Time limit cannot be 0.");
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
#include <string.h>
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_THERMOMETER,
SR_CONF_LIMIT_SAMPLES,
SR_CONF_CONTINUOUS,
return ret;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_OK;
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
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)
{
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_DATA_SOURCE:
*data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));
static struct sr_dev_driver *di = &victor_dmm_driver_info;
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
SR_CONF_CONN,
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_MULTIMETER,
SR_CONF_LIMIT_MSEC,
SR_CONF_LIMIT_SAMPLES,
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct sr_usb_dev_inst *usb;
(void)cg;
- switch (id) {
+ switch (key) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_ERR_ARG;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
devc = sdi->priv;
ret = SR_OK;
- switch (id) {
+ switch (key) {
case SR_CONF_LIMIT_MSEC:
devc->limit_msec = g_variant_get_uint64(data);
now = g_get_monotonic_time() / 1000;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;
return CG_INVALID;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret, cg_type;
return g_variant_builder_end(&gvb);
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret, cg_type;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int cg_type;
break;
case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_NONE) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- model->hw_caps, model->num_hwcaps, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ model->hw_caps, model->num_hwcaps, sizeof(uint32_t));
} else if (cg_type == CG_ANALOG) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- model->analog_hwcaps, model->num_analog_hwcaps, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ model->analog_hwcaps, model->num_analog_hwcaps, sizeof(uint32_t));
} else {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- NULL, 0, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ NULL, 0, sizeof(uint32_t));
}
break;
case SR_CONF_COUPLING:
#include "protocol.h"
-static const int32_t dlm_hwcaps[] = {
+static const uint32_t dlm_hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_OSCILLOSCOPE,
SR_CONF_TRIGGER_SLOPE,
SR_CONF_HORIZ_TRIGGERPOS,
};
-static const int32_t dlm_analog_caps[] = {
+static const uint32_t dlm_analog_caps[] = {
SR_CONF_VDIV,
SR_CONF_COUPLING,
SR_CONF_NUM_VDIV,
const char *(*analog_names)[];
const char *(*digital_names)[];
- const int32_t (*hw_caps)[];
+ const uint32_t (*hw_caps)[];
const uint8_t num_hwcaps;
- const int32_t (*analog_hwcaps)[];
+ const uint32_t (*analog_hwcaps)[];
const uint8_t num_analog_hwcaps;
const char *(*coupling_options)[];
{ 0, 0, 0, 0, 0, 0 }
};
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_TRIGGER_MATCH,
return std_dev_clear(di, NULL);
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
(void)cg;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
return SR_ERR_ARG;
}
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
return zp_set_samplerate(devc, g_variant_get_uint64(data));
case SR_CONF_LIMIT_SAMPLES:
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct dev_context *devc;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
devc = sdi->priv;
}
}
-SR_PRIV int sr_variant_type_check(int key, GVariant *value)
+SR_PRIV int sr_variant_type_check(uint32_t key, GVariant *value)
{
const struct sr_config_info *info;
const GVariantType *type, *expected;
* A floating reference can be passed in for data.
* @private
*/
-SR_PRIV struct sr_config *sr_config_new(int key, GVariant *data)
+SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data)
{
struct sr_config *src;
SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
- int key, GVariant **data)
+ uint32_t key, GVariant **data)
{
int ret;
*/
SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
- int key, GVariant *data)
+ uint32_t key, GVariant *data)
{
int ret;
SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg,
- int key, GVariant **data)
+ uint32_t key, GVariant **data)
{
int ret;
*
* @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;
/*--- hwdriver.c ------------------------------------------------------------*/
SR_PRIV const GVariantType *sr_variant_type_get(int datatype);
-SR_PRIV int sr_variant_type_check(int key, GVariant *data);
+SR_PRIV int sr_variant_type_check(uint32_t key, GVariant *data);
SR_PRIV void sr_hw_cleanup_all(void);
-SR_PRIV struct sr_config *sr_config_new(int key, GVariant *data);
+SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data);
SR_PRIV void sr_config_free(struct sr_config *src);
SR_PRIV int sr_source_remove(int fd);
SR_PRIV int sr_source_remove_pollfd(GPollFD *pollfd);
gboolean finished;
};
-static const int hwcaps[] = {
+static const uint32_t hwcaps[] = {
SR_CONF_CAPTUREFILE,
SR_CONF_CAPTURE_UNITSIZE,
SR_CONF_SAMPLERATE,
return SR_OK;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct session_vdev *vdev;
(void)cg;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
if (sdi) {
vdev = sdi->priv;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
struct session_vdev *vdev;
vdev = sdi->priv;
- switch (id) {
+ switch (key) {
case SR_CONF_SAMPLERATE:
vdev->samplerate = g_variant_get_uint64(data);
sr_info("Setting samplerate to %" PRIu64 ".", vdev->samplerate);
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
(void)sdi;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
break;
default:
return SR_ERR_NA;