IOUSBNub



Member Functions

GetBandwidthAvailable

public:

virtual UInt32 GetBandwidthAvailable();

Returns the available bandwidth (in bytes) per frame for isochronous transfers.

Result: maximum number of bytes that a new iso pipe could transfer per frame given current allocations.

GetConfiguration

public:

virtual IOReturn GetConfiguration(UInt8 *configNumber);

Gets the current configuration from the device

Parameters

NameDescription
configNumPointer to place to store configuration value

GetConfiguration

public:

virtual IOReturn GetDeviceStatus(USBStatus *status);

Gets the current configuration from the device

Parameters

NameDescription
configNumPointer to place to store configuration value

GetFrameNumber

public:

virtual UInt64 GetFrameNumber();

Returns the full current frame number of the bus the device is attached to

Result: The frame number.

GetStringDescriptor

public:

virtual IOReturn GetStringDescriptor(UInt8 index, char *buf, int maxLen, UInt16 lang=0x409);

Get a string descriptor as ASCII, in the specified language (default is US English)

Parameters

NameDescription
indexIndex of the string descriptor to get.
bufPointer to place to store ASCII string
maxLenSize of buffer pointed to by buf
langLanguage to get string in (default is US English)

address

public:

virtual USBDeviceAddress address(void);

returns the bus address of the device


bus

public:

virtual IOUSBController * bus(void);

returns a pointer to the bus object for the device


busPowerAvailable

public:

virtual UInt32 busPowerAvailable( void );

returns the power available to the device, in units of 2mA


deviceDescriptor

public:

virtual const IOUSBDeviceDescriptor *deviceDescriptor(void);

returns a pointer to the device descriptor


deviceRequest

Abstract: execute a device request
public:

virtual IOReturn deviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion = 0);

Parameters

NameDescription
requestThe parameter block to send to the device

findNextDescriptor

Abstract: find next descriptor in configuration list of given type (kUSBAnyDesc matches any type).
public:

static const IOUSBDescriptorHeader *findNextDescriptor(const void *cur, UInt8 descType);

call this function with a pointer to a descriptor in a descriptor list, for example the descriptor list returned by IOUSBDevice::getFullConfigurationDescriptor(). Returns NULL if no more descriptors match descType.

Parameters

NameDescription
curcurrent descriptor in list
descTypedescriptor type to return (kUSBAnyDesc to match any type)
Result: Pointer to the next matching descriptor, or NULL if no more match.

pipeZero

public:

virtual IOUSBPipe * pipeZero();

returns a pointer to the device's default pipe


Member Data

FindInterfaceRequest

public:
  struct  FindInterfaceRequest  {
  UInt8  theClass;  //  requested  class,  0  =  don't  care
  UInt8  subClass;  //  requested  subclass;  0  =  don't  care
  UInt8  protocol;  //  requested  protocol;  0  =  don't  care
  UInt8  maxPower;  //  max  power  in  2ma  increments;  0  =  don't  care
  UInt8  busPowered:2;  //  1  =  not  bus  powered,  2  =  bus  powered,
  UInt8  selfPowered:2;  //  1  =  not  self  powered,  2  =  self  powered,
  UInt8  remoteWakeup:2;  //  1  =  doesn't  support  remote  wakeup;  2  =  does
  UInt8  reserved:2;
  };

Parameter block for finding interfaces in a device. Initialize each field to the desired value before calling findNextInterface, set a field to 0 if any value is OK.

Fields

NameDescription
theClassRequested class
subClassRequested subclass
protocolRequested protocol
maxPowermax power consumption in 2mA units
busPowered1 = not bus powered, 2 = bus powered
selfPowered1 = not self powered, 2 = self powered
remoteWakeup1 = doesn't support remote wakeup, 2 = does

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)