static const uint32_t devopts[] = {
SR_CONF_LOGIC_ANALYZER,
- SR_CONF_SAMPLERATE,
- SR_CONF_TRIGGER_MATCH,
- SR_CONF_CAPTURE_RATIO,
- SR_CONF_LIMIT_SAMPLES,
- SR_CONF_PATTERN_MODE,
- SR_CONF_EXTERNAL_CLOCK,
- SR_CONF_SWAP,
- SR_CONF_RLE,
+ SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
+ SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_PATTERN_MODE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_EXTERNAL_CLOCK | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_SWAP | SR_CONF_SET,
+ SR_CONF_RLE | SR_CONF_GET | SR_CONF_SET,
};
static const int32_t trigger_matches[] = {
devices = NULL;
/* Allocate memory for our private device context. */
- if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
- sr_err("Device context malloc failed.");
- goto err_free_nothing;
- }
+ devc = g_malloc0(sizeof(struct dev_context));
/* Device-specific settings */
devc->max_samplebytes = devc->max_samplerate = devc->protocol_version = 0;
/* Parse the metadata. */
sdi = p_ols_get_metadata((uint8_t *)buf, bytes_read, devc);
- sdi->index = 0;
/* Configure samplerate and divider. */
if (p_ols_set_samplerate(sdi, DEFAULT_SAMPLERATE) != SR_OK)
g_free(devc->ftdi_buf);
err_free_devc:
g_free(devc);
-err_free_nothing:
return NULL;
}