parent
6a1968beff
commit
155e2f8c40
|
@ -260,9 +260,17 @@ def write(device_handle, data):
|
||||||
assert device_handle
|
assert device_handle
|
||||||
assert data
|
assert data
|
||||||
assert isinstance(data, bytes), (repr(data), type(data))
|
assert isinstance(data, bytes), (repr(data), type(data))
|
||||||
bytes_written = _os.write(device_handle, data)
|
retrycount = 0
|
||||||
if bytes_written != len(data):
|
while(True and retrycount < 3):
|
||||||
raise IOError(_errno.EIO, 'written %d bytes out of expected %d' % (bytes_written, len(data)))
|
try:
|
||||||
|
bytes_written = _os.write(device_handle, data)
|
||||||
|
if bytes_written != len(data):
|
||||||
|
raise IOError(_errno.EIO, 'written %d bytes out of expected %d' % (bytes_written, len(data)))
|
||||||
|
except IOError as e:
|
||||||
|
if e.errno != _errno.EPIPE:
|
||||||
|
raise e
|
||||||
|
retrycount += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
def read(device_handle, bytes_count, timeout_ms=-1):
|
def read(device_handle, bytes_count, timeout_ms=-1):
|
||||||
|
|
|
@ -345,7 +345,7 @@ class Receiver(object):
|
||||||
self.serial = 0
|
self.serial = 0
|
||||||
self.max_devices = 6
|
self.max_devices = 6
|
||||||
|
|
||||||
if self.product_id == 'c539' or slef.product_id == 'c53a':
|
if self.product_id == 'c539' or self.product_id == 'c53a':
|
||||||
self.name = 'Lightspeed Receiver'
|
self.name = 'Lightspeed Receiver'
|
||||||
elif self.max_devices == 6:
|
elif self.max_devices == 6:
|
||||||
self.name = 'Unifying Receiver'
|
self.name = 'Unifying Receiver'
|
||||||
|
|
Loading…
Reference in New Issue