pub struct Config<'d> {
pub subclass: u8,
pub protocol: u8,
pub interface_name: Option<&'d str>,
pub msos_interface_guids: Option<&'d [&'d str]>,
pub webusb: bool,
pub webusb_landing_url: Option<Url<'d>>,
pub webusb_vendor_code: u8,
pub out_endpoint_options: EndpointOptions,
pub in_endpoint_options: EndpointOptions,
}Expand description
Configuration for the Vendor class.
Fields§
§subclass: u8Vendor subclass code (default: 0x00).
protocol: u8Vendor protocol code (default: 0x00).
interface_name: Option<&'d str>Optional interface string description.
msos_interface_guids: Option<&'d [&'d str]>Optional Microsoft OS 2.0 WinUSB Device Interface GUIDs.
When specified, Microsoft OS 2.0 descriptors are automatically generated with
Compatible ID “WINUSB” and the provided GUIDs. Windows 8.1+ will automatically
load winusb.sys without an INF file or manual driver installation.
Example: &["{CDB3B5AD-293B-4663-AA36-1AAE46463776}"]
webusb: boolWhether WebUSB platform capability should be registered.
webusb_landing_url: Option<Url<'d>>Optional WebUSB URL landing page.
webusb_vendor_code: u8WebUSB vendor request code (default: 0x01).
out_endpoint_options: EndpointOptionsOptions for the bulk OUT endpoint, which receives the data the host sends.
in_endpoint_options: EndpointOptionsOptions for the bulk IN endpoint, which sends data to the host.
Implementations§
Source§impl<'d> Config<'d>
impl<'d> Config<'d>
Sourcepub const fn with_interface_name(self, name: &'d str) -> Self
pub const fn with_interface_name(self, name: &'d str) -> Self
Set the interface string description.
Sourcepub const fn with_winusb(self, guids: &'d [&'d str]) -> Self
pub const fn with_winusb(self, guids: &'d [&'d str]) -> Self
Set Microsoft OS 2.0 WinUSB device interface GUIDs.
Sourcepub const fn with_webusb(
self,
landing_url: Option<Url<'d>>,
vendor_code: u8,
) -> Self
pub const fn with_webusb( self, landing_url: Option<Url<'d>>, vendor_code: u8, ) -> Self
Enable WebUSB platform capability with an optional landing URL and vendor request code.
Sourcepub const fn with_subclass_protocol(self, subclass: u8, protocol: u8) -> Self
pub const fn with_subclass_protocol(self, subclass: u8, protocol: u8) -> Self
Set custom subclass and protocol codes.