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:
Bert Vermeulen 2012-08-05 15:53:04 +02:00
parent 15cb43d67c
commit a56f148094
2 changed files with 16 additions and 0 deletions

View File

@ -276,3 +276,17 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial)
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;
}

View File

@ -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,
const char *trigger);
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 --------------------------------------------------------------*/