X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=session.c;h=ad084074889deee4367928d6b20d504fa15343ad;hb=24ba9e1bdfe107e394176eda3116b714463a8437;hp=73fdc080b11e5107fc20f71b228bed887303b259;hpb=5c723a57ebf09047b0fad0adab0f99c20e1b7d99;p=libsigrokdecode.git diff --git a/session.c b/session.c index 73fdc08..ad08407 100644 --- a/session.c +++ b/session.c @@ -70,7 +70,7 @@ SRD_API int srd_session_new(struct srd_session **sess) /* Keep a list of all sessions, so we can clean up as needed. */ sessions = g_slist_append(sessions, *sess); - srd_dbg("Created session %d.", (*sess)->session_id); + srd_dbg("Creating session %d.", (*sess)->session_id); return SRD_OK; } @@ -96,9 +96,9 @@ SRD_API int srd_session_start(struct srd_session *sess) if (!sess) return SRD_ERR_ARG; - srd_dbg("Calling start() on all instances in session %d.", sess->session_id); + srd_dbg("Calling start() of all instances in session %d.", sess->session_id); - /* Run the start() method on all decoders receiving frontend data. */ + /* Run the start() method of all decoders receiving frontend data. */ ret = SRD_OK; for (d = sess->di_list; d; d = d->next) { di = d->data; @@ -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) {