RUsbDevice Class Reference

class RUsbDevice

Use restricted to the Function Driver Framework, enforced by SID. Provides a means to examine the configuration descriptor, and so load appropriate Function Drivers.

Constructor & Destructor Documentation

RUsbDevice()

RUsbDevice()[inline]

Member Functions Documentation

CancelDeviceStateChangeNotification()

voidCancelDeviceStateChangeNotification()[inline]

Cancels an outstanding request for device state changes QueueDeviceStateChangeNotification

Close()

voidClose()[inline]

Close a handle to a device.

GetConfigurationDescriptor(TUsbConfigurationDescriptor &)

TInt GetConfigurationDescriptor(TUsbConfigurationDescriptor &aDescriptor)[inline]

Return the USB Configuration Descriptor for this device.

Note: the supplied TUsbConfigurationDescriptor is owned by the caller, but any descriptor objects linked to it remain the property of the RUsbDevice object. Memory leaks will result if the head pointer is not cleaned up, but the pointed to objects should not be destroyed.

Parameters

TUsbConfigurationDescriptor & aDescriptorThe supplied TUsbConfigurationDescriptor object will be populated from the data retrieved from the device. Note that the caller owns the head of the list, but not any children or peers.

GetConfigurationDescriptor(TDes8 &)

TInt GetConfigurationDescriptor(TDes8 &aConfigDesc)[private, inline]

Parameters

TDes8 & aConfigDesc

GetConfigurationDescriptorSize(TInt &)

TInt GetConfigurationDescriptorSize(TInt &aConfigDescSize)[private, inline]

Parameters

TInt & aConfigDescSize

GetDeviceDescriptor(TUsbDeviceDescriptor &)

TInt GetDeviceDescriptor(TUsbDeviceDescriptor &aDescriptor)[inline]

Return the USB Device Descriptor for this device.

Note: the supplied TUsbDeviceDescriptor is owned by the caller, but any descriptor objects linked to it remain the property of the RUsbDevice object. Memory leaks will result if the head pointer is not cleaned up, but the pointed to objects should not be destroyed.

Parameters

TUsbDeviceDescriptor & aDescriptorThe supplied TUsbDeviceDescriptor object will be populated from the data retrieved from the device.

GetDeviceDescriptor(TDes8 &)

TInt GetDeviceDescriptor(TDes8 &aDeviceDesc)[private, inline]

Parameters

TDes8 & aDeviceDesc

GetLocalDescriptorsL()

voidGetLocalDescriptorsL()[private, inline]

GetStringDescriptor(TUsbStringDescriptor *&, TDes8 &, TInt)

TInt GetStringDescriptor(TUsbStringDescriptor *&aDescriptor,
TDes8 &aTarget,
TIntaIndex
)[inline]

Parameters

TUsbStringDescriptor *& aDescriptor
TDes8 & aTarget
TInt aIndex

GetStringDescriptor(TUsbStringDescriptor *&, TDes8 &, TInt, TInt)

TInt GetStringDescriptor(TUsbStringDescriptor *&aDescriptor,
TDes8 &aTarget,
TIntaIndex,
TIntaLangId
)[inline]

Parameters

TUsbStringDescriptor *& aDescriptor
TDes8 & aTarget
TInt aIndex
TInt aLangId

GetStringDescriptor(TDes8 &, TInt, TInt)

TInt GetStringDescriptor(TDes8 &aStringDescriptor,
TIntaIndex,
TIntaLangId = 0
)[private, inline]

Parameters

TDes8 & aStringDescriptor
TInt aIndex
TInt aLangId = 0

GetTokenForInterface(TInt, TUint32 &)

TInt GetTokenForInterface(TIntaInterfaceNumber,
TUint32 &aToken
)[inline]

Return a token which may be used to uniquely identify the supplied interface on this device. The returned token may then be passed to a function driver, to allow it to open the required interface.

Parameters

TInt aInterfaceNumberInterface to return a token for.
TUint32 & aTokenThe token assigned to the interface.

Handle()

TUint Handle()const [inline]

Return the handle to a device

Open(RUsbHubDriver &, TUint)

TInt Open(RUsbHubDriver &aHub,
TUintaHandle
)[inline]

Open a handle to a device.

Parameters

RUsbHubDriver & aHub
TUint aHandle

ParseStringDescriptor(TUsbStringDescriptor *&, const TDesC8 &)

TInt ParseStringDescriptor(TUsbStringDescriptor *&aDescriptor,
const TDesC8 &aData
)[private, inline]

Parameters

TUsbStringDescriptor *& aDescriptor
const TDesC8 & aData

QueueDeviceStateChangeNotification(TDeviceState &, TRequestStatus &)

voidQueueDeviceStateChangeNotification(TDeviceState &aCurrentState,
TRequestStatus &aRequest
)[inline]

Queues an asynchronous request for changes in the state of the device represented by this handle.

Parameters

TDeviceState & aCurrentStateThe new state of the device
TRequestStatus & aRequestThe request status completed when a state change has occured.

Resume()

TInt Resume()[inline]

Resumes the device from a suspended state.

Suspend()

TInt Suspend()[inline]

Places the device into a suspended state.

Member Enumerations Documentation

Enum TDeviceState

Enumerators

EDeviceActive
EDeviceSuspended
EDeviceTriState

Enum TUsbDeviceControl

Enumerators

EDeviceControl = 0x4000000
EOpen
EClose
EGetDeviceDescriptor
EGetConfigurationDescriptorSize
EGetConfigurationDescriptor
EGetStringDescriptor
EGetInterfaceToken
ESuspend
EResume
ECancelDeviceStateChange

Enum TUsbDeviceRequest

Enumerators

EDeviceRequest = 0x4000000
EDeviceStateChange

Member Data Documentation

const TUint KDeviceDescriptorSize

const TUintKDeviceDescriptorSize[private, static]

HBufC8 * iConfigurationDescriptorData

HBufC8 *iConfigurationDescriptorData[private]

TBuf8< KDeviceDescriptorSize > iDeviceDescriptorData

TBuf8< KDeviceDescriptorSize >iDeviceDescriptorData[private]

TUint iHandle

TUint iHandle[private]

TUsbConfigurationDescriptor * iHeadConfDescriptor

TUsbConfigurationDescriptor *iHeadConfDescriptor[private]

TUsbDeviceDescriptor * iHeadDeviceDescriptor

TUsbDeviceDescriptor *iHeadDeviceDescriptor[private]

RUsbHubDriver * iHub

RUsbHubDriver *iHub[private]