zip_fclose(zf);
s[ret] = 0;
version = strtoull(s, NULL, 10);
- if (version != 1) {
+ if (version > 2) {
sr_dbg("Cannot handle sigrok session file version %d.", version);
return SR_ERR;
}
+ sr_spew("Detected sigrok session file version %d.", version);
/* read "metadata" */
if (zip_stat(archive, "metadata", 0, &zs) == -1) {
cnt = 0;
for (l = sdi->probes; l; l = l->next) {
probe = l->data;
- if (probe->enabled) {
- if (probe->name)
- /* Just borrowing the ptr. */
- probe_names[cnt++] = probe->name;
- }
+ if (probe->type != SR_PROBE_LOGIC)
+ continue;
+ if (probe->enabled != TRUE)
+ continue;
+ if (!probe->name)
+ continue;
+ /* Just borrowing the ptr. */
+ probe_names[cnt++] = probe->name;
}
if ((ret = sr_session_save_init(filename, samplerate, probe_names)) != SR_OK)
return SR_ERR;
/* "version" */
- version[0] = '1';
+ version[0] = '2';
if (!(versrc = zip_source_buffer(zipfile, version, 1, 0)))
return SR_ERR;
if (zip_add(zipfile, "version", versrc) == -1) {