IOUSBDeviceInterface320

Inherits from:
Declared In:

Overview

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

Discussion

The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, IOUSBDeviceInterface187, IOUSBDeviceInterface197, IOUSBDeviceInterface245, or IOUSBDeviceInterface300 and some new functions that are available on Mac OS X version 10.5.4 and later.



Functions

GetExtraPowerAllocated

Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA).

GetUSBDeviceInformation

Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state.

RequestExtraPower

Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA).

ReturnExtraPower

Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API.


GetExtraPowerAllocated


Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA).

IOReturn ( *GetExtraPowerAllocated)(
    void *self,
    UInt32 type,
    UInt32 *powerAllocated);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

type

Indicates whether the allocated power was to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake)

powerAllocated

Amount of power to be returned, in mA.

Return Value

Value returned can be 0 if no power has been allocated. Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

Discussion

The device has to be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface320 and above.

GetUSBDeviceInformation


Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state.

IOReturn ( *GetUSBDeviceInformation)(
    void *self,
    UInt32 *info);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

requestedPower

The desired amount of power that the client wishes to reserve

Return Value

Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnUnsupported is the bus doesn't support this function.

Discussion

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

Availability
This function is only available with IOUSBDeviceInterface320 and above.

RequestExtraPower


Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA).

IOReturn ( *RequestExtraPower)(
    void *self,
    UInt32 type,
    UInt32 requestedPower,
    UInt32 *powerAvailable);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

type

Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake)

requestedPower

Amount of power desired, in mA

powerAvailable

Amount of power that was reserved, in mA

Return Value

Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnUnsupported is the bus doesn't support this function.

Discussion

The device has to be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface320 and above.

ReturnExtraPower


Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API.

IOReturn ( *ReturnExtraPower)(
    void *self,
    UInt32 type,
    UInt32 powerReturned);  
Parameters
self

Pointer to the IOUSBDeviceInterface.

type

Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake)

powerReturned

Amount of power to be returned, in mA.

Return Value

If the returnedPower was not previously allocated, an error will be returned. This will include the case for power that was requested for sleep but was returned for wake. Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

Discussion

The device has to be open to use this function.

Availability
This function is only available with IOUSBDeviceInterface320 and above.

 

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-10-15