MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / sr_config_get

Function sr_config_get

libsigrok4DSL/hwdriver.c:219–241  ·  view source on GitHub ↗

* Returns information about the given driver or device instance. * * @param driver The sr_dev_driver struct to query. * @param key The configuration key (SR_CONF_*). * @param data Pointer to a GVariant where the value will be stored. Must * not be NULL. The caller is given ownership of the GVariant * and must thus decrease the refcount after use. However if *

Source from the content-addressed store, hash-verified

217 * as an indication that it's not applicable.
218 */
219SR_PRIV int sr_config_get(const struct sr_dev_driver *driver,
220 const struct sr_dev_inst *sdi,
221 const struct sr_channel *ch,
222 const struct sr_channel_group *cg,
223 int key, GVariant **data)
224{
225 int ret;
226
227 if (!driver || !data)
228 return SR_ERR;
229
230 if (!driver->config_get)
231 return SR_ERR_ARG;
232
233 if ((ret = driver->config_get(key, data, sdi, ch, cg)) == SR_OK) {
234 /* Got a floating reference from the driver. Sink it here,
235 * caller will need to unref when done with it. */
236 assert(*data);
237 g_variant_ref_sink(*data);
238 }
239
240 return ret;
241}
242
243/**
244 * Set a configuration key in a device instance.

Callers 4

create_archiveFunction · 0.85
gen_headerFunction · 0.85
gen_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected