static int configure_probes(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
- const struct sr_probe *probe;
+ const struct sr_channel *probe;
const GSList *l;
int probe_bit, stage, i;
char *tc;
stage = -1;
for (l = sdi->probes; l; l = l->next) {
- probe = (struct sr_probe *)l->data;
+ probe = (struct sr_channel *)l->data;
if (probe->enabled == FALSE)
continue;
probe_bit = 1 << (probe->index);
{
struct dev_context *devc;
const GSList *l;
- const struct sr_probe *probe;
+ const struct sr_channel *probe;
char *tc;
int type;
devc = sdi->priv;
for (l = sdi->probes; l; l = l->next) {
- probe = (struct sr_probe *)l->data;
+ probe = (struct sr_channel *)l->data;
if (probe->enabled == FALSE)
continue;
return SR_OK;
}
-static int dev_clear(void)
-{
- return std_dev_clear(di, NULL);
-}
-
static int init(struct sr_context *sr_ctx)
{
return std_init(sr_ctx, di, LOG_PREFIX);
static GSList *scan(GSList *options)
{
struct sr_dev_inst *sdi;
- struct sr_probe *probe;
+ struct sr_channel *probe;
struct drv_context *drvc;
struct dev_context *devc;
const struct zp_model *prof;
static int cleanup(void)
{
- return dev_clear();
+ return std_dev_clear(di, NULL);
}
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
struct dev_context *devc;
- (void)probe_group;
+ (void)cg;
switch (id) {
case SR_CONF_SAMPLERATE:
} else
return SR_ERR_ARG;
break;
- case SR_CONF_MAX_UNCOMPRESSED_SAMPLES:
- if (sdi) {
- /* As long as this driver doesn't support compression,
- * this is ok. When compression is enabled, this should
- * return SR_ERR_NA instead. */
- devc = sdi->priv;
- *data = g_variant_new_uint64(devc->max_sample_depth);
- } else
- return SR_ERR;
- break;
default:
return SR_ERR_NA;
}
}
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
struct dev_context *devc;
gdouble low, high;
- (void)probe_group;
+ (void)cg;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
}
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
struct dev_context *devc;
- GVariant *gvar;
+ GVariant *gvar, *grange[2];
GVariantBuilder gvb;
double v;
GVariant *range[2];
- (void)probe_group;
+ (void)cg;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
}
*data = g_variant_builder_end(&gvb);
break;
+ case SR_CONF_LIMIT_SAMPLES:
+ if (!sdi)
+ return SR_ERR_ARG;
+ devc = sdi->priv;
+ grange[0] = g_variant_new_uint64(0);
+ grange[1] = g_variant_new_uint64(devc->max_sample_depth);
+ *data = g_variant_new_tuple(grange, 2);
+ break;
default:
return SR_ERR_NA;
}
.cleanup = cleanup,
.scan = scan,
.dev_list = dev_list,
- .dev_clear = dev_clear,
+ .dev_clear = NULL,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list,