Skip to content

Commit

Permalink
Remove max_length parameter from get_report_descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
ldkv committed Nov 21, 2024
1 parent 4fc7443 commit e2705b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 3 additions & 7 deletions hid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,8 @@ cdef class device:
result = hid_send_feature_report(c_hid, cbuff, c_buff_len)
return result

def get_report_descriptor(self, int max_length=4096):
"""Return the report descriptor up to max_length bytes.
If max_length is bigger than the actual descriptor, the full descriptor will be returned.
:param max_length: Maximum number of bytes to read, must be positive
:type max_length: int
def get_report_descriptor(self):
"""Return the report descriptor of the device.
:return:
:rtype: List[int]
Expand All @@ -346,7 +342,7 @@ cdef class device:
raise ValueError('not open')

cdef unsigned char* cbuff
cdef size_t c_descriptor_length = max(1, max_length)
cdef size_t c_descriptor_length = 4096
cdef hid_device * c_hid = self._c_hid
cdef int n
result = []
Expand Down
1 change: 1 addition & 0 deletions try.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
print("Manufacturer: %s" % h.get_manufacturer_string())
print("Product: %s" % h.get_product_string())
print("Serial No: %s" % h.get_serial_number_string())
print("Report descriptor: %s" % h.get_report_descriptor())

# enable non-blocking mode
h.set_nonblocking(1)
Expand Down

0 comments on commit e2705b9

Please sign in to comment.