pub type IOUSBInterfaceInterface182 = IOUSBInterfaceStruct182;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.8.2 and above.
The functions listed here include all of the functions defined for the IOUSBInterfaceInterface and some new functions that are available on Mac OS X version 10.0.4 and later. Super: IOUSBInterfaceInterface
See also Apple’s documentation
Aliased Type§
pub struct IOUSBInterfaceInterface182 {Show 43 fields
pub QueryInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, CFUUIDBytes, *mut *mut c_void) -> i32>,
pub AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>,
pub Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>,
pub CreateInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> i32>,
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 u32) -> i32>,
pub GetInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>,
pub USBInterfaceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub USBInterfaceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub GetInterfaceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetInterfaceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetInterfaceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>,
pub GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>,
pub GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>,
pub GetConfigurationValue: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetInterfaceNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetAlternateSetting: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetNumEndpoints: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>,
pub GetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>,
pub SetAlternateInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>,
pub GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> i32>,
pub ControlRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest) -> i32>,
pub ControlRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub GetPipeProperties: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut u8, *mut u8, *mut u8, *mut u16, *mut u8) -> i32>,
pub GetPipeStatus: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>,
pub AbortPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>,
pub ResetPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>,
pub ClearPipeStall: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>,
pub ReadPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32) -> i32>,
pub WritePipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32) -> i32>,
pub ReadPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub WritePipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub ReadIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub WriteIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub ControlRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO) -> i32>,
pub ControlRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub ReadPipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32, u32, u32) -> i32>,
pub WritePipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32) -> i32>,
pub ReadPipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub WritePipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub USBInterfaceGetStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
/* private fields */
}Fields§
§QueryInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, CFUUIDBytes, *mut *mut c_void) -> i32>§AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>§Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>§CreateInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> i32>§GetInterfaceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>§CreateInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§GetInterfaceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>§USBInterfaceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>§USBInterfaceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>§GetInterfaceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetInterfaceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetInterfaceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>§GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>§GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>§GetConfigurationValue: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetInterfaceNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetAlternateSetting: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetNumEndpoints: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§GetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§SetAlternateInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>§GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> i32>§ControlRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest) -> i32>§ControlRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequest, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>§GetPipeProperties: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut u8, *mut u8, *mut u8, *mut u16, *mut u8) -> i32>§GetPipeStatus: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>§AbortPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>§ResetPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>§ClearPipeStall: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>§ReadPipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32) -> i32>§WritePipe: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32) -> i32>§ReadPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>§WritePipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>§ReadIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>§WriteIsochPipeAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u64, u32, *mut IOUSBIsocFrame, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>§ControlRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO) -> i32>Sends a USB request on a control pipe.
The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. If the request is a standard request which will change the state of the device, the device must be open, which means you should be using the IOUSBDeviceInterface for this command. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index of the control pipe to use. Use zero for the default control pipe on the device.
Parameter req: Pointer to an IOUSBDevRequestTO containing the request.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnAborted if the thread is interrupted before the call completes, kIOReturnNotOpen if the interface is not open for exclusive access.
ControlRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBDevRequestTO, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>Sends an asynchronous USB request on a control pipe.
The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. Use pipeRef=0 for the default device control pipe. If the request is a standard request which will change the state of the device, the device must be open, which means you should be using the IOUSBDeviceInterface for this command. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index of the control pipe to use. Use zero for the default control pipe on the device.
Parameter req: Pointer to an IOUSBDevRequestTO containing the request.
Parameter callback: An IOAsyncCallback1 method. Upon completion, the arg0 argument of the AsyncCallback1 will contain the number of bytes that were actually transferred. A message addressed to this callback is posted to the Async
port upon completion.
Parameter refCon: Arbitrary pointer which is passed as a parameter to the callback routine.
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.
ReadPipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, *mut u32, u32, u32) -> i32>Performs a read on a BULK IN pipe, specifying timeout values.
The interface must be open for the pipe to exist.
If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See
//apple_ref/C/instm/IOUSBInterfaceInterface/ClearPipeStall/ ClearPipeStallor
//apple_ref/C/instm/IOUSBInterfaceInterface190/ClearPipeStallBothEnds/ ClearPipeStallBothEnds.
Timeouts do not apply to interrupt pipes, so you should use the ReadPipe API to perform a read from an interrupt pipe. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Parameter buf: Buffer to hold the data.
Parameter size: Pointer to the size of the buffer pointed to by buf.
Parameter noDataTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if no
data is transferred in this amount of time, the request will be aborted and returned.
Parameter completionTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if
the entire request is not completed in this amount of time, the request will be aborted and returned.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access. Returns kIOReturnBadArgument if timeout values are specified for an interrupt pipe. If an error is returned, the size parameter is not updated and the buffer will NOT contain any valid data.
WritePipeTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32) -> i32>Performs a write on a BULK OUT pipe, with specified timeout values.
The interface must be open for the pipe to exist.
If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See
//apple_ref/C/instm/IOUSBInterfaceInterface/ClearPipeStall/ ClearPipeStallor
//apple_ref/C/instm/IOUSBInterfaceInterface190/ClearPipeStallBothEnds/ ClearPipeStallBothEnds. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Parameter buf: Buffer to hold the data.
Parameter size: The size of the buffer pointed to by buf.
Parameter noDataTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if no
data is transferred in this amount of time, the request will be aborted and returned.
Parameter completionTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if
the entire request is not completed in this amount of time, the request will be aborted and returned.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access.
ReadPipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>Performs an asynchronous read on a BULK IN pipe, with specified timeout values.
The interface must be open for the pipe to exist.
If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See
//apple_ref/C/instm/IOUSBInterfaceInterface/ClearPipeStall/ ClearPipeStallor
//apple_ref/C/instm/IOUSBInterfaceInterface190/ClearPipeStallBothEnds/ ClearPipeStallBothEnds.
Timeouts do not apply to interrupt pipes, so you should use the ReadPipeAsync API to perform an asynchronous read from an interrupt pipe. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Parameter buf: Buffer to hold the data.
Parameter size: The size of the buffer pointed to by buf.
Parameter noDataTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if no
data is transferred in this amount of time, the request will be aborted and returned.
Parameter completionTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if
the entire request is not completed in this amount of time, the request will be aborted and returned.
Parameter callback: An IOAsyncCallback1 method. Upon completion, the arg0 argument of the AsyncCallback1 will contain the number of bytes that were actually read. A message addressed to this callback is posted to the Async port
upon completion.
Parameter refcon: Arbitrary pointer which is passed as a parameter to the callback routine.
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. Returns kIOReturnBadArgument if timeout values are specified for an interrupt pipe. If an error is returned, the size parameter is not updated and the buffer will NOT contain any valid data.
WritePipeAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut c_void, u32, u32, u32, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>Performs an asynchronous write on a BULK OUT pipe, with specified timeout values.
The interface must be open for the pipe to exist.
If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See
//apple_ref/C/instm/IOUSBInterfaceInterface/ClearPipeStall/ ClearPipeStallor
//apple_ref/C/instm/IOUSBInterfaceInterface190/ClearPipeStallBothEnds/ ClearPipeStallBothEnds. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Parameter buf: Buffer to hold the data.
Parameter size: The size of the buffer pointed to by buf.
Parameter noDataTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if no
data is transferred in this amount of time, the request will be aborted and returned.
Parameter completionTimeout: Specifies a time value in milliseconds. Once the request is queued on the bus, if
the entire request is not completed in this amount of time, the request will be aborted and returned.
Parameter callback: An IOAsyncCallback1 method. Upon completion, the arg0 argument of the AsyncCallback1 will contain the number of bytes that were actually written. A message addressed to this callback is posted to the Async port
upon completion.
Parameter refcon: Arbitrary pointer which is passed as a parameter to the callback routine.
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.
USBInterfaceGetStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>Returns the string index in the interface descriptor.
The interface does not have to be open to use this function. Availability: This function is only available with IOUSBInterfaceInterface182 and above.
Parameter self: Pointer to the IOUSBInterfaceInterface.
Parameter si: Pointer to UInt8 to hold the string index.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.