]> sigrok.org Git - sigrok-test.git/commitdiff
runtc: optionally send EOF to decoder session
authorGerhard Sittig <redacted>
Sun, 26 Dec 2021 06:49:50 +0000 (07:49 +0100)
committerGerhard Sittig <redacted>
Sun, 26 Dec 2021 12:51:24 +0000 (13:51 +0100)
Communicate EOF to the decoder session (when the library supports it).

decoder/runtc.c

index 90c37b64b76746ed7391b8ae20c90c0703b3310e..896935bfc81d02909a78ffb5d3e310786459661a 100644 (file)
@@ -17,6 +17,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
+
 #include <Python.h>
 #include <libsigrokdecode/libsigrokdecode.h>
 #include <libsigrok/libsigrok.h>
@@ -366,6 +368,9 @@ static void sr_cb(const struct sr_dev_inst *sdi,
                break;
        case SR_DF_END:
                DBG("Received SR_DF_END");
+#if defined HAVE_SRD_SESSION_SEND_EOF && HAVE_SRD_SESSION_SEND_EOF
+               (void)srd_session_send_eof(sess);
+#endif
                break;
        }