Commit d75091d5 authored by cermak's avatar cermak
Browse files

Add delay

Change-Id: I90b88fe45840eba0604d1ab4834a7a5df4740da9
parent 67e04eda
......@@ -21,6 +21,7 @@
# Petr Cermak <cermak@mag.mff.cuni.cz>
#
# *****************************************************************************
from time import sleep
from entangle import base
from entangle.core import Attr, Cmd, Prop, intrange, subdev, listof, \
......@@ -34,6 +35,12 @@ class StringIO(SerialStringIO):
def Communicate(self, msg):
self.WriteLine(msg)
for i in range(100):
if self.availableLines:
break
sleep(0.05)
else:
raise CommunicationFailure(f"no response in 5s")
firstline = self.ReadLine()
if firstline != msg:
raise CommunicationFailure(f"command not repeated {firstline}!={msg}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment