runtc: optionally send EOF to decoder session
[sigrok-test.git] / 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;
        }