Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/sbp/client/drivers/cdc_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ def _read(self, size):
print()
print("Piksi disconnected")
print()
self.close()
raise IOError
return return_val
except OSError:
print()
print("Piksi disconnected")
print()
self.close()
raise IOError

def _write(self, s):
Expand All @@ -62,6 +64,7 @@ def _write(self, s):
print()
print("Piksi disconnected")
print()
self.close()
raise IOError

def close(self):
Expand Down
6 changes: 3 additions & 3 deletions python/sbp/client/drivers/pyserial_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, port, baud=115200, rtscts=False):
try:
handle = serial.serial_for_url(port)
handle.baudrate = baud
handle.timeout = 1
handle.timeout = None
handle.rtscts = rtscts
super(PySerialDriver, self).__init__(handle)
except (OSError, serial.SerialException) as e:
Expand Down Expand Up @@ -81,7 +81,7 @@ def _read(self, size):
print()
print("Piksi disconnected")
print()
self.handle.close()
self.close()
raise IOError

def _write(self, s):
Expand All @@ -104,7 +104,7 @@ def _write(self, s):
print()
print("Piksi disconnected")
print()
self.handle.close()
self.close()
raise IOError

def __enter__(self):
Expand Down