Skip to content

Commit

Permalink
Merge branch 'timeout' of http://github.com/herm/pyvisa-py into herm-…
Browse files Browse the repository at this point in the history
…timeout
  • Loading branch information
hgrecco committed Aug 22, 2016
2 parents 23e5f5e + 194bc9d commit 7d6f750
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pyvisa-py/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ def get_low_level_info(cls):

return 'via PyUSB (%s). Backend: %s' % (ver, backend)

@property
def timeout(self):
value = self.interface.timeout

if value is None:
return constants.VI_TMO_INFINITE
elif value == 0:
return constants.VI_TMO_IMMEDIATE
else:
return value

@timeout.setter
def timeout(self, value):
if value == constants.VI_TMO_INFINITE:
value = None
elif value == constants.VI_TMO_IMMEDIATE:
value = 0
self.interface.timeout = value

def read(self, count):
"""Reads data from device or interface synchronously.
Expand Down

0 comments on commit 7d6f750

Please sign in to comment.