summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--glucometerutils/support/hiddevice.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/glucometerutils/support/hiddevice.py b/glucometerutils/support/hiddevice.py
index b360841..a1af95a 100644
--- a/glucometerutils/support/hiddevice.py
+++ b/glucometerutils/support/hiddevice.py
@@ -30,11 +30,18 @@ class HidDevice(object):
If the VID/PID pair is not provided, the driver will require a device path
to be used.
+
+ Optional parameters available:
+
+ TIMEOUT_MS: (int, default: 1000) the read timeout in milliseconds, used
+ for hidapi reads only.
"""
USB_VENDOR_ID = None
USB_PRODUCT_ID = None
+ TIMEOUT_MS = 1000
+
def __init__(self, device):
if None in (self.USB_VENDOR_ID, self.USB_PRODUCT_ID) and not device:
raise exceptions.CommandLineError(
@@ -81,4 +88,4 @@ class HidDevice(object):
if self.handle_mode_ == 'hidraw':
return self.handle_.read(size)
else:
- return bytes(self.handle_.read(size, timeout_ms=1000))
+ return bytes(self.handle_.read(size, timeout_ms=self.TIMEOUT_MS))