pub struct IOUSBDeviceStruct100 {Show 28 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 CreateDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> IOReturn>,
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 mach_port_t) -> IOReturn>,
pub GetDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> mach_port_t>,
pub USBDeviceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>,
pub USBDeviceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>,
pub GetDeviceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetDeviceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetDeviceProtocol: 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 GetDeviceAddress: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut USBDeviceAddress) -> IOReturn>,
pub GetDeviceBusPowerAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>,
pub GetDeviceSpeed: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub GetNumberOfConfigurations: 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 GetConfigurationDescriptorPtr: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBConfigurationDescriptorPtr) -> IOReturn>,
pub GetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>,
pub SetConfiguration: 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 ResetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>,
pub DeviceRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest) -> IOReturn>,
pub DeviceRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest, IOAsyncCallback1, *mut c_void) -> IOReturn>,
pub CreateInterfaceIterator: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBFindInterfaceRequest, *mut io_iterator_t) -> IOReturn>,
/* private fields */
}AppleUSBDefinitions and IOUSBLib and USB and libc only.Expand description
The object you use to access USB devices from user space, returned by all versions of the IOUSBFamily currently shipping.
The functions listed here will work with any version of the IOUSBDeviceInterface, including the one shipped with Mac OS X version 10.0.
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>§CreateDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> IOReturn>Creates a run loop source for delivery of all asynchronous notifications on this device.
The Mac OS X kernel does not spawn a thread to callback to the client. Instead it delivers completion notifications (see
//apple_ref/C/instm/IOUSBInterfaceInterface/CreateInterfaceAsyncPort/ CreateInterfaceAsyncPort). This routine wraps that port with the appropriate routing code so that the completion notifications can be automatically routed through the client’s CFRunLoop.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter source: Pointer to a CFRunLoopSourceRef to return the newly created run loop event source.
Returns: Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
GetDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>Returns the CFRunLoopSourceRef for this IOService instance.
Parameter self: Pointer to the IOUSBDeviceInterface.
Returns: Returns the run loop source if one has been created, 0 otherwise.
CreateDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut mach_port_t) -> IOReturn>Creates and registers a mach_port_t for asynchronous communications.
The Mac OS X kernel does not spawn a thread to callback to the client. Instead it delivers completion notifications on this mach port. After receiving a message on this port the client is obliged to call the IOKitLib.h IODispatchCalloutFromMessage() function for decoding the notification message.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter port: Pointer to a mach_port_t to return the newly created port.
Returns: Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
GetDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> mach_port_t>Returns the mach_port_t port for this IOService instance.
Parameter self: Pointer to the IOUSBDeviceInterface.
Returns: Returns the port if one exists, 0 otherwise.
USBDeviceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>Opens the IOUSBDevice for exclusive access.
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.
Parameter self: Pointer to the IOUSBDeviceInterface.
Returns: Returns kIOReturnExclusiveAccess if some other task has the device opened already, kIOReturnError if the connection with the kernel cannot be established or kIOReturnSuccess if successful.
USBDeviceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>Closes the task’s connection to the IOUSBDevice.
Releases the client’s exclusive access to the IOUSBDevice.
Parameter self: Pointer to the IOUSBDeviceInterface.
Returns: Returns kIOReturnSuccess if successful, some other mach error if the connection is no longer valid.
GetDeviceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>Returns the USB Class (bDeviceClass) of the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devClass: Pointer to UInt8 to hold the device Class.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>Returns the USB Subclass (bDeviceSubClass) of the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devSubClass: Pointer to UInt8 to hold the device Subclass.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>Returns the USB Protocol (bDeviceProtocol) of the interface.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devProtocol: Pointer to UInt8 to hold the device Protocol.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>Returns the USB Vendor ID (idVendor) of the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devVendor: Pointer to UInt16 to hold the vendorID.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>Returns the USB Product ID (idProduct) of the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devProduct: Pointer to UInt16 to hold the ProductID.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>Returns the Device Release Number (bcdDevice) of the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devRelNum: Pointer to UInt16 to hold the Device Release Number.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceAddress: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut USBDeviceAddress) -> IOReturn>Returns the address of the device on its bus.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter addr: Pointer to USBDeviceAddress to hold the result.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceBusPowerAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>Returns the power available to the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter powerAvailable: Pointer to UInt32 to hold the power available (in 2 mA increments).
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetDeviceSpeed: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>Returns the speed of the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter devSpeed: Pointer to UInt8 to hold the speed (kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, or kUSBDeviceSpeedSuper).
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetNumberOfConfigurations: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>Returns the number of supported configurations in this device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter numConfig: Pointer to UInt8 to hold the number of configurations.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>Returns the location ID.
The location ID is a 32 bit number which is unique among all USB devices in the system, and which will not change on a system reboot unless the topology of the bus itself changes. The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter locationID: Pointer to UInt32 to hold the location ID.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetConfigurationDescriptorPtr: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBConfigurationDescriptorPtr) -> IOReturn>Returns a pointer to a configuration descriptor for a given index.
Note that this will point to the data as received from the USB bus and hence will be in USB bus order (i.e. little endian). The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter configIndex: The index (zero based) of the desired config descriptor.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
GetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>Returns the currently selected configuration in the device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter configNum: Pointer to UInt8 to hold the configuration value.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
SetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>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).
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.
GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> IOReturn>Gets the current frame number of the bus to which the device is attached.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter frame: Pointer to UInt64 to hold the frame number.
Parameter atTime: Pointer to a returned AbsoluteTime, which is the system time (“wall time”) when the frame number register was read. This
system time could be the time at the beginning, middle, or end of the given frame.
Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
ResetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>Tells the IOUSBFamily to issue a reset to the device.
It will not reenumerate the device, which means that the cached device descriptor values will not be updated after the reset. (If you want the IOUSBFamily to reload the cached values, use the call USBDeviceReEnumerate). Prior to version 1.8.5 of the IOUSBFamily, this call also sent a message to all clients of the IOUSBDevice (IOUSBInterfaces and their drivers). The device must be open to use this function.
This behavior was eliminated in version 1.8.5 of the IOUSBFamily.
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.
DeviceRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest) -> IOReturn>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.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter req: Pointer to an IOUSBDevRequest 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.
DeviceRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest, IOAsyncCallback1, *mut c_void) -> IOReturn>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.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter req: Pointer to an IOUSBDevRequest 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, kIOReturnNotOpen if the device is not open for exclusive access, or kIOUSBNoAsyncPortErr if no Async port has been created for this interface.
CreateInterfaceIterator: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBFindInterfaceRequest, *mut io_iterator_t) -> IOReturn>Creates an iterator to iterate over some or all of the interfaces of a device.
The device does not have to be open to use this function.
Parameter self: Pointer to the IOUSBDeviceInterface.
Parameter req: Pointer an IOUSBFindInterfaceRequest structure describing the desired interfaces.
Parameter iter: Pointer to a an io_iterator_t to contain the new iterator.
Returns: Returns kIOReturnSuccess if successful or kIOReturnNoDevice if there is no connection to an IOService.
Trait Implementations§
Source§impl Clone for IOUSBDeviceStruct100
Available on crate feature usb only.
impl Clone for IOUSBDeviceStruct100
usb only.Source§fn clone(&self) -> IOUSBDeviceStruct100
fn clone(&self) -> IOUSBDeviceStruct100
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IOUSBDeviceStruct100
Available on crate feature usb only.
impl Debug for IOUSBDeviceStruct100
usb only.Source§impl Encode for IOUSBDeviceStruct100
Available on crate features usb and objc2 only.
impl Encode for IOUSBDeviceStruct100
usb and objc2 only.Source§impl PartialEq for IOUSBDeviceStruct100
Available on crate feature usb only.
impl PartialEq for IOUSBDeviceStruct100
usb only.Source§impl RefEncode for IOUSBDeviceStruct100
Available on crate features usb and objc2 only.
impl RefEncode for IOUSBDeviceStruct100
usb and objc2 only.Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
impl Copy for IOUSBDeviceStruct100
usb only.impl StructuralPartialEq for IOUSBDeviceStruct100
usb only.