Add OS string descriptor to the DeviceDescriptorCollection. The byte after MSFT100 defines the request value (bMS_VendorCode) for retrieving the OS descriptors:
Then add the request handler to the control endpoint:
msft_descriptors = MicrosoftOS10DescriptorCollection()
with msft_descriptors.ExtendedCompatIDDescriptor() as c:
with c.Function() as f:
f.bFirstInterfaceNumber = 0
f.compatibleID = 'WINUSB'
control_ep.add_request_handler(MicrosoftOS10RequestHandler(msft_descriptors, request_code=0xee))
NOTE: If LUNA complains about non-contiguous descriptors, you can pass avoid_blockram=True to the standard request handler as a temporary fix:
This PR adds a request handler for Microsoft OS 1.0 descriptors.
https://github.com/greatscottgadgets/python-usb-protocol/pull/41
Usage for a single interface:
Add OS string descriptor to the
DeviceDescriptorCollection
. The byte afterMSFT100
defines the request value (bMS_VendorCode
) for retrieving the OS descriptors:Then add the request handler to the control endpoint:
NOTE: If LUNA complains about non-contiguous descriptors, you can pass
avoid_blockram=True
to the standard request handler as a temporary fix: