summaryrefslogtreecommitdiff
path: root/decoders/i2s/pd.py
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2021-12-26 07:42:27 +0100
committerGerhard Sittig <gerhard.sittig@gmx.net>2021-12-26 13:45:09 +0100
commit819e508972da02a0dcff7f81178f0283546a9afd (patch)
tree5a48cb02cf7b712e2d152e547b7fab6ab969c8dd /decoders/i2s/pd.py
parent487890c822762d9886dfd022ed599c9909ceaab9 (diff)
downloadlibsigrokdecode-819e508972da02a0dcff7f81178f0283546a9afd.tar.gz
libsigrokdecode-819e508972da02a0dcff7f81178f0283546a9afd.zip
session: introduce the public "send EOF" API routine
Introduce the public srd_session_send_eof() routine which is backed by the internal srd_inst_send_eof() helper. Applications can tell decoders when the input stream of sample data is exhausted, so that decoders can optionally "flush" their previously accumulated information when desired. Previous implementations just kept decoders in blocking .wait() calls and somehow terminated them at arbitrary times afterwards. When EOF is sent to the decoder session, then calls to the .wait() method which typically are done from .decode() or its descendents will end with an EOFError Python exception. Termination of .decode() with the EOFError exception is non-fatal for backwards compatibility and to keep the convenience for current decoder implementations. Decoders can either catch the exception, or use context managers, or do nothing. This API extension is motivated by research for bug #1581 and provides the infrastructure to address bug #292. Decoders need to remain careful, and should not claim that protocol activities would have completed when their end condition was not even seen in the capture. Marking incomplete activities with warnings is the most appropriate reaction.
Diffstat (limited to 'decoders/i2s/pd.py')
0 files changed, 0 insertions, 0 deletions