RUsbInterface Class Reference

class RUsbInterface : public RBusLogicalChannel

Functions which act on a specific interface on a remote device.

Inherits from

Public Member Functions
RUsbInterface()
voidCancelEP0Transfer()
voidCancelPermitSuspend()
voidCancelWaitForResume()
IMPORT_C voidClose()
TInt EnumerateEndpointsOnInterface(TInt)
voidEp0Transfer(TUsbTransferRequestDetails &, const TDesC8 &, TDes8 &, TRequestStatus &)
TInt GetAlternateInterfaceCount()
TInt GetAlternateInterfaceDescriptor(TInt, TUsbInterfaceDescriptor &)
TInt GetBusId(TUsbBusId &)
TInt GetDeviceSpeed(TDeviceSpeed &)
TInt GetEndpointDescriptor(TInt, TInt, TUsbEndpointDescriptor &)
TInt GetHcdPageSize(TInt &)
TInt GetInterfaceDescriptor(TUsbInterfaceDescriptor &)
TInt GetStringDescriptor(TDes8 &, TUint8, TUint16)
IMPORT_C TIntInitialiseTransferDescriptors()
NONSHARABLE_CLASS(TUsbTransferRequestDetails)
NONSHARABLE_CLASS(TChunkRequestDetails)
NONSHARABLE_CLASS(TTransferMemoryDetails)
const TDesC &Name()
IMPORT_C TIntOpen(TUint32, TOwnerType)
TInt OpenPipeForEndpoint(RUsbPipe &, TInt, TBool)
TInt PermitRemoteWakeup(TBool)
voidPermitSuspendAndWaitForResume(TRequestStatus &)
IMPORT_C TIntRegisterTransferDescriptor(RUsbTransferDescriptor &)
IMPORT_C voidResetTransferDescriptors()
TInt SelectAlternateInterface(TInt)
TVersion VersionRequired()
Private Member Functions
TInt AllocateSharedChunk(RChunk &, TInt, TInt &)
TInt GetEndpointDescriptor(TInt, TInt, TUsbEndpointDescriptor *&)
TInt RegisterTransferDescriptor(RUsbTransferDescriptor &, TUsbBusId)
Inherited Functions
RBusLogicalChannel::DoCancel(TUint)
RBusLogicalChannel::DoControl(TInt)
RBusLogicalChannel::DoControl(TInt,TAny *)
RBusLogicalChannel::DoControl(TInt,TAny *,TAny *)
RBusLogicalChannel::DoCreate(const TDesC &,const TVersion &,TInt,const TDesC *,const TDesC8 *,TOwnerType,TBool)
RBusLogicalChannel::DoRequest(TInt,TRequestStatus &)
RBusLogicalChannel::DoRequest(TInt,TRequestStatus &,TAny *)
RBusLogicalChannel::DoRequest(TInt,TRequestStatus &,TAny *,TAny *)
RBusLogicalChannel::DoSvControl(TInt)
RBusLogicalChannel::DoSvControl(TInt,TAny *)
RBusLogicalChannel::DoSvControl(TInt,TAny *,TAny *)
RBusLogicalChannel::Open(RMessagePtr2,TInt,TOwnerType)
RBusLogicalChannel::Open(TInt,TOwnerType)
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RHandleBase::SetReturnedHandle(TInt)
RHandleBase::SetReturnedHandle(TInt,RHandleBase &)
Public Member Enumerations
enumTDeviceSpeed { ELowSpeed, EFullSpeed, EHighSpeed }
enumTUsbInterfaceCancel { ECancelSuspend = 0x00000001, ECancelWaitForResume = 0x00000002, ECancelEp0Transfer = 0x00000004 }
enumTUsbInterfaceControl {
EOpenPipe, EPermitRemoteWakeup, EGetInterfaceDescriptorSize, EGetInterfaceDescriptor, EGetStringDescriptor, ESelectAlternateInterface, EAllocChunk, EGetDeviceSpeed, EGetBusId, EHcdPageSize, EGetSizeAndAlignment
}
enumTUsbInterfaceRequest { ESuspend, EEp0Transfer }
Inherited Enumerations
RHandleBase:TAttributes
Private Attributes
TInt iAlternateSetting
TUsbInterfaceDescriptor *iHeadInterfaceDescriptor
HBufC8 *iInterfaceDescriptorData
RUsbTransferStrategy *iTransferStrategy
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RUsbInterface()

RUsbInterface()[inline]

Member Functions Documentation

AllocateSharedChunk(RChunk &, TInt, TInt &)

TInt AllocateSharedChunk(RChunk &aChunk,
TIntaSize,
TInt &aOffset
)[private, inline]

Parameters

RChunk & aChunk
TInt aSize
TInt & aOffset

CancelEP0Transfer()

voidCancelEP0Transfer()[inline]

Cancel an Endpoint 0 transfer.

CancelPermitSuspend()

voidCancelPermitSuspend()[inline]

Cancel the outstanding permission to suspend.

CancelWaitForResume()

voidCancelWaitForResume()[inline]

Cancel the outstanding PermitSuspendAndWaitForResume request with KErrCancel

Close()

IMPORT_C voidClose()

EnumerateEndpointsOnInterface(TInt)

TInt EnumerateEndpointsOnInterface(TIntaAlternateInterface)[inline]

Count the endpoints on an alternate interface.

Parameters

TInt aAlternateInterfaceThe alternate interface to count endpoints on.

Ep0Transfer(TUsbTransferRequestDetails &, const TDesC8 &, TDes8 &, TRequestStatus &)

voidEp0Transfer(TUsbTransferRequestDetails &aDetails,
const TDesC8 &aSend,
TDes8 &aRecv,
TRequestStatus &aRequest
)[inline]

Performs an Endpoint 0 transfer.

Parameters

TUsbTransferRequestDetails & aDetails
const TDesC8 & aSend
TDes8 & aRecv
TRequestStatus & aRequest

GetAlternateInterfaceCount()

TInt GetAlternateInterfaceCount()[inline]

GetAlternateInterfaceDescriptor(TInt, TUsbInterfaceDescriptor &)

TInt GetAlternateInterfaceDescriptor(TIntaAlternateInterface,
TUsbInterfaceDescriptor &aDescriptor
)[inline]

Find and return the section of the USB Configuration Descriptor under the supplied alternate interface.

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

Parameters

TInt aAlternateInterfaceThe alternate interface number to return the descriptor for. [in]
TUsbInterfaceDescriptor & aDescriptorThe supplied TUsbInterfaceDescriptor 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. [out]

GetBusId(TUsbBusId &)

TInt GetBusId(TUsbBusId &aBusId)[inline]

Returns an identifier that is unique for the bus that the device that provides this interface is on.

Parameters

TUsbBusId & aBusIdOn success provides an identifier that is unique for the bus this interface is on.

GetDeviceSpeed(TDeviceSpeed &)

TInt GetDeviceSpeed(TDeviceSpeed &aDeviceSpeed)[inline]

Returns the speed the remote device is connected at.

Parameters

TDeviceSpeed & aDeviceSpeedOn sucess an enumeration value describing the current speed of the remote device.

GetEndpointDescriptor(TInt, TInt, TUsbEndpointDescriptor &)

TInt GetEndpointDescriptor(TIntaAlternateInterface,
TIntaEndpoint,
TUsbEndpointDescriptor &aDescriptor
)[inline]

Find and return the section of the USB Configuration Descriptor under the supplied endpoint.

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

Parameters

TInt aAlternateInterfaceThe alternate interface number to return the descriptor for. [in]
TInt aEndpointThe endpoint number to return the descriptor for. [in]
TUsbEndpointDescriptor & aDescriptorThe supplied TUsbEndpointDescriptor 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. [out]

GetEndpointDescriptor(TInt, TInt, TUsbEndpointDescriptor *&)

TInt GetEndpointDescriptor(TIntaAlternateInterface,
TIntaEndpoint,
TUsbEndpointDescriptor *&aDescriptor
)[private, inline]

Parameters

TInt aAlternateInterface
TInt aEndpoint
TUsbEndpointDescriptor *& aDescriptor

GetHcdPageSize(TInt &)

TInt GetHcdPageSize(TInt &aHcdPageSize)[inline]

Returns the size of pages used by the HCD.

Parameters

TInt & aHcdPageSizeon success provides the HCD's page size.

GetInterfaceDescriptor(TUsbInterfaceDescriptor &)

TInt GetInterfaceDescriptor(TUsbInterfaceDescriptor &aDescriptor)[inline]

Return the section of the USB Configuration Descriptor under this interface, including any alternate interfaces.

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

Parameters

TUsbInterfaceDescriptor & aDescriptorThe supplied TUsbInterfaceDescriptor 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.

GetStringDescriptor(TDes8 &, TUint8, TUint16)

TInt GetStringDescriptor(TDes8 &aStringDescriptor,
TUint8aIndex,
TUint16aLangId
)[inline]

Parameters

TDes8 & aStringDescriptor
TUint8 aIndex
TUint16 aLangId

InitialiseTransferDescriptors()

IMPORT_C TIntInitialiseTransferDescriptors()

NONSHARABLE_CLASS(TUsbTransferRequestDetails)

NONSHARABLE_CLASS(TUsbTransferRequestDetails)[inline]

Parameters

TUsbTransferRequestDetails

NONSHARABLE_CLASS(TChunkRequestDetails)

NONSHARABLE_CLASS(TChunkRequestDetails)[inline]

Parameters

TChunkRequestDetails

NONSHARABLE_CLASS(TTransferMemoryDetails)

NONSHARABLE_CLASS(TTransferMemoryDetails)[inline]

Parameters

TTransferMemoryDetails

Name()

const TDesC &Name()[static, inline]

The driver's name

Open(TUint32, TOwnerType)

IMPORT_C TIntOpen(TUint32aToken,
TOwnerTypeaType = EOwnerProcess
)

Parameters

TUint32 aToken
TOwnerType aType = EOwnerProcess

OpenPipeForEndpoint(RUsbPipe &, TInt, TBool)

TInt OpenPipeForEndpoint(RUsbPipe &aPipe,
TIntaEndpoint,
TBoolaUseDMA
)[inline]

Establish a pipe between host and device. The RUsbPipe object returned is ready for use.

SelectAlternateInterface

Parameters

RUsbPipe & aPipeThe pipe to connect to the remote endpoint. [out]
TInt aEndpointThe endpoint on the remote device to connect to. [in]
TBool aUseDMAIn future implementations where DMA is supported this flag indicates DMA must be used. The Open attempt will fail if DMA cannot be offered on the pipe. [in]

PermitRemoteWakeup(TBool)

TInt PermitRemoteWakeup(TBoolaPermitted)[inline]

Request or clear the interface's remote wakeup flag. If any interface on the device has this flag set, suspending the device will cause it to have remote wakeup capability enabled. This function may only be called when the interface is active -- the device will not be woken to change the status if it is currently suspended. Note that clearing this flag will not prevent a device from using remote wakeup -- this will happen only if all interfaces on the device do not require it. By default the device will not have remote wakeup enabled.

Parameters

TBool aPermittedETrue if remote wakeup should be permitted, EFalse if this interface does not require it.

PermitSuspendAndWaitForResume(TRequestStatus &)

voidPermitSuspendAndWaitForResume(TRequestStatus &aResumeSignal)[inline]

Signals to the hub driver that this interface is idle and may be suspended. As suspend operates at the device level, this will only trigger a removal of bus activity if all interfaces associated with the device are marked as suspended.

Parameters

TRequestStatus & aResumeSignalThe TRequestStatus that will be completed when the interface is resumed.

RegisterTransferDescriptor(RUsbTransferDescriptor &)

IMPORT_C TIntRegisterTransferDescriptor(RUsbTransferDescriptor &aTransfer)

Parameters

RUsbTransferDescriptor & aTransfer

RegisterTransferDescriptor(RUsbTransferDescriptor &, TUsbBusId)

TInt RegisterTransferDescriptor(RUsbTransferDescriptor &aTransfer,
TUsbBusIdaBusId
)[private]

Parameters

RUsbTransferDescriptor & aTransfer
TUsbBusId aBusId

ResetTransferDescriptors()

IMPORT_C voidResetTransferDescriptors()

SelectAlternateInterface(TInt)

TInt SelectAlternateInterface(TIntaAlternateInterface)[inline]

Select the specified alternate interface.

Asserts that all open pipes have been closed.

Parameters

TInt aAlternateInterfaceThe alternate interface to select.

VersionRequired()

TVersion VersionRequired()[static, inline]

The driver's version

Member Enumerations Documentation

Enum TDeviceSpeed

Enumerators

ELowSpeed
EFullSpeed
EHighSpeed

Enum TUsbInterfaceCancel

Enumerators

ECancelSuspend = 0x00000001
ECancelWaitForResume = 0x00000002
ECancelEp0Transfer = 0x00000004

Enum TUsbInterfaceControl

Enumerators

EOpenPipe
EPermitRemoteWakeup
EGetInterfaceDescriptorSize
EGetInterfaceDescriptor
EGetStringDescriptor
ESelectAlternateInterface
EAllocChunk
EGetDeviceSpeed
EGetBusId
EHcdPageSize
EGetSizeAndAlignment

Enum TUsbInterfaceRequest

Enumerators

ESuspend
EEp0Transfer

Member Data Documentation

TInt iAlternateSetting

TInt iAlternateSetting[private]

TUsbInterfaceDescriptor * iHeadInterfaceDescriptor

TUsbInterfaceDescriptor *iHeadInterfaceDescriptor[private]

HBufC8 * iInterfaceDescriptorData

HBufC8 *iInterfaceDescriptorData[private]

RUsbTransferStrategy * iTransferStrategy

RUsbTransferStrategy *iTransferStrategy[private]