]> sigrok.org Git - libsigrok.git/blobdiff - src/input/input.c
input: Add sr_input_end().
[libsigrok.git] / src / input / input.c
index 287fcede93c2fa12295fb9eb41d1e8dbccec2636..43b49d3f381a99caead2fe9eb5d5b96905bcce8a 100644 (file)
@@ -529,6 +529,20 @@ SR_API int sr_input_send(const struct sr_input *in, GString *buf)
        return in->module->receive((struct sr_input *)in, buf);
 }
 
+/**
+ * Signal the input module no more data will come.
+ *
+ * This will cause the module to process any data it may have buffered.
+ * The SR_DF_END packet will also typically be sent at this time.
+ *
+ * @since 0.4.0
+ */
+SR_API int sr_input_end(const struct sr_input *in)
+{
+       sr_spew("Calling end() on %s module.", in->module->id);
+       return in->module->end((struct sr_input *)in);
+}
+
 /**
  * Free the specified input instance and all associated resources.
  *