class RUsb : public RSessionBase |
Public Member Enumerations | |
---|---|
enum | TUsbReqType { EStart , EStop , ETryStart , ETryStop } |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Private Attributes | |
---|---|
TPckg < TUint32 > | iDeviceStatePkg |
TPckg < TDeviceEventInformation > | iHostPkg |
TPckg < TUint32 > | iMessagePkg |
TPckg < TUint32 > | iServiceStatePkg |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
IMPORT_C TInt | BusClearError | ( | ) |
Cable watcher wants to clear the Bus Error after A_VBUS_ERR Only works if ID-Pin is present (this is an A-Device) and there has already been a bus erorr. This will not result in any attempt to raise or drop VBus
IMPORT_C TInt | BusDrop | ( | ) |
Cable watcher wants to drop VBus. If ID-Pin is present this is an A-Device and this will result in stopping VBus power-up
IMPORT_C TInt | BusRequest | ( | ) |
Cable watcher wants to assert Bus_request. If ID-Pin is present this is an A-Device and this will result in an attempt to raise VBus. Second attempt to raise VBus causes KErrUsbOtgVbusAlreadyRaised error. If ID-Pin is absent this is a B-Device and this will result in an attempt to use SRP. Recently does nothing
When BusRequest() returns an error, VBus remains low until the errors are cleared by BusDrop() or BusClearErr() calls
IMPORT_C TInt | BusRespondSrp | ( | ) |
Cable watcher wants to assert Bus_request after SRP. If ID-Pin is present this is an A-Device and this will result in an attempt to raise VBus
IMPORT_C TInt | CancelInterest | ( | TUsbReqType | aMessageId | ) |
Cancels the interest of the pending operation of the device's USB service, either starting or stopping. The pending request will run to the completion. The caller of this function receives a status of KErrCancel.
TUsbReqType aMessageId | a message id to identify the request to be cancelled |
IMPORT_C TInt | ClassSupported | ( | TInt | aPersonalityId, |
TUid | aClassUid, | |||
TBool & | aSupported | |||
) |
Queries the USB manager to determine if a given class is supported
IMPORT_C TInt | Connect | ( | ) |
Connect the Handle to the Server Must be called before all other methods except Version()
IMPORT_C void | DeviceStateNotification | ( | TUint | aStateMask, |
TUsbDeviceState & | aState, | |||
TRequestStatus & | aStatus | |||
) |
Request to be notified of a change in state of the USB device.
TUint aStateMask | State mask of the states the client is interested in |
TUsbDeviceState & aState | State variable to be written to upon completion of the request |
TRequestStatus & aStatus | Status to complete when required state change occurs |
IMPORT_C void | DeviceStateNotificationCancel | ( | ) |
Cancel the outstanding device state notification request.
IMPORT_C void | DisableFunctionDriverLoading | ( | ) |
Disable Function Driver Loading.
IMPORT_C TInt | EnableFunctionDriverLoading | ( | ) |
Enable Function Driver Loading.
IMPORT_C TInt | GetCurrentPersonalityId | ( | TInt & | aPersonalityId | ) |
Gets the current personality id of the device's USb service
TInt & aPersonalityId | set to the current personality of USB device |
IMPORT_C TInt | GetCurrentState | ( | TUsbServiceState & | aState | ) |
Functions below this point are deprecated and should not be used. Get the current state of the device's USB service. This function is deprecated and has been replaced by the GetServiceState function from version 7.0s onwards.
TUsbServiceState & aState | Set by the method to the current state of the USB service |
IMPORT_C TInt | GetDescription | ( | TInt | aPersonalityId, |
HBufC *& | aLocalizedPersonalityDescriptor | |||
) |
Gets the textual description of the personality identified by the aPersonalityId. Caller is repsonsible for freeing up memories allocated to aLocalizedPersonalityDescriptor.
IMPORT_C TInt | GetDetailedDescription | ( | TInt | aPersonalityId, |
HBufC *& | aLocalizedPersonalityDescriptor | |||
) |
Gets the detailed textual description of the personality identified by the aPersonalityId. Caller is repsonsible for freeing up memories allocated to aLocalizedPersonalityDescriptor.
IMPORT_C TInt | GetDeviceState | ( | TUsbDeviceState & | aState | ) |
Gets the current device state (eg. powered, configured...).
TUsbDeviceState & aState | Set by the method to the current state of the USB device |
IMPORT_C TInt | GetManufacturerStringDescriptor | ( | TUint | aDeviceId, |
TUint | aLangId, | |||
TName & | aString | |||
) |
Get Manufacturer Descriptor
IMPORT_C TInt | GetOtgDescriptor | ( | TUint | aDeviceId, |
TOtgDescriptor & | aDescriptor | |||
) |
HNP supported
SRP supported An OTG device should support them both.
TUint aDeviceId | DeviceID of given device |
TOtgDescriptor & aDescriptor | OTG descriptor value at output |
IMPORT_C TInt | GetPersonalityIds | ( | RArray < TInt > & | aPersonalityIds | ) |
Gets all supported personality ids of the device's USB service.
IMPORT_C TInt | GetPersonalityProperty | ( | TInt | aPersonalityId, |
TUint32 & | aProperty | |||
) |
Gets the property of the personality identified by the aPersonalityId.
IMPORT_C TInt | GetProductStringDescriptor | ( | TUint | aDeviceId, |
TUint | aLangId, | |||
TName & | aString | |||
) |
Get Product Descriptor
IMPORT_C TInt | GetServiceState | ( | TUsbServiceState & | aState | ) |
Get the current state of the device's USB service.
TUsbServiceState & aState | Set by the method to the current state of the USB service |
IMPORT_C TInt | GetSupportedClasses | ( | TInt | aPersonalityId, |
RArray < TUid > & | aClassUids | |||
) |
Gets supported classes by the given personality identified by the aPersonalityId
IMPORT_C TInt | GetSupportedLanguages | ( | TUint | aDeviceId, |
RArray < TUint > & | aLangIds | |||
) |
Get Supported Languages from USB Device
IMPORT_C void | HostEventNotification | ( | TRequestStatus & | aStatus, |
TDeviceEventInformation & | aDeviceInformation | |||
) |
Register for Host Device Event notifications. The request only completes when the host event occurs. Calling this function the first time initializes Host Events queue
KErrNone - if successful KErrInUse - if there is another outstanding nofitication request for the same session otherwise an error code returned by FDF
TRequestStatus & aStatus | Status to complete when required event occurs |
TDeviceEventInformation & aDeviceInformation | device info to be written to upon completion of the request |
IMPORT_C void | HostEventNotificationCancel | ( | ) |
Cancel the outstanding FDF Device Event notification request.
IMPORT_C void | MessageNotification | ( | TRequestStatus & | aStatus, |
TInt & | aMessage | |||
) |
Register for Messages notifications The request only completes when the new message arrives. Calling this function the first time initializes Messages queue
TRequestStatus & aStatus | Status to complete when required state change occurs KErrNone - if successful KErrInUse - if there is another outstanding nofitication request for the same session otherwise an error code returned by OTGDI or Host |
TInt & aMessage | UI Message variable to be written to upon completion of the request |
IMPORT_C void | MessageNotificationCancel | ( | ) |
Cancel the outstanding Messages notification request.
IMPORT_C TInt | RequestSession | ( | ) |
Informs USB Manager that the client would like to initialte USB session. On A-Device, it results in sending a notification to 'controller' application On B-Device, it may trigger either SRP or HNP sequence depending on the state of VBus
IMPORT_C void | ServiceStateNotification | ( | TUsbServiceState & | aState, |
TRequestStatus & | aStatus | |||
) |
Request to be notified of a change in service state of the USB device. The request only completes when the service state changes.
TUsbServiceState & aState | State variable to be written to upon completion of the request |
TRequestStatus & aStatus | Status to complete when required state change occurs |
IMPORT_C void | ServiceStateNotificationCancel | ( | ) |
Cancel the outstanding service state notification request.
IMPORT_C TInt | SetCtlSessionMode | ( | TBool | aValue | ) |
Set or reset the mode in which current RUsb session operates. Recent implementation assumes that there is the one and only application which controls USBMAN, all other clients act as listeners to notification requests. Only application which was previously granted 'control' mode is allowed to reset it at later stage. Any calls from other applications will generate an error.
TBool aValue | True to inform USBMAN that Application wants to 'control' USBMAN False otherwise |
IMPORT_C void | Start | ( | TRequestStatus & | aStatus | ) |
Start the device's USB service. Should not be called if the USB services have already been started Note: Asynchonous Version, outcome returned when the status is completed
TRequestStatus & aStatus | Status to complete once the start operation has completed |
IMPORT_C void | StartCancel | ( | ) |
Cancels the pending start operation of the device's USB service.
IMPORT_C void | StateNotification | ( | TUint | aStateMask, |
TUsbDeviceState & | aState, | |||
TRequestStatus & | aStatus | |||
) |
Request to be notified of a change in state of the USB device. This function is deprecated and has been replaced by the DeviceStateNotification function from version 7.0s onwards.
TUint aStateMask | State mask of the states the client is interested in |
TUsbDeviceState & aState | State variable to be written to upon completion of the request |
TRequestStatus & aStatus | Status to complete when required state change occurs |
IMPORT_C void | StateNotificationCancel | ( | ) |
Cancel the outstanding device state notification request. This function is deprecated and has been replaced by the DeviceStateNotificationCancel function from version 7.0s onwards.
IMPORT_C void | Stop | ( | ) |
Stops the device's USB service. Should not be called if the USB services have not been started. This is the synchronous variant of this function. This function is deprecated- use the asynchronous version.
IMPORT_C void | Stop | ( | TRequestStatus & | aStatus | ) |
Stops the device's USB service. Should not be called if the USB services have not been started. This is the asynchronous variant of this function.
TRequestStatus & aStatus | Status to complete once the stop operation has completed |
IMPORT_C void | StopCancel | ( | ) |
Cancels the pending stop operation of the device's USB service.
IMPORT_C void | TryStart | ( | TInt | aPersonalityId, |
TRequestStatus & | aStatus | |||
) |
Try to start the device's USB service. It starts the current personality only if the service is in the idle state. Calling this API while the server is in any other states has no any effect on the service state.
Note: Asynchonous version, outcome returned when the status is completed
TInt aPersonalityId | a personality id |
TRequestStatus & aStatus | Status to complete once the start operation has completed. It may be one of the following: KErrNotSupported KErrAccessDenied KErrServerBusy KErrAbort KErrNone |
IMPORT_C void | TryStop | ( | TRequestStatus & | aStatus | ) |
Try to stop the device's USB service. It stops the service only if the serice is in the started state. Calling this API while the server is in the other states has no any effect on the service state.
Note: Asynchonous version, outcome returned when the status is completed
TRequestStatus & aStatus | Status to complete once the stop operation has completed. It may be one of the following: KErrNotSupported KErrAccessDenied KErrServerBusy KErrNone |
IMPORT_C TVersion | Version | ( | ) | const |
Extract the version of the server providing the RUsb API
IMPORT_C TInt | __DbgAlloc | ( | ) |
Simulates memory allocation in the USB Manager. This function is only defined in debug builds.
IMPORT_C TInt | __DbgCheckHeap | ( | TInt | aCount | ) |
Checks that the number of allocated cells on the USB Manager's heap is correct. The USB Manager will be panicked if it is not. This function is only defined in debug builds.
TInt aCount | The expected number of heap cells allocated |
IMPORT_C TInt | __DbgFailNext | ( | TInt | aCount | ) |
Simulates memory allocation failure in the USB Manager. This function is only defined in debug builds.
TInt aCount | The number of allocations after which memory allocation should fail |
IMPORT_C TInt | __DbgMarkEnd | ( | TInt | aCount | ) |
Marks the end of heap cell checking for the USB Manager. Checks that the number of heap cells allocated since the last __DbgMarkHeap() is aCount; the most common value to pass here is zero. This function is only defined in debug builds.
TInt aCount | The expected number of heap cells allocated |
IMPORT_C TInt | __DbgMarkHeap | ( | ) |
Marks the start of heap cell checking for the USB Manager. This function is only defined in debug builds.
TPckg < TUint32 > | iDeviceStatePkg | [private] |
Used to register device state notifications.
TPckg < TDeviceEventInformation > | iHostPkg | [private] |
Used to register Host state notifications.
TPckg < TUint32 > | iMessagePkg | [private] |
Used to register OTG/Host message notifications.
TPckg < TUint32 > | iServiceStatePkg | [private] |
Used to register service state notifications.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.