IOUSBDeviceInterface650

Type Alias IOUSBDeviceInterface650 

Source
pub type IOUSBDeviceInterface650 = IOUSBDeviceStruct650;
Available on crate features IOUSBLib and usb and AppleUSBDefinitions and USB and libc only.
Expand description

The object you use to access USB devices from user space, returned by the IOUSBFamily version 650.4.0 and above.

The functions listed here include all of the functions defined for IOUSBDeviceInterface500, and some new functions that are available on Mac OS X version 10.9 and later. Super: IOUSBDeviceInterface500

See also Apple’s documentation

Aliased Type§

#[repr(C)]
pub struct IOUSBDeviceInterface650 {
Show 49 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>, pub USBDeviceReEnumerate: Option<unsafe extern "C-unwind" fn(*mut c_void, u32) -> i32>, pub GetBusMicroFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> i32>, pub GetIOUSBLibVersion: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32, *mut u32) -> i32>, pub GetBusFrameNumberWithTime: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> i32>, pub GetUSBDeviceInformation: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>, pub RequestExtraPower: Option<unsafe extern "C-unwind" fn(*mut c_void, u32, u32, *mut u32) -> i32>, pub ReturnExtraPower: Option<unsafe extern "C-unwind" fn(*mut c_void, u32, u32) -> i32>, pub GetExtraPowerAllocated: Option<unsafe extern "C-unwind" fn(*mut c_void, u32, *mut u32) -> i32>, pub GetBandwidthAvailableForDevice: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>, pub SetConfigurationV2: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, bool, bool) -> i32>, pub RegisterForNotification: Option<unsafe extern "C-unwind" fn(*mut c_void, u64, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void, *mut c_void)>, *mut c_void, *mut u64) -> i32>, pub UnregisterNotification: Option<unsafe extern "C-unwind" fn(*mut c_void, u64) -> i32>, pub AcknowledgeNotification: Option<unsafe extern "C-unwind" fn(*mut c_void, u64) -> 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>§DeviceRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO) -> i32>§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>§USBDeviceSuspend: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> i32>§USBDeviceAbortPipeZero: Option<unsafe extern "C-unwind" fn(*mut c_void) -> i32>§USBGetManufacturerStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§USBGetProductStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§USBGetSerialNumberStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> i32>§USBDeviceReEnumerate: Option<unsafe extern "C-unwind" fn(*mut c_void, u32) -> i32>§GetBusMicroFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> i32>§GetIOUSBLibVersion: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32, *mut u32) -> i32>§GetBusFrameNumberWithTime: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> i32>§GetUSBDeviceInformation: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§RequestExtraPower: Option<unsafe extern "C-unwind" fn(*mut c_void, u32, u32, *mut u32) -> i32>§ReturnExtraPower: Option<unsafe extern "C-unwind" fn(*mut c_void, u32, u32) -> i32>§GetExtraPowerAllocated: Option<unsafe extern "C-unwind" fn(*mut c_void, u32, *mut u32) -> i32>§GetBandwidthAvailableForDevice: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> i32>§SetConfigurationV2: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, bool, bool) -> i32>

Sets the configuration in the device.

Note that setting the configuration causes any existing IOUSBInterface objects attached to the IOUSBDevice to be destroyed, and all of the interfaces in the new configuration to be instantiated as new IOUSBInterface objects. The device must be open to use this function.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter configNum: The value of the desired configuration (from IOUSBConfigurationDescriptor.bConfigurationValue)

Parameter startInterfaceMatching: true if IOUSBFamily should call IOKit to match the IOUSBInterface nubs. If false is set, the client needs to either (1) have the “com.apple.vm.device-access” entitlement and have the IOUSBDevice authorized via the IOKit’s IOServiceAuthorize() API or (1) have root privileges.

Parameter issueRemoteWakeup: true if IOUSBFamily should send the command to enable remote wakeup in the device

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.

§RegisterForNotification: Option<unsafe extern "C-unwind" fn(*mut c_void, u64, Option<unsafe extern "C-unwind" fn(*mut c_void, i32, *mut c_void, *mut c_void)>, *mut c_void, *mut u64) -> i32>

Registers a callback routine to be invoked when certain events occur in the kernel.

The callback function will be called, for example when the underlying IOUSBDevice is going to be suspended due to some kind of kernel activity. It will also be called when the underlying IOUSBDevice is resumed. Availability: This function is only available with IOUSBDeviceInterface650 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter notificationMask: Specifies the desired type of notification

Parameter callback: An IOAsyncCallback2 method. Upon completion, the arg0 argument of the AsyncCallback2 will contain the notification type, and arg1 will contain a notificationToken which should be used when calling AcknowledgeNotification

Parameter refCon: Arbitrary pointer which is passed as a parameter to the callback routine.

Parameter pRegistrationToken: A pointer to a UInt64 which will contain a registration token if the function is successful. This registration token can then later be used to call UnregisterNotification.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

§UnregisterNotification: Option<unsafe extern "C-unwind" fn(*mut c_void, u64) -> i32>

Unregisters a previously registered callback routine

The callback routine will no longer be invoked when events occur Availability: This function is only available with IOUSBDeviceInterface650 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter registrationToken: The registration token which was obtained in the call to RegisterForNotification

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

§AcknowledgeNotification: Option<unsafe extern "C-unwind" fn(*mut c_void, u64) -> i32>

Acknowledges a notification event

Some events in the kernel will wait for an acknowledgement from all interested parties before proceeding. For example, if an IOUSBDevice is about to be suspended, any User Code which has registered to receive that event will be notified and should acknowledge the notification when it is ready for the IOUSBDevice to be suspended. Availability: This function is only available with IOUSBDeviceInterface650 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter notificationToken: The notification token which was passed in to the callback routine

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.