hid 1.0.6__tar.gz → 1.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hid-1.0.6/hid.egg-info → hid-1.0.8}/PKG-INFO +1 -1
- {hid-1.0.6 → hid-1.0.8}/hid/__init__.py +11 -1
- {hid-1.0.6 → hid-1.0.8/hid.egg-info}/PKG-INFO +1 -1
- {hid-1.0.6 → hid-1.0.8}/setup.py +1 -1
- {hid-1.0.6 → hid-1.0.8}/LICENSE +0 -0
- {hid-1.0.6 → hid-1.0.8}/MANIFEST.in +0 -0
- {hid-1.0.6 → hid-1.0.8}/README.md +0 -0
- {hid-1.0.6 → hid-1.0.8}/hid.egg-info/SOURCES.txt +0 -0
- {hid-1.0.6 → hid-1.0.8}/hid.egg-info/dependency_links.txt +0 -0
- {hid-1.0.6 → hid-1.0.8}/hid.egg-info/not-zip-safe +0 -0
- {hid-1.0.6 → hid-1.0.8}/hid.egg-info/top_level.txt +0 -0
- {hid-1.0.6 → hid-1.0.8}/setup.cfg +0 -0
|
@@ -130,6 +130,9 @@ hidapi.hid_send_feature_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, cty
|
|
|
130
130
|
hidapi.hid_send_feature_report.restype = ctypes.c_int
|
|
131
131
|
hidapi.hid_get_feature_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
|
|
132
132
|
hidapi.hid_get_feature_report.restype = ctypes.c_int
|
|
133
|
+
if version >= (0, 14, 0):
|
|
134
|
+
hidapi.hid_get_report_descriptor.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
|
|
135
|
+
hidapi.hid_get_report_descriptor.restype = ctypes.c_int
|
|
133
136
|
hidapi.hid_close.argtypes = [ctypes.c_void_p]
|
|
134
137
|
hidapi.hid_close.restype = None
|
|
135
138
|
hidapi.hid_get_manufacturer_string.argtypes = [ctypes.c_void_p, ctypes.c_wchar_p, ctypes.c_size_t]
|
|
@@ -165,7 +168,7 @@ class Device(object):
|
|
|
165
168
|
elif serial:
|
|
166
169
|
serial = ctypes.create_unicode_buffer(serial)
|
|
167
170
|
self.__dev = hidapi.hid_open(vid, pid, serial)
|
|
168
|
-
elif vid and pid:
|
|
171
|
+
elif vid and pid is not None:
|
|
169
172
|
self.__dev = hidapi.hid_open(vid, pid, None)
|
|
170
173
|
else:
|
|
171
174
|
raise ValueError('specify vid/pid or path')
|
|
@@ -233,6 +236,13 @@ class Device(object):
|
|
|
233
236
|
hidapi.hid_get_feature_report, self.__dev, data, size)
|
|
234
237
|
return data.raw[:size]
|
|
235
238
|
|
|
239
|
+
if version >= (0, 14, 0):
|
|
240
|
+
def get_report_descriptor(self, size = 4096):
|
|
241
|
+
data = ctypes.create_string_buffer(size)
|
|
242
|
+
size = self.__hidcall(
|
|
243
|
+
hidapi.hid_get_report_descriptor, self.__dev, data, size)
|
|
244
|
+
return data.raw[:size]
|
|
245
|
+
|
|
236
246
|
def close(self):
|
|
237
247
|
if self.__dev:
|
|
238
248
|
hidapi.hid_close(self.__dev)
|
{hid-1.0.6 → hid-1.0.8}/setup.py
RENAMED
{hid-1.0.6 → hid-1.0.8}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|