ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference

 


IOUSBDeviceInterface182

Inherits from:

IOUSBDeviceInterface

Declared In:

Overview

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

Discussion

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.



Functions

DeviceRequestAsyncTO

Sends an asynchronous USB request on the default control pipe.

DeviceRequestTO

Sends a USB request on the default control pipe.

USBDeviceAbortPipeZero

Aborts a transaction on the default control pipe.

USBDeviceOpenSeize

Opens the IOUSBDevice for exclusive access.

USBDeviceSuspend

Tells the USB Family to either suspend or resume the port to which a device is attached.

USBGetManufacturerStringIndex

Returns the manufacturer string index in the device descriptor.

USBGetProductStringIndex

Returns the product string index in the device descriptor.

USBGetSerialNumberStringIndex

Returns the serial number string index in the device descriptor.


DeviceRequestAsyncTO


Sends an asynchronous USB request on the default control pipe.

IOReturn ( *DeviceRequestAsyncTO)(
    void *self,
    IOUSBDevRequestTO *req,
    IOAsyncCallback1 callback,
    void *refCon);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

req

Pointer to an IOUSBDevRequestTO containing the request.

callback

An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.

refCon

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

Return Value

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.

Discussion

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. The device must be open to issue this command. Care should be taken when issuing a device request which changes the state of the device. Use the API, for example, to change the configuration of the device or to select an alternate setting on an interface.

Availability
This function is only available with IOUSBDeviceInterface182 and above.

DeviceRequestTO


Sends a USB request on the default control pipe.

IOReturn ( *DeviceRequestTO)(
    void *self,
    IOUSBDevRequestTO *req);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

req

Pointer to an IOUSBDevRequestTO containing the request.

Return Value

Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.

Discussion

This function sends a USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. The device must be open to issue this command. Care should be taken when issuing a device request which changes the state of the device. Use the API, for example, to change the configuration of the device or to select an alternate setting on an interface.

Availability
This function is only available with IOUSBDeviceInterface182 and above.

USBDeviceAbortPipeZero


Aborts a transaction on the default control pipe.

IOReturn ( *USBDeviceAbortPipeZero)(
    void *self);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

Return Value

Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.

Discussion

The device must be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface182 and above.

USBDeviceOpenSeize


Opens the IOUSBDevice for exclusive access.

IOReturn ( *USBDeviceOpenSeize)(
    void *self);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

Return Value

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.

Discussion

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.

USBDeviceSuspend


Tells the USB Family to either suspend or resume the port to which a device is attached.

IOReturn ( *USBDeviceSuspend)(
    void *self,
    Boolean suspend);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

suspend

TRUE to cause the port to be suspended, FALSE to cause it to be resumed.

Return Value

Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.

Discussion

The device must be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface182 and above.

USBGetManufacturerStringIndex


Returns the manufacturer string index in the device descriptor.

IOReturn ( *USBGetManufacturerStringIndex)(
    void *self,
    UInt8 *msi);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

msi

Pointer to UInt8 to hold the string index.

Return Value

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

Discussion

The device does not have to be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface182 and above.

USBGetProductStringIndex


Returns the product string index in the device descriptor.

IOReturn ( *USBGetProductStringIndex)(
    void *self,
    UInt8 *psi);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

psi

Pointer to UInt8 to hold the string index.

Return Value

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

Discussion

The device does not have to be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface182 and above.

USBGetSerialNumberStringIndex


Returns the serial number string index in the device descriptor.

IOReturn ( *USBGetSerialNumberStringIndex)(
    void *self,
    UInt8 *snsi);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

snsi

Pointer to UInt8 to hold the string index.

Return Value

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

Discussion

The device does not have to be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface182 and above.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2009-02-23