From: Soeren Apel Date: Mon, 2 May 2016 16:16:21 +0000 (+0200) Subject: Input/trace32_ad: Add reset() function X-Git-Tag: libsigrok-0.5.0~432 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=87616181f9e9854a80e26f207bffdb9032178af9;p=libsigrok.git Input/trace32_ad: Add reset() function --- diff --git a/src/input/trace32_ad.c b/src/input/trace32_ad.c index 4ac06cf5..802110fb 100644 --- a/src/input/trace32_ad.c +++ b/src/input/trace32_ad.c @@ -748,6 +748,21 @@ static int end(struct sr_input *in) return ret; } +static int reset(struct sr_input *in) +{ + struct context *inc = in->priv; + + inc->meta_sent = FALSE; + inc->header_read = FALSE; + inc->records_read = FALSE; + inc->trigger_sent = FALSE; + inc->cur_record = 0; + + g_string_truncate(in->buf, 0); + + return SR_OK; +} + static struct sr_option options[] = { { "podA", "Import pod A / iprobe", "Create channels and data for pod A / iprobe", NULL, NULL }, @@ -797,4 +812,5 @@ SR_PRIV struct sr_input_module input_trace32_ad = { .init = init, .receive = receive, .end = end, + .reset = reset, };