/* TODO: struct context as with the other drivers. */
/* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
-static GSList *dev_insts = NULL;
+SR_PRIV struct sr_dev_driver demo_driver_info;
+static struct sr_dev_driver *ddi = &demo_driver_info;
static uint64_t cur_samplerate = SR_KHZ(200);
static uint64_t limit_samples = 0;
static uint64_t limit_msec = 0;
return SR_OK;
}
-static int hw_scan(void)
+static GSList *hw_scan(GSList *options)
{
struct sr_dev_inst *sdi;
+ GSList *devices;
+
+ (void)options;
+ devices = NULL;
sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, DEMONAME, NULL, NULL);
if (!sdi) {
return 0;
}
- dev_insts = g_slist_append(dev_insts, sdi);
+ devices = g_slist_append(devices, sdi);
+ ddi->instances = g_slist_append(ddi->instances, sdi);
- return 1;
+ return devices;
}
static int hw_dev_open(int dev_index)
struct sr_dev_inst *sdi;
const void *info = NULL;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(ddi->instances, dev_index))) {
sr_err("demo: %s: sdi was NULL", __func__);
return NULL;
}
.dev_config_set = hw_dev_config_set,
.dev_acquisition_start = hw_dev_acquisition_start,
.dev_acquisition_stop = hw_dev_acquisition_stop,
+ .instances = NULL,
};