};
static const char *trigger_sources[] = {
- "CH1",
- "CH2",
- "EXT",
+ "CH1", "CH2", "EXT",
/* TODO: forced */
};
static const char *trigger_slopes[] = {
- "r",
- "f",
+ "r", "f",
};
static const char *coupling[] = {
- "AC",
- "DC",
- "GND",
+ "AC", "DC", "GND",
};
static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof)
return SR_OK;
}
-static int config_get(uint32_t 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)
{
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
- char str[128];
const char *s;
const uint64_t *vdiv;
int ch_idx;
/* Device still needs to re-enumerate after firmware
* upload, so we don't know its (future) address. */
return SR_ERR;
- snprintf(str, 128, "%d.%d", usb->bus, usb->address);
- *data = g_variant_new_string(str);
+ *data = g_variant_new_printf("%d.%d", usb->bus, usb->address);
break;
case SR_CONF_TIMEBASE:
*data = g_variant_new("(tt)", timebases[devc->timebase][0],
return SR_OK;
}
-static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+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;
double tmp_double;
return SR_OK;
}
-static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+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;
*data = std_gvar_array_u64(devc->profile->buffersizes, NUM_BUFFER_SIZES);
break;
case SR_CONF_TIMEBASE:
- *data = std_gvar_tuple_array(&timebases, ARRAY_SIZE(timebases));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(timebases));
break;
case SR_CONF_TRIGGER_SOURCE:
*data = g_variant_new_strv(ARRAY_AND_SIZE(trigger_sources));
*data = g_variant_new_strv(ARRAY_AND_SIZE(coupling));
break;
case SR_CONF_VDIV:
- *data = std_gvar_tuple_array(&vdivs, ARRAY_SIZE(vdivs));
+ *data = std_gvar_tuple_array(ARRAY_AND_SIZE(vdivs));
break;
default:
return SR_ERR_NA;