From: Soeren Apel Date: Mon, 2 May 2016 16:01:10 +0000 (+0200) Subject: Input/binary: Add reset() function X-Git-Tag: libsigrok-0.5.0~436 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3781b65d19747526b52df97510866683f36dd67a;p=libsigrok.git Input/binary: Add reset() function --- diff --git a/src/input/binary.c b/src/input/binary.c index 51b9f6bf..e693f581 100644 --- a/src/input/binary.c +++ b/src/input/binary.c @@ -142,6 +142,16 @@ static int end(struct sr_input *in) 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; +} + static struct sr_option options[] = { { "numchannels", "Number of channels", "Number of channels", NULL, NULL }, { "samplerate", "Sample rate", "Sample rate", NULL, NULL }, @@ -167,4 +177,5 @@ SR_PRIV struct sr_input_module input_binary = { .init = init, .receive = receive, .end = end, + .reset = reset, };