struct sr_config *src;
int offset, chunk_samples, total_samples, processed, max_chunk_samples;
int num_samples, i;
- char channelname[8];
inc = in->priv;
if (!inc->started) {
- for (i = 0; i < inc->num_channels; i++) {
- snprintf(channelname, 8, "CH%d", i + 1);
- sr_channel_new(in->sdi, i, SR_CHANNEL_ANALOG, TRUE, channelname);
- }
-
std_session_send_df_header(in->sdi, LOG_PREFIX);
packet.type = SR_DF_META;
{
struct context *inc;
int ret;
+ char channelname[8];
g_string_append_len(in->buf, buf->str, buf->len);
else if (ret != SR_OK)
return ret;
+ for (int i = 0; i < inc->num_channels; i++) {
+ snprintf(channelname, 8, "CH%d", i + 1);
+ sr_channel_new(in->sdi, i, SR_CHANNEL_ANALOG, TRUE, channelname);
+ }
+
/* sdi is ready, notify frontend. */
in->sdi_ready = TRUE;
return SR_OK;
static int end(struct sr_input *in)
{
- struct sr_datafeed_packet packet;
struct context *inc;
int ret;
ret = SR_OK;
inc = in->priv;
- if (inc->started) {
- packet.type = SR_DF_END;
- sr_session_send(in->sdi, &packet);
- }
+ if (inc->started)
+ std_session_send_df_end(in->sdi, LOG_PREFIX);
return ret;
}
+static int reset(struct sr_input *in)
+{
+ struct context *inc = in->priv;
+
+ inc->started = FALSE;
+ g_string_truncate(in->buf, 0);
+
+ return SR_OK;
+}
+
SR_PRIV struct sr_input_module input_wav = {
.id = "wav",
.name = "WAV",
.init = init,
.receive = receive,
.end = end,
+ .reset = reset,
};