pub type IOUSBDeviceInterface182 = IOUSBDeviceStruct182;AppleUSBDefinitions and IOUSBLib and USB and libc only.Expand description
The object you use to access USB devices 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 IOUSBDeviceInterface and some new functions that are available on Mac OS X version 10.0.4 and later. Super: IOUSBDeviceInterface
See also Apple’s documentation
Aliased Type§
pub struct IOUSBDeviceInterface182 {Show 36 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 CreateDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> i32>,
pub GetDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>,
pub CreateDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>,
pub GetDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>,
pub USBDeviceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub USBDeviceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub GetDeviceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetDeviceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetDeviceProtocol: 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 GetDeviceAddress: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>,
pub GetDeviceBusPowerAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>,
pub GetDeviceSpeed: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub GetNumberOfConfigurations: 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 GetConfigurationDescriptorPtr: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut *mut IOUSBConfigurationDescriptor) -> i32>,
pub GetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub SetConfiguration: 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 ResetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub DeviceRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest) -> i32>,
pub DeviceRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub CreateInterfaceIterator: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBFindInterfaceRequest, *mut u32) -> i32>,
pub USBDeviceOpenSeize: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub DeviceRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO) -> i32>,
pub DeviceRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>,
pub USBDeviceSuspend: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>,
pub USBDeviceAbortPipeZero: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>,
pub USBGetManufacturerStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub USBGetProductStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>,
pub USBGetSerialNumberStringIndex: 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>§CreateDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> i32>§GetDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>§CreateDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§GetDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> u32>§USBDeviceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>§USBDeviceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>§GetDeviceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetDeviceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetDeviceProtocol: 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>§GetDeviceAddress: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> i32>§GetDeviceBusPowerAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§GetDeviceSpeed: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§GetNumberOfConfigurations: 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>§GetConfigurationDescriptorPtr: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut *mut IOUSBConfigurationDescriptor) -> i32>§GetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§SetConfiguration: 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>§ResetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>§DeviceRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest) -> i32>§DeviceRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void)>, *mut c_void) -> i32>§CreateInterfaceIterator: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBFindInterfaceRequest, *mut u32) -> i32>§USBDeviceOpenSeize: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>Opens the IOUSBDevice for exclusive access.
This function opens the IOUSBDevice for exclusive access. If another client has the device opened, an attempt is made to get that client to close it before returning. Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes an exclusive link between the client’s task and the actual device. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Returns: Returns kIOReturnExclusiveAccess if some other task has the device opened already and refuses to close it, kIOReturnError if the connection with the kernel can not be established or kIOReturnSuccess if successful.
DeviceRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO) -> i32>Sends a USB request on the default control pipe.
The device does not have to be open to use this function, but standard requests that change the state of the device may require that the device is opened first. This function sends a USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request.
Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter req: Pointer to an IOUSBDevRequestTO containing the request.
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 device is not open for exclusive access.
DeviceRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *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 the default control pipe.
The device does not have to be open to use this function, but standard requests that change the state of the device may require that the device is opened first. This function sends an asynchronous USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
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
in the DeviceRequest. 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, kIOReturnNotOpen if the device is not open for exclusive access, orkIOUSBNoAsyncPortErr if no Async port has been created for this interface.
USBDeviceSuspend: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>Tells the USB Family to either suspend or resume the port to which a device is attached.
The device must be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter suspend: TRUE to cause the port to be suspended, FALSE to cause it to be resumed.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.
USBDeviceAbortPipeZero: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>Aborts a transaction on the default control pipe.
The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.
USBGetManufacturerStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>Returns the manufacturer string index in the device descriptor.
The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter msi: Pointer to UInt8 to hold the string index.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
USBGetProductStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>Returns the product string index in the device descriptor.
The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter psi: Pointer to UInt8 to hold the string index.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
USBGetSerialNumberStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>Returns the serial number string index in the device descriptor.
The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter snsi: Pointer to UInt8 to hold the string index.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.