Catch pyserial writeTimeoutErrors
@@ -87,7 +87,11 @@ class PySerialDriver(BaseDriver):
"""
try:
return self.handle.write(s)
- except (OSError, serial.SerialException):
+ except (OSError, serial.SerialException, serial.writeTimeoutError) as e:
+ if e == serial.writeTimeoutError:
+ print "sbp pyserial_driver: writeTimeoutError"
+ return 0
+ else:
print
print "Piksi disconnected"
print
