#include "libsigrok.h"
#include "libsigrok-internal.h"
+/** @cond PRIVATE */
#define LOG_PREFIX "session-file"
+/** @endcond */
/**
* @file
struct zip_stat zs;
struct sr_dev_inst *sdi;
struct sr_channel *ch;
- int ret, channelnum, devcnt, i, j;
+ int devcnt, ret, i, j;
uint64_t tmp_u64, total_channels, enabled_channels, p;
char **sections, **keys, *metafile, *val;
char channelname[SR_MAX_CHANNELNAME_LEN + 1];
enabled_channels++;
tmp_u64 = strtoul(keys[j]+5, NULL, 10);
/* sr_session_save() */
- sr_dev_probe_name_set(sdi, tmp_u64 - 1, val);
- } else if (!strncmp(keys[j], "trigger", 7)) {
- channelnum = strtoul(keys[j]+7, NULL, 10);
- sr_dev_trigger_set(sdi, channelnum, val);
+ sr_dev_channel_name_set(sdi, tmp_u64 - 1, val);
}
}
g_strfreev(keys);
/* Disable channels not specifically listed. */
if (total_channels)
for (p = enabled_channels; p < total_channels; p++)
- sr_dev_probe_enable(sdi, p, FALSE);
+ sr_dev_channel_enable(sdi, p, FALSE);
}
devcnt++;
}
* @retval SR_OK Success
* @retval SR_ERR_ARG Invalid arguments
* @retval SR_ERR Other errors
+ *
+ * @since 0.2.0
*/
SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
unsigned char *buf, int unitsize, int units)
* @retval SR_OK Success
* @retval SR_ERR_ARG Invalid arguments
* @retval SR_ERR Other errors
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_save_init(const char *filename, uint64_t samplerate,
char **channels)
* @retval SR_OK Success
* @retval SR_ERR_ARG Invalid arguments
* @retval SR_ERR Other errors
+ *
+ * @since 0.3.0
*/
SR_API int sr_session_append(const char *filename, unsigned char *buf,
int unitsize, int units)