- int ret, err, probenum, devcnt, i, j;
+ int ret, probenum, devcnt, i, j;
uint64_t tmp_u64, total_probes, enabled_probes, p;
char **sections, **keys, *metafile, *val, c;
char probename[SR_MAX_PROBENAME_LEN + 1];
uint64_t tmp_u64, total_probes, enabled_probes, p;
char **sections, **keys, *metafile, *val, c;
char probename[SR_MAX_PROBENAME_LEN + 1];
enabled_probes = 0;
keys = g_key_file_get_keys(kf, sections[i], NULL, NULL);
for (j = 0; keys[j]; j++) {
val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
if (!strcmp(keys[j], "capturefile")) {
enabled_probes = 0;
keys = g_key_file_get_keys(kf, sections[i], NULL, NULL);
for (j = 0; keys[j]; j++) {
val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
if (!strcmp(keys[j], "capturefile")) {
- dev = sr_dev_new(&session_driver, devcnt);
+ sdi = sr_dev_inst_new(devcnt, SR_ST_ACTIVE, NULL, NULL, NULL);
+ sdi->driver = &session_driver;
- /* first device, init the plugin */
- dev->plugin->init((char *)filename);
- sr_session_dev_add(dev);
- dev->plugin->config_set(devcnt, SR_HWCAP_CAPTUREFILE, val);
+ /* first device, init the driver */
+ sdi->driver->init();
+ sr_session_dev_add(sdi);
+ sdi->driver->dev_config_set(sdi, SR_HWCAP_SESSIONFILE, filename);
+ sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTUREFILE, val);
g_ptr_array_add(capturefiles, val);
} else if (!strcmp(keys[j], "samplerate")) {
sr_parse_sizestring(val, &tmp_u64);
g_ptr_array_add(capturefiles, val);
} else if (!strcmp(keys[j], "samplerate")) {
sr_parse_sizestring(val, &tmp_u64);
} else if (!strcmp(keys[j], "unitsize")) {
tmp_u64 = strtoull(val, NULL, 10);
} else if (!strcmp(keys[j], "unitsize")) {
tmp_u64 = strtoull(val, NULL, 10);
} else if (!strcmp(keys[j], "total probes")) {
total_probes = strtoull(val, NULL, 10);
} else if (!strcmp(keys[j], "total probes")) {
total_probes = strtoull(val, NULL, 10);
for (p = 0; p < total_probes; p++) {
snprintf(probename, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);
for (p = 0; p < total_probes; p++) {
snprintf(probename, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);
- sr_dev_probe_add(dev, probename);
+ if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
+ probename)))
+ return SR_ERR;
+ sdi->probes = g_slist_append(sdi->probes, probe);
} else if (!strncmp(keys[j], "trigger", 7)) {
probenum = strtoul(keys[j]+7, NULL, 10);
} else if (!strncmp(keys[j], "trigger", 7)) {
probenum = strtoul(keys[j]+7, NULL, 10);
- for (p = enabled_probes; p < total_probes; p++) {
- probe = g_slist_nth_data(dev->probes, p);
- probe->enabled = FALSE;
- }
+ for (p = enabled_probes; p < total_probes; p++)
+ sr_dev_probe_enable(sdi, p, FALSE);
- int bufcnt, devcnt, tmpfile, ret, error, probecnt;
+ int bufcnt, devcnt, tmpfile, ret, probecnt;
uint64_t samplerate;
char version[1], rawname[16], metafile[32], *buf, *s;
uint64_t samplerate;
char version[1], rawname[16], metafile[32], *buf, *s;
fprintf(meta, "unitsize = %d\n", ds->ds_unitsize);
fprintf(meta, "total probes = %d\n", g_slist_length(dev->probes));
if (sr_dev_has_hwcap(dev, SR_HWCAP_SAMPLERATE)) {
fprintf(meta, "unitsize = %d\n", ds->ds_unitsize);
fprintf(meta, "total probes = %d\n", g_slist_length(dev->probes));
if (sr_dev_has_hwcap(dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) dev->plugin->dev_info_get(
- dev->plugin_index, SR_DI_CUR_SAMPLERATE));
+ samplerate = *((uint64_t *) dev->driver->dev_info_get(
+ dev->driver_index, SR_DI_CUR_SAMPLERATE));
s = sr_samplerate_string(samplerate);
fprintf(meta, "samplerate = %s\n", s);
g_free(s);
s = sr_samplerate_string(samplerate);
fprintf(meta, "samplerate = %s\n", s);
g_free(s);