if (!sdi || !sdi->driver || !sdi->driver->config_list)
return FALSE;
- if (sdi->driver->config_list(SR_CONF_DEVICE_OPTIONS, &gvar, NULL) != SR_OK)
+ if (sdi->driver->config_list(SR_CONF_DEVICE_OPTIONS,
+ &gvar, NULL, NULL) != SR_OK)
return FALSE;
ret = FALSE;
return dev_clear();
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
devc = sdi->priv;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
GVariant *gvar;
GVariantBuilder gvb;
int i;
+ (void)probe_group;
+
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
if (sdi) {
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
int ret;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *gvar;
GVariantBuilder gvb;
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
return dev_clear();
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
int ret;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
if (sdi) {
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *gvar;
GVariantBuilder gvb;
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
return dev_clear();
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *const devc = sdi->priv;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
int ret;
const char *stropt;
+ (void)probe_group;
struct dev_context *const devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *gvar;
GVariantBuilder gvb;
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
return dev_clear();
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
char str[128];
+ (void)probe_group;
+
switch (id) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
int ret;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *gvar;
GVariantBuilder gvb;
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct sr_usb_dev_inst *usb;
char str[128];
+ (void)probe_group;
+
switch (id) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
double tmp_double;
const char *tmp_str;
char **targets;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
GVariant *tuple, *rational[2];
GVariantBuilder gvb;
unsigned int i;
+ (void)probe_group;
+
if (!sdi)
return SR_ERR_ARG;
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
int ret;
char str[128];
+ (void)probe_group;
+
devc = sdi->priv;
switch (id) {
case SR_CONF_CONN:
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
int ret;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
if (sdi) {
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
int ret;
struct dev_context *devc;
int trigger_pos;
double pos;
+ (void)probe_group;
devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *gvar;
GVariantBuilder gvb;
+ (void)probe_group;
(void)sdi;
switch (key) {
return dev_clear(idx);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (!sdi)
return SR_ERR_ARG;
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
int ret;
uint64_t tmp_u64;
const char *stropt;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *gvar;
GVariantBuilder gvb;
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
(void)sdi;
+ (void)probe_group;
switch (id) {
case SR_CONF_NUM_TIMEBASE:
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
uint64_t tmp_u64, p, q;
int ret;
const char *tmp_str;
+ (void)probe_group;
+
devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
GVariant *tuple, *rational[2];
GVariantBuilder gvb;
unsigned int i;
struct dev_context *devc;
+ (void)probe_group;
+
switch (key) {
case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
return dev_clear(dmm);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear(dmm);
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
devc = sdi->priv;
switch (id) {
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct sr_usb_dev_inst *usb;
char str[128];
+ (void)probe_group;
+
switch (id) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
gint64 now;
int ret;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
if (sdi) {
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
+ (void)probe_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct dev_context *devc;
GVariant *gvar;
GVariantBuilder gvb;
+ (void)probe_group;
+
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
* but this is not to be flagged as an error by the caller; merely
* as an indication that it's not applicable.
*/
-SR_API int sr_config_get(const struct sr_dev_driver *driver, int key,
- GVariant **data, const struct sr_dev_inst *sdi)
+SR_API int sr_config_get(const struct sr_dev_driver *driver,
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group,
+ int key, GVariant **data)
{
int ret;
if (!driver->config_get)
return SR_ERR_ARG;
- if ((ret = driver->config_get(key, data, sdi)) == SR_OK) {
+ if ((ret = driver->config_get(key, data, sdi, probe_group)) == SR_OK) {
/* Got a floating reference from the driver. Sink it here,
* caller will need to unref when done with it. */
g_variant_ref_sink(*data);
* but this is not to be flagged as an error by the caller; merely
* as an indication that it's not applicable.
*/
-SR_API int sr_config_set(const struct sr_dev_inst *sdi, int key, GVariant *data)
+SR_API int sr_config_set(const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group,
+ int key, GVariant *data)
{
int ret;
else if (!sdi->driver->config_set)
ret = SR_ERR_ARG;
else
- ret = sdi->driver->config_set(key, data, sdi);
+ ret = sdi->driver->config_set(key, data, sdi, probe_group);
g_variant_unref(data);
* but this is not to be flagged as an error by the caller; merely
* as an indication that it's not applicable.
*/
-SR_API int sr_config_list(const struct sr_dev_driver *driver, int key,
- GVariant **data, const struct sr_dev_inst *sdi)
+SR_API int sr_config_list(const struct sr_dev_driver *driver,
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group,
+ int key, GVariant **data)
{
int ret;
ret = SR_ERR;
else if (!driver->config_list)
ret = SR_ERR_ARG;
- else if ((ret = driver->config_list(key, data, sdi)) == SR_OK)
+ else if ((ret = driver->config_list(key, data, sdi, probe_group)) == SR_OK)
g_variant_ref_sink(*data);
return ret;
char *trigger;
};
+struct sr_probe_group {
+ /* List of sr_probe structs. */
+ GSList *probes;
+ /* Private data for driver use. */
+ void *data;
+};
+
struct sr_config {
int key;
GVariant *data;
char *model;
char *version;
GSList *probes;
+ /* List of sr_probe_group structs */
+ GSList *probe_groups;
void *conn;
void *priv;
};
GSList *(*dev_list) (void);
int (*dev_clear) (void);
int (*config_get) (int id, GVariant **data,
- const struct sr_dev_inst *sdi);
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group);
int (*config_set) (int id, GVariant *data,
- const struct sr_dev_inst *sdi);
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group);
int (*config_list) (int info_id, GVariant **data,
- const struct sr_dev_inst *sdi);
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group);
/* Device-specific */
int (*dev_open) (struct sr_dev_inst *sdi);
GVariant *gvar;
int num_enabled_probes;
- if (!ctx->samplerate && sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
- &gvar, sdi) == SR_OK) {
+ if (!ctx->samplerate && sr_config_get(sdi->driver, sdi, NULL,
+ SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
ctx->samplerate = g_variant_get_uint64(gvar);
g_variant_unref(gvar);
}
SR_API int sr_driver_init(struct sr_context *ctx,
struct sr_dev_driver *driver);
SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options);
-SR_API int sr_config_get(const struct sr_dev_driver *driver, int key,
- GVariant **data, const struct sr_dev_inst *sdi);
-SR_API int sr_config_set(const struct sr_dev_inst *sdi, int key,
- GVariant *data);
-SR_API int sr_config_list(const struct sr_dev_driver *driver, int key,
- GVariant **data, const struct sr_dev_inst *sdi);
+SR_API int sr_config_get(const struct sr_dev_driver *driver,
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group,
+ int key, GVariant **data);
+SR_API int sr_config_set(const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group,
+ int key, GVariant *data);
+SR_API int sr_config_list(const struct sr_dev_driver *driver,
+ const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group,
+ int key, GVariant **data);
SR_API const struct sr_config_info *sr_config_info_get(int key);
SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);
return SR_OK;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct session_vdev *vdev;
+ (void)probe_group;
+
switch (id) {
case SR_CONF_SAMPLERATE:
if (sdi) {
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
struct session_vdev *vdev;
+ (void)probe_group;
+
vdev = sdi->priv;
switch (id) {
return SR_OK;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
-
(void)sdi;
+ (void)probe_group;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
sr_dev_open(sdi);
sr_session_dev_add(sdi);
sdi->driver->config_set(SR_CONF_SESSIONFILE,
- g_variant_new_string(filename), sdi);
+ g_variant_new_string(filename), sdi, NULL);
sdi->driver->config_set(SR_CONF_CAPTUREFILE,
- g_variant_new_string(val), sdi);
+ g_variant_new_string(val), sdi, NULL);
g_ptr_array_add(capturefiles, val);
} else if (!strcmp(keys[j], "samplerate")) {
sr_parse_sizestring(val, &tmp_u64);
sdi->driver->config_set(SR_CONF_SAMPLERATE,
- g_variant_new_uint64(tmp_u64), sdi);
+ g_variant_new_uint64(tmp_u64), sdi, NULL);
} else if (!strcmp(keys[j], "unitsize")) {
tmp_u64 = strtoull(val, NULL, 10);
sdi->driver->config_set(SR_CONF_CAPTURE_UNITSIZE,
- g_variant_new_uint64(tmp_u64), sdi);
+ g_variant_new_uint64(tmp_u64), sdi, NULL);
} else if (!strcmp(keys[j], "total probes")) {
total_probes = strtoull(val, NULL, 10);
sdi->driver->config_set(SR_CONF_CAPTURE_NUM_PROBES,
- g_variant_new_uint64(total_probes), sdi);
+ g_variant_new_uint64(total_probes), sdi, NULL);
for (p = 0; p < total_probes; p++) {
snprintf(probename, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);
if (!(probe = sr_probe_new(p, SR_PROBE_LOGIC, TRUE,
fprintf(meta, "unitsize = %d\n", unitsize);
fprintf(meta, "total probes = %d\n", g_slist_length(sdi->probes));
if (sr_dev_has_option(sdi, SR_CONF_SAMPLERATE)) {
- if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
- &gvar, sdi) == SR_OK) {
+ if (sr_config_get(sdi->driver, sdi, NULL,
+ SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
samplerate = g_variant_get_uint64(gvar);
s = sr_samplerate_string(samplerate);
fprintf(meta, "samplerate = %s\n", s);
return NULL;
}
- if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE, &gvar, sdi) != SR_OK) {
+ if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE,
+ &gvar, sdi, NULL) != SR_OK) {
sr_err("%s: Device doesn't support any triggers.", __func__);
return NULL;
}