extern struct UsbWwidDevicePath [src]
Fields
type: DevicePath.Type
subtype: Subtype
length: u16 align(1)
interface_number: u16 align(1)
device_vendor_id: u16 align(1)
device_product_id: u16 align(1)
Members
- serial_number (Function)
Source
pub const UsbWwidDevicePath = extern struct {
type: DevicePath.Type,
subtype: Subtype,
length: u16 align(1),
interface_number: u16 align(1),
device_vendor_id: u16 align(1),
device_product_id: u16 align(1),
pub fn serial_number(self: *const UsbWwidDevicePath) []align(1) const u16 {
const serial_len = (self.length - @sizeOf(UsbWwidDevicePath)) / @sizeOf(u16);
return @as([*]align(1) const u16, @ptrCast(@as([*]const u8, @ptrCast(self)) + @sizeOf(UsbWwidDevicePath)))[0..serial_len];
}
}