You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while (JOB_START_TOKEN_RESPONSEnotinresponse) and (count<300):
25
+
response=ser.readline().decode().strip()
26
+
print(f"INFO: [{port}] response : {response}")
27
+
count+=1
28
+
29
+
ifJOB_START_TOKEN_RESPONSEnotinresponse:
30
+
print(f"ERROR: Did not get proper response from job after sending job start token to port {port}. Expected was {JOB_START_TOKEN_RESPONSE}, received '{response}' !\n")
31
+
return_code=1
32
+
ser.close()
33
+
break
34
+
ser.close()
35
+
exceptExceptionase:
36
+
print(f"ERROR: Exception for port {port}: {e}")
37
+
return_code=1
38
+
break
39
+
40
+
returnreturn_code
41
+
42
+
if__name__=="__main__":
43
+
"""
44
+
Example usage:
45
+
python sync_ports.py /dev/ttyUSB0 /dev/ttyUSB1
46
+
This will send the JOB_START_TOKEN to each listed serial port and wait for the response.
0 commit comments