sr: new API call sr_dev_config_set()
This is a wrapper around the driver dev_config_set() call, to avoid frontends needing visibility into drivers.
This commit is contained in:
parent
15cb43d67c
commit
a56f148094
14
device.c
14
device.c
|
@ -276,3 +276,17 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial)
|
||||||
g_free(serial->port);
|
g_free(serial->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SR_API int sr_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||||
|
const void *value)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!sdi || !sdi->driver || !sdi->driver->dev_config_set) {
|
||||||
|
sr_err("hwdriver: unable to set config option");
|
||||||
|
return SR_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = sdi->driver->dev_config_set(sdi, hwcap, value);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
2
proto.h
2
proto.h
|
@ -54,6 +54,8 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
|
||||||
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
|
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
|
||||||
const char *trigger);
|
const char *trigger);
|
||||||
SR_API gboolean sr_dev_has_hwcap(const struct sr_dev_inst *sdi, int hwcap);
|
SR_API gboolean sr_dev_has_hwcap(const struct sr_dev_inst *sdi, int hwcap);
|
||||||
|
SR_API int sr_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||||
|
const void *value);
|
||||||
|
|
||||||
/*--- filter.c --------------------------------------------------------------*/
|
/*--- filter.c --------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue