Fixed testutils

This commit is contained in:
Sebastian 2016-12-26 23:29:23 +01:00
parent 38e7d7bb1e
commit ff507c6ef7
1 changed files with 4 additions and 1 deletions

View File

@ -20,9 +20,11 @@ def main():
sys.exit(-1) sys.exit(-1)
ser = serial.Serial(sys.argv[1], 9600, timeout=0.40) ser = serial.Serial(sys.argv[1], 9600, timeout=0.40)
ser.reset_input_buffer()
data = ""
while True: while True:
data = ser.read(19)
while data == "": while data == "":
data = ser.read(19) data = ser.read(19)
@ -33,6 +35,7 @@ def main():
header_ok = data.startswith(chr(0xAA) + chr(0xFE)) header_ok = data.startswith(chr(0xAA) + chr(0xFE))
line = "" line = ""
if header_ok: if header_ok:
line += "Header Ok " line += "Header Ok "