Fixed testutils
This commit is contained in:
parent
38e7d7bb1e
commit
ff507c6ef7
|
@ -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 "
|
||||||
|
|
Loading…
Reference in New Issue