Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iocontrol feature #152

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

jcsxdev
Copy link

@jcsxdev jcsxdev commented Jan 16, 2024

This feature only affects the Windows systems. Enabling this feature causes the manufacturer and product fields of the UsbPortInfo structure to provide the same values provided on Unix systems.

Fixes #146.

@jcsxdev
Copy link
Author

jcsxdev commented Jan 17, 2024

#152 (comment)

Fixes cargo test --no-fail-fast --all-features.

@jcsxdev
Copy link
Author

jcsxdev commented Jan 19, 2024

#152 (comment)

The iocontrol module has been refactored:

  • Moved some code from the get_usb_string_descriptor() to the get_descriptor_id();
  • Changed the return of the get_usb_string_descriptor() to Result<String, Error>.

This feature only affects the Windows systems. Enabling this feature
causes the `manufacturer` and `product` fields of the UsbPortInfo
structure to provide the same values provided on Unix systems.
@jcsxdev
Copy link
Author

jcsxdev commented Jan 20, 2024

#152 (comment)

The iocontrol module has been refactored:

  • The get_usb_string_descriptor() associated function has been renamed to get_string_descriptor();
  • Removed unnecessary code from the get_string_descriptor() function related to language ID specification:
    • Now SetupPacket.wIndex is being set to 0 instead of GetSystemDefaultLangID's return;
    • I have not encountered any problems using lpinbuffer.SetupPacket.wIndex = 0. Let me know if anyone finds it necessary to specify the Language ID 1.

Footnotes

  1. See sections Get Descriptor and Strings of the Universal Serial Bus Specification or Universal Serial Bus 3.1 Specification.

@jcsxdev jcsxdev marked this pull request as draft February 8, 2024 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

windows: UsbPortInfo: Provide the same info about Manufacturer and Product name as POSIX
1 participant