Browse Source

Move descriptor_type argument to avoid API breakage

hid
Josh Koike 4 years ago
parent
commit
45b7a894fa
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      usb_protocol/emitters/descriptors/hid.py
  2. +2
    -2
      usb_protocol/emitters/descriptors/standard.py

+ 1
- 1
usb_protocol/emitters/descriptors/hid.py View File

@@ -106,4 +106,4 @@ class HIDDescriptor(ComplexDescriptorEmitter):
report_descriptor = b"".join(report_descriptor)
descriptor_len = len(report_descriptor)
self.wDescriptorLength = descriptor_len
self._parent_descriptor.add_descriptor(report_descriptor, 0x22)
self._parent_descriptor.add_descriptor(report_descriptor, descriptor_type=0x22)

+ 2
- 2
usb_protocol/emitters/descriptors/standard.py View File

@@ -177,14 +177,14 @@ class DeviceDescriptorCollection:
return index


def add_descriptor(self, descriptor, descriptor_type=None, index=0):
def add_descriptor(self, descriptor, index=0, descriptor_type=None):
""" Adds a descriptor to our collection.

Parameters:
descriptor -- The descriptor to be added.
index -- The index of the relevant descriptor. Defaults to 0.
descriptor_type -- The type of the descriptor to be added. If `None`,
this is automatically derived from the descriptor contents.
index -- The index of the relevant descriptor. Defaults to 0.
"""

# If this is an emitter rather than a descriptor itself, convert it.


Loading…
Cancel
Save