pub struct IOUSBInterfaceStruct190 {Show 48 fields
pub QueryInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, REFIID, *mut LPVOID) -> HRESULT>,
pub AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>,
pub Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>,
pub CreateInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> IOReturn>,
pub GetInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>,
pub CreateInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut mach_port_t) -> IOReturn>,
pub GetInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> mach_port_t>,
pub USBInterfaceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>,
pub USBInterfaceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>,
pub GetInterfaceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetInterfaceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetInterfaceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>,
pub GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>,
pub GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>,
pub GetConfigurationValue: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetInterfaceNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetAlternateSetting: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetNumEndpoints: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>,
pub GetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut io_service_t) -> IOReturn>,
pub SetAlternateInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>,
pub GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> IOReturn>,
pub ControlRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest) -> IOReturn>,
pub ControlRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub GetPipeProperties: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut u8, *mut u8, *mut u8, *mut u16, *mut u8) -> IOReturn>,
pub GetPipeStatus: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>,
pub AbortPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>,
pub ResetPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>,
pub ClearPipeStall: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>,
pub ReadPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32) -> IOReturn>,
pub WritePipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32) -> IOReturn>,
pub ReadPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub WritePipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub ReadIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub WriteIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub ControlRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO) -> IOReturn>,
pub ControlRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub ReadPipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32, u32, u32) -> IOReturn>,
pub WritePipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32) -> IOReturn>,
pub ReadPipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub WritePipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub USBInterfaceGetStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub USBInterfaceOpenSeize: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>,
pub ClearPipeStallBothEnds: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>,
pub SetPipePolicy: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, u16, u8) -> IOReturn>,
pub GetBandwidthAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>,
pub GetEndpointProperties: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, u8, u8, *mut u8, *mut u16, *mut u8) -> IOReturn>,
/* private fields */
}IOUSBLib and USB and libc only.Expand description
The object you use to access a USB device interface from user space, returned by the IOUSBFamily version 1.9 and above.
The functions listed here include all of the functions defined for the IOUSBInterfaceInterface, IOUSBInterfaceInterface182, IOUSBInterfaceInterface183, and some new functions that are available on Mac OS X version 10.2 and later. Super: IOUSBInterfaceInterface183
See also Apple’s documentation
Fields§
§QueryInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, REFIID, *mut LPVOID) -> HRESULT>§AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>§Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>§CreateInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> IOReturn>§GetInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>§CreateInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut mach_port_t) -> IOReturn>§GetInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> mach_port_t>§USBInterfaceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>§USBInterfaceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>§GetInterfaceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetInterfaceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetInterfaceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>§GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>§GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>§GetConfigurationValue: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetInterfaceNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetAlternateSetting: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetNumEndpoints: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>§GetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut io_service_t) -> IOReturn>§SetAlternateInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>§GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> IOReturn>§ControlRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest) -> IOReturn>§ControlRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest, IOAsyncCallback1, *mut c_void) -> IOReturn>§GetPipeProperties: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut u8, *mut u8, *mut u8, *mut u16, *mut u8) -> IOReturn>§GetPipeStatus: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>§AbortPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>§ResetPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>§ClearPipeStall: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>§ReadPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32) -> IOReturn>§WritePipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32) -> IOReturn>§ReadPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>§WritePipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>§ReadIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, IOAsyncCallback1, *mut c_void) -> IOReturn>§WriteIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, IOAsyncCallback1, *mut c_void) -> IOReturn>§ControlRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO) -> IOReturn>§ControlRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO, IOAsyncCallback1, *mut c_void) -> IOReturn>§ReadPipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32, u32, u32) -> IOReturn>§WritePipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32) -> IOReturn>§ReadPipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>§WritePipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, IOAsyncCallback1, *mut c_void) -> IOReturn>§USBInterfaceGetStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§USBInterfaceOpenSeize: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>§ClearPipeStallBothEnds: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>Equivalent to ClearPipeStall.
This function is equivalent to ClearPipeStall except that it also attempts to clear the halt and toggle bits on the device’s endpoint for the pipe by sending a ClearFeature(ENDPOINT_HALT) to the default control pipe in the device, specifying the endpoint for the pipe represented by pipeRef. For most devices, this resynchronizes the data toggle between the two endpoints to ensure that there is no loss of data. Availability: This function is only available with IOUSBInterfaceInterface190 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access.
SetPipePolicy: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, u16, u8) -> IOReturn>Changes the amount of bandwidth of an isochronous pipe or interrupt pipe, or the polling interval of an interrupt pipe.
A pipe may be made smaller or larger (up to the maxPacketSize specified in the endpoint descriptor). When an interface is first opened, all pipes are created with their descriptor-supplied maxPacketSize. For isochronous or interrupt pipes, if there is not enough bandwidth on the bus to allocate to the pipe, the pipe is created with a reserved bandwidth of zero. Any attempts to transfer data on a pipe with zero bandwidth will result in a kIOReturnNoBandwidth error. The pipe must first be given some bandwidth using this call. This can also be used to return bandwidth for an isochronous or an interrupt pipe. If the driver knows that the device will not be sending the maxPacketSize data, it can use this call to return that unused bandwidth to the system. If an interrupt pipe wants to change the polling interval, it can do so with this call.
The interface must be open for the pipe to exist. Availability: This function is only available with IOUSBInterfaceInterface190 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Parameter maxPacketSize: The desired size for the isochronous or interrupt pipe. For Full Speed endpoints and High Speed endpoints which
are not High Bandwidth (i.e. only a single packet is transferred in a microframe), valid values are 0 through the maxPacketSize
defined in the endpoint descriptor. For High Speed High Bandwidth (i.e. 2 or 3 packets transferred in a microframe) and Super Speed endpoints,
valid values are 0 and the maxPacketSize of the endpoint. The maxPacketSize of the endpoint is calculated as the base maxPacketSize
multiplies by the burst size and the multiplier. See the USB 2.0 and the USB 3.0 specifications for more detail. Using a value of 0 for maxPacketSize
maintains the handle for the pipe but unreserves any bandwidth on the bus.
Parameter maxInterval: applies only to interrupt endpoints. maxInterval has the same value as the bInterval field of the endpoint.
For Low Speed and Full Speed interrupt endpoints, it is the desired polling interval in milliseconds, up to a maximum of 128 ms.
The system can only poll devices powers of 2 (1, 2, 4, 8, 16, 32, 64, or 128 ms).
For High Speed and Super Speed endpoints, maxInterval is used as an exponent for a (2 ^ (maxInterval-1)) value representing the number
of 125uS microframes between service intervals. See the USB 2.0 and the USB 3.0 specifications for more info. The lower layers may
schedule the endpoint for service at an interval value equal to or less than the value specified. A value of 0 is illegal.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. May also return kIOReturnNoBandwidth if there is not enough bandwidth available on the bus, or kIOReturnBadArgument if the desired maxPacketSize is outside of the allowed range.
GetBandwidthAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>Returns the amount of bandwidth available on the bus for allocation to isochronous pipes. If the device is a high speed device, it will be the number of bytes per microframe (125 �secs). If it is a full speed device, it will be the number of bytes per frame (1ms)
This function is useful for determining the correct AltInterface setting as well as for using SetPipePolicy.
The interface does not have to be open to use this function. Availability: This function is only available with IOUSBInterfaceInterface190 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter bandwidth: Pointer to UInt32 to hold the amount of bandwidth available (in bytes per 1ms frame).
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetEndpointProperties: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, u8, u8, *mut u8, *mut u16, *mut u8) -> IOReturn>Returns the transfer type, max packet size, and interval of a specified endpoint, whether or not the endpoint has a pipe currently established.
This function may be useful for determining which alternate interface to select when trying to balance bandwidth allocations among isochronous pipes.
The interface does not have to be open to use this function. Availability: This function is only available with IOUSBInterfaceInterface190 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter alternateSetting: Specifies the alternate setting within the current interface.
Parameter endpointNumber: Specifies the desired endpoint number.
Parameter direction: Specifies the desired direction.
Parameter transferType: Pointer to UInt8 to hold the endpoint’s transfer type (kUSBControl, kUSBIsoc, etc).
Parameter maxPacketSize: Pointer to UInt16 to hold the maxPacketSize of the endpoint.
Parameter interval: Pointer to UInt8 to hold the polling interval for interrupt endpoints.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
Trait Implementations§
Source§impl Clone for IOUSBInterfaceStruct190
Available on crate feature usb only.
impl Clone for IOUSBInterfaceStruct190
usb only.Source§fn clone(&self) -> IOUSBInterfaceStruct190
fn clone(&self) -> IOUSBInterfaceStruct190
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IOUSBInterfaceStruct190
Available on crate feature usb only.
impl Debug for IOUSBInterfaceStruct190
usb only.Source§impl Encode for IOUSBInterfaceStruct190
Available on crate features usb and objc2 only.
impl Encode for IOUSBInterfaceStruct190
usb and objc2 only.Source§impl PartialEq for IOUSBInterfaceStruct190
Available on crate feature usb only.
impl PartialEq for IOUSBInterfaceStruct190
usb only.Source§impl RefEncode for IOUSBInterfaceStruct190
Available on crate features usb and objc2 only.
impl RefEncode for IOUSBInterfaceStruct190
usb and objc2 only.Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
impl Copy for IOUSBInterfaceStruct190
usb only.impl StructuralPartialEq for IOUSBInterfaceStruct190
usb only.