Deprecate SR_DI_HWCAPS.
This is replaced by SR_CONF_DEVICE_OPTIONS.
This commit is contained in:
parent
c50277a6ec
commit
9a6517d14b
2
device.c
2
device.c
|
@ -198,7 +198,7 @@ SR_API gboolean sr_dev_has_hwcap(const struct sr_dev_inst *sdi, int hwcap)
|
||||||
if (!sdi || !sdi->driver)
|
if (!sdi || !sdi->driver)
|
||||||
return FALSE;
|
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)
|
(const void **)&hwcaps, NULL) != SR_OK)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
|
@ -255,9 +255,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -308,6 +305,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,14 +144,9 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
{
|
{
|
||||||
struct dev_context *devc;
|
struct dev_context *devc;
|
||||||
|
|
||||||
if (id != SR_DI_HWCAPS) /* For SR_DI_HWCAPS sdi will be NULL. */
|
|
||||||
devc = sdi->priv;
|
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
|
devc = sdi->priv;
|
||||||
*data = &devc->cur_samplerate;
|
*data = &devc->cur_samplerate;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -189,6 +184,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (!sdi || !sdi->priv)
|
if (!sdi || !sdi->priv)
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
|
|
|
@ -792,9 +792,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
struct dev_context *devc;
|
struct dev_context *devc;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
@ -843,6 +840,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -293,9 +293,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
struct dev_context *devc;
|
struct dev_context *devc;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
@ -361,6 +358,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
fill_supported_samplerates_if_needed();
|
fill_supported_samplerates_if_needed();
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
|
|
|
@ -199,9 +199,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -252,6 +249,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,9 +231,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &cur_samplerate;
|
*data = &cur_samplerate;
|
||||||
break;
|
break;
|
||||||
|
@ -298,6 +295,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -289,9 +289,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -342,6 +339,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,9 +607,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
struct dev_context *devc;
|
struct dev_context *devc;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
@ -650,6 +647,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -429,9 +429,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
/* TODO remove this */
|
/* TODO remove this */
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &tmp;
|
*data = &tmp;
|
||||||
|
@ -568,6 +565,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_BUFFERSIZE:
|
case SR_CONF_BUFFERSIZE:
|
||||||
*data = buffersizes;
|
*data = buffersizes;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -221,9 +221,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -267,6 +264,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,9 +303,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
struct dev_context *devc;
|
struct dev_context *devc;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
@ -392,6 +389,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -258,9 +258,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
@ -329,6 +326,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -329,9 +329,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -433,6 +430,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_COUPLING:
|
case SR_CONF_COUPLING:
|
||||||
*data = coupling;
|
*data = coupling;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -381,9 +381,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -429,6 +426,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,9 +203,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -244,6 +241,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,10 +196,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
case SR_DI_HWOPTS:
|
case SR_DI_HWOPTS:
|
||||||
*data = hwopts;
|
*data = hwopts;
|
||||||
break;
|
break;
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
sr_spew("%s: Returning hwcaps.", __func__);
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
/* TODO: Get rid of this. */
|
/* TODO: Get rid of this. */
|
||||||
*data = NULL;
|
*data = NULL;
|
||||||
|
@ -255,6 +251,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,9 +249,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -304,6 +301,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,9 +534,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
struct dev_context *devc;
|
struct dev_context *devc;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
devc = sdi->priv;
|
devc = sdi->priv;
|
||||||
|
@ -647,6 +644,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
|
||||||
(void)sdi;
|
(void)sdi;
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case SR_CONF_DEVICE_OPTIONS:
|
||||||
|
*data = hwcaps;
|
||||||
|
break;
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
*data = &samplerates;
|
*data = &samplerates;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -365,7 +365,7 @@ SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap)
|
||||||
return FALSE;
|
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;
|
return FALSE;
|
||||||
|
|
||||||
for (i = 0; hwcaps[i]; i++) {
|
for (i = 0; hwcaps[i]; i++) {
|
||||||
|
|
10
libsigrok.h
10
libsigrok.h
|
@ -388,7 +388,7 @@ enum {
|
||||||
/** The device can measure humidity. */
|
/** The device can measure humidity. */
|
||||||
SR_CONF_HYGROMETER,
|
SR_CONF_HYGROMETER,
|
||||||
|
|
||||||
/*--- Driver options ------------------------------------------------*/
|
/*--- Driver scan options -------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specification on how to connect to a device.
|
* Specification on how to connect to a device.
|
||||||
|
@ -466,6 +466,12 @@ enum {
|
||||||
|
|
||||||
/*--- Special stuff -------------------------------------------------*/
|
/*--- Special stuff -------------------------------------------------*/
|
||||||
|
|
||||||
|
/** Scan options supported by the driver. */
|
||||||
|
SR_CONF_SCAN_OPTIONS,
|
||||||
|
|
||||||
|
/** Device options for a particular device. */
|
||||||
|
SR_CONF_DEVICE_OPTIONS,
|
||||||
|
|
||||||
/** Session filename. */
|
/** Session filename. */
|
||||||
SR_CONF_SESSIONFILE = 40000,
|
SR_CONF_SESSIONFILE = 40000,
|
||||||
|
|
||||||
|
@ -552,8 +558,6 @@ enum {
|
||||||
enum {
|
enum {
|
||||||
/** A list of options supported by the driver. */
|
/** A list of options supported by the driver. */
|
||||||
SR_DI_HWOPTS = 10000,
|
SR_DI_HWOPTS = 10000,
|
||||||
/** A list of capabilities supported by the device. */
|
|
||||||
SR_DI_HWCAPS,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -153,9 +153,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
|
||||||
struct session_vdev *vdev;
|
struct session_vdev *vdev;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SR_DI_HWCAPS:
|
|
||||||
*data = hwcaps;
|
|
||||||
break;
|
|
||||||
case SR_CONF_SAMPLERATE:
|
case SR_CONF_SAMPLERATE:
|
||||||
if (sdi) {
|
if (sdi) {
|
||||||
vdev = sdi->priv;
|
vdev = sdi->priv;
|
||||||
|
@ -207,6 +204,22 @@ static int config_set(int id, const void *value, const struct sr_dev_inst *sdi)
|
||||||
return SR_OK;
|
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,
|
static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
|
||||||
void *cb_data)
|
void *cb_data)
|
||||||
{
|
{
|
||||||
|
@ -274,6 +287,7 @@ SR_PRIV struct sr_dev_driver session_driver = {
|
||||||
.cleanup = hw_cleanup,
|
.cleanup = hw_cleanup,
|
||||||
.config_get = config_get,
|
.config_get = config_get,
|
||||||
.config_set = config_set,
|
.config_set = config_set,
|
||||||
|
.config_list = config_list,
|
||||||
.dev_open = hw_dev_open,
|
.dev_open = hw_dev_open,
|
||||||
.dev_close = NULL,
|
.dev_close = NULL,
|
||||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||||
|
|
Loading…
Reference in New Issue