This is replaced by SR_CONF_DEVICE_OPTIONS.
if (!sdi || !sdi->driver)
return FALSE;
- if (sdi->driver->config_get(SR_DI_HWCAPS,
+ if (sdi->driver->config_list(SR_CONF_DEVICE_OPTIONS,
(const void **)&hwcaps, NULL) != SR_OK)
return FALSE;
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
{
struct dev_context *devc;
- if (id != SR_DI_HWCAPS) /* For SR_DI_HWCAPS sdi will be NULL. */
- devc = sdi->priv;
-
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
+ devc = sdi->priv;
*data = &devc->cur_samplerate;
break;
default:
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
if (!sdi || !sdi->priv)
return SR_ERR_ARG;
struct dev_context *devc;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;
struct dev_context *devc;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
fill_supported_samplerates_if_needed();
*data = &samplerates;
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
*data = &cur_samplerate;
break;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
struct dev_context *devc;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;
(void)sdi;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
/* TODO remove this */
case SR_CONF_SAMPLERATE:
*data = &tmp;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_BUFFERSIZE:
*data = buffersizes;
break;
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
struct dev_context *devc;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;
(void)sdi;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_COUPLING:
*data = coupling;
break;
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
case SR_DI_HWOPTS:
*data = hwopts;
break;
- case SR_DI_HWCAPS:
- *data = hwcaps;
- sr_spew("%s: Returning hwcaps.", __func__);
- break;
case SR_CONF_SAMPLERATE:
/* TODO: Get rid of this. */
*data = NULL;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
default:
return SR_ERR_ARG;
}
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
default:
return SR_ERR_ARG;
}
struct dev_context *devc;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
(void)sdi;
switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
case SR_CONF_SAMPLERATE:
*data = &samplerates;
break;
return FALSE;
}
- if (driver->config_get(SR_DI_HWCAPS, (const void **)&hwcaps, NULL) != SR_OK)
+ if (driver->config_list(SR_CONF_DEVICE_OPTIONS, (const void **)&hwcaps, NULL) != SR_OK)
return FALSE;
for (i = 0; hwcaps[i]; i++) {
/** The device can measure humidity. */
SR_CONF_HYGROMETER,
- /*--- Driver options ------------------------------------------------*/
+ /*--- Driver scan options -------------------------------------------*/
/**
* Specification on how to connect to a device.
/*--- Special stuff -------------------------------------------------*/
+ /** Scan options supported by the driver. */
+ SR_CONF_SCAN_OPTIONS,
+
+ /** Device options for a particular device. */
+ SR_CONF_DEVICE_OPTIONS,
+
/** Session filename. */
SR_CONF_SESSIONFILE = 40000,
enum {
/** A list of options supported by the driver. */
SR_DI_HWOPTS = 10000,
- /** A list of capabilities supported by the device. */
- SR_DI_HWCAPS,
};
/*
struct session_vdev *vdev;
switch (id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
case SR_CONF_SAMPLERATE:
if (sdi) {
vdev = sdi->priv;
return SR_OK;
}
+static int config_list(int key, const void **data, const struct sr_dev_inst *sdi)
+{
+
+ (void)sdi;
+
+ switch (key) {
+ case SR_CONF_DEVICE_OPTIONS:
+ *data = hwcaps;
+ break;
+ default:
+ return SR_ERR_ARG;
+ }
+
+ return SR_OK;
+}
+
static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
void *cb_data)
{
.cleanup = hw_cleanup,
.config_get = config_get,
.config_set = config_set,
+ .config_list = config_list,
.dev_open = hw_dev_open,
.dev_close = NULL,
.dev_acquisition_start = hw_dev_acquisition_start,