From 38752d457743389eaf324bf2c21257ac69d85914 Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Mon, 2 Feb 2015 01:54:56 +0100 Subject: [PATCH] fix(note_validator): Restart the timeout if there is activity Otherwise it might trigger a timeout while a bill is currently processed. Closes #9 --- fnordload/note_validator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fnordload/note_validator.py b/fnordload/note_validator.py index 3d3ff0f..bba0880 100644 --- a/fnordload/note_validator.py +++ b/fnordload/note_validator.py @@ -81,6 +81,10 @@ def read_note(self, timeout = 30, message_callback = lambda x: None): elif (len(poll) > 1 and poll[0] == '0xf0'): self._logger.warning(str(poll)) + if len(poll) > 1: + # The bill acceptor is not idle. Restart the timeout + t0 = time.time() + with self._essp_lock: self._eSSP.disable()