Input/raw_analog: Add reset() function

This commit is contained in:
Soeren Apel 2016-05-02 18:16:09 +02:00 committed by Uwe Hermann
parent ad93bfb0b9
commit 4c55ea47a7
1 changed files with 12 additions and 0 deletions

View File

@ -267,6 +267,17 @@ static void cleanup(struct sr_input *in)
in->priv = NULL;
}
static int reset(struct sr_input *in)
{
struct context *inc = in->priv;
cleanup(in);
inc->started = FALSE;
g_string_truncate(in->buf, 0);
return SR_OK;
}
SR_PRIV struct sr_input_module input_raw_analog = {
.id = "raw_analog",
.name = "RAW analog",
@ -277,4 +288,5 @@ SR_PRIV struct sr_input_module input_raw_analog = {
.receive = receive,
.end = end,
.cleanup = cleanup,
.reset = reset,
};