From b6995f276320e6c9e6d146f265138debdcfda0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 29 Jan 2019 00:01:14 +0000 Subject: hiddevice: fix support for modern hidapi. The value of None is not valid for current hidapi implementation, but anything below 0 is considered no timeout. Fixes issue #50. --- glucometerutils/support/hiddevice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glucometerutils/support/hiddevice.py b/glucometerutils/support/hiddevice.py index 12debf8..b746514 100644 --- a/glucometerutils/support/hiddevice.py +++ b/glucometerutils/support/hiddevice.py @@ -38,14 +38,14 @@ class HidDevice: Optional parameters available: - TIMEOUT_MS: (int, default: None) the read timeout in milliseconds, used - for hidapi reads only. If -1, hidapi will be provided no timeout. + TIMEOUT_MS: (int, default: 0) the read timeout in milliseconds, used + for hidapi reads only. If < 1, hidapi will be provided no timeout. """ USB_VENDOR_ID = None # type: int USB_PRODUCT_ID = None # type: int - TIMEOUT_MS = None # type: Optional[int] + TIMEOUT_MS = 0 # type: int def __init__(self, device): # type: (Optional[Text]) -> None -- cgit v1.2.3