X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=session.c;h=ad084074889deee4367928d6b20d504fa15343ad;hp=23e19b84bb9b1091d1e58e406c49bbef90c8e525;hb=42d4d65c3d34ae9bfa74c40fafd1ca657d05a91b;hpb=755e4a1e70ef3de760ecdf4db67f3b2a75458143 diff --git a/session.c b/session.c index 23e19b8..ad08407 100644 --- a/session.c +++ b/session.c @@ -278,6 +278,32 @@ SRD_API int srd_session_send(struct srd_session *sess, return SRD_OK; } +/** + * Communicate the end of the stream of sample data to the session. + * + * @param[in] sess The session. Must not be NULL. + * + * @return SRD_OK upon success. A (negative) error code otherwise. + * + * @since 0.6.0 + */ +SRD_API int srd_session_send_eof(struct srd_session *sess) +{ + GSList *d; + int ret; + + if (!sess) + return SRD_ERR_ARG; + + for (d = sess->di_list; d; d = d->next) { + ret = srd_inst_send_eof(d->data); + if (ret != SRD_OK) + return ret; + } + + return SRD_OK; +} + /** * Terminate currently executing decoders in a session, reset internal state. * @@ -298,7 +324,7 @@ SRD_API int srd_session_send(struct srd_session *sess, * * @return SRD_OK upon success, a (negative) error code otherwise. * - * @since 0.6.0 + * @since 0.5.1 */ SRD_API int srd_session_terminate_reset(struct srd_session *sess) {