Skip to content

Commit

Permalink
core/usb/generic_device: declare one or more interfaces as windows co…
Browse files Browse the repository at this point in the history
…mpatible
  • Loading branch information
povauboin committed Sep 27, 2024
1 parent c57ca24 commit ad9a193
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lambdalib/cores/usb/generic_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,17 @@ def add_microsoft_os_1_0(self, descriptors):

msft_descriptors = MicrosoftOS10DescriptorCollection()

with msft_descriptors.ExtendedCompatIDDescriptor() as c:
with c.Function() as f:
f.bFirstInterfaceNumber = 0
f.compatibleID = "WINUSB"
# When not passed explicitely as an interface list, consider
# just the first interface number 0 as Windows compatible.
if isinstance(self.with_microsoft_os_1_0, bool):
self.with_microsoft_os_1_0 = [0]

for intf in self.with_microsoft_os_1_0:
# Declare all interfaces from the list as Windows compatible
with msft_descriptors.ExtendedCompatIDDescriptor() as c:
with c.Function() as f:
f.bFirstInterfaceNumber = intf
f.compatibleID = "WINUSB"

with msft_descriptors.ExtendedPropertiesDescriptor() as d:
with d.Property() as p:
Expand Down

0 comments on commit ad9a193

Please sign in to comment.