usbmgmt/usbmgr/usbman/client/public/usbman.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * RUsb Client side header
       
    16 * Implements the Symbian OS USB Management API RUsb
       
    17 *
       
    18 */
       
    19 
       
    20 /**
       
    21  @file
       
    22 */
       
    23 
       
    24 #ifndef __USBMAN_H__
       
    25 #define __USBMAN_H__
       
    26 
       
    27 #include <e32std.h>
       
    28 #include <usberrors.h>
       
    29 #include <usbstates.h>
       
    30 #include <usb/usbshared.h>
       
    31 
       
    32 // The propery of a personality is a bitmap, and bit 0 is used to identify
       
    33 // whether a personality is hidden.
       
    34 const TUint32 KUsbPersonalityPropertyHidden = 0x00000001;
       
    35 
       
    36 NONSHARABLE_CLASS(RUsb) : public RSessionBase
       
    37 /**
       
    38 The RUsb class implements the Symbian OS USB Management API RUsb
       
    39 
       
    40 @publishedPartner
       
    41 @released
       
    42 */
       
    43 	{
       
    44 public:
       
    45 
       
    46 	// Request types, the interest of which can be cancelled by clients
       
    47 	enum TUsbReqType
       
    48 		{
       
    49 		EStart,
       
    50 		EStop,
       
    51 		ETryStart,
       
    52 		ETryStop
       
    53 		};
       
    54 		
       
    55 	/**
       
    56 	Constructor
       
    57 
       
    58 	
       
    59 	@since	7.0
       
    60 
       
    61 	@publishedPartner
       
    62 	@released
       
    63 	 */
       
    64 	IMPORT_C RUsb();
       
    65 
       
    66 	/**
       
    67 	Destructor
       
    68 
       
    69 	
       
    70 	@since	7.0
       
    71 
       
    72 	@publishedPartner
       
    73 	@released
       
    74 	*/
       
    75 	IMPORT_C ~RUsb();
       
    76 
       
    77 	/**
       
    78 	Extract the version of the server providing the RUsb API
       
    79 
       
    80 	
       
    81 	@since	7.0
       
    82 
       
    83 	@return	Version of the server
       
    84 
       
    85 	@publishedPartner
       
    86 	@released
       
    87 	*/
       
    88 	IMPORT_C TVersion Version() const;
       
    89 
       
    90 	/**
       
    91 	Connect the Handle to the Server
       
    92 	Must be called before all other methods except Version()
       
    93 
       
    94 	
       
    95 	@since	7.0
       
    96 
       
    97 	@return	KErrNone if successful, otherwise the error that occurred
       
    98 
       
    99 	@publishedPartner
       
   100 	@released
       
   101 	*/
       
   102 	IMPORT_C TInt Connect();
       
   103 
       
   104 	/**
       
   105 	Start the device's USB service. Should not be called if the USB services
       
   106 	have already been started
       
   107 	Note: Asynchonous Version, outcome returned when the status is completed
       
   108 	
       
   109 	
       
   110 	@since	7.0
       
   111 	@param	aStatus		Status to complete once the start operation has completed
       
   112 	@capability NetworkControl
       
   113 
       
   114 	@publishedPartner
       
   115 	@released
       
   116 	*/
       
   117 	IMPORT_C void Start(TRequestStatus& aStatus);
       
   118 
       
   119 	/**
       
   120 	Cancels the pending start operation of the device's USB service.
       
   121 
       
   122 	
       
   123 	@since	7.0
       
   124 	@capability NetworkControl
       
   125 
       
   126 	@publishedPartner
       
   127 	@released
       
   128 	*/
       
   129 	IMPORT_C void StartCancel();
       
   130 
       
   131 	/**
       
   132 	Stops the device's USB service. Should not be called if the USB services
       
   133 	have not been started. This is the synchronous variant of this function.
       
   134 	This function is deprecated- use the asynchronous version.
       
   135 	
       
   136 	
       
   137 	@since	7.0
       
   138 	@capability NetworkControl
       
   139 
       
   140 	@publishedPartner
       
   141 	@released
       
   142 	*/
       
   143 	IMPORT_C void Stop();
       
   144 
       
   145 	/**
       
   146 	Stops the device's USB service. Should not be called if the USB services
       
   147 	have not been started. This is the asynchronous variant of this function.
       
   148 	
       
   149 	
       
   150 	@since	7.0s
       
   151 	@param	aStatus		Status to complete once the stop operation has completed
       
   152 	@capability NetworkControl
       
   153 
       
   154 	@publishedPartner
       
   155 	@released
       
   156 	*/
       
   157 	IMPORT_C void Stop(TRequestStatus& aStatus);
       
   158 
       
   159 	/**
       
   160 	Cancels the pending stop operation of the device's USB service.
       
   161 
       
   162 	
       
   163 	@since	7.0s
       
   164 	@capability NetworkControl
       
   165 
       
   166 	@publishedPartner
       
   167 	@released
       
   168 	*/
       
   169 	IMPORT_C void StopCancel();
       
   170 
       
   171 	/**
       
   172 	Get the current state of the device's USB service.
       
   173 
       
   174 	
       
   175 	@since	7.0s
       
   176 	@param	aState	Set by the method to the current state of the USB service
       
   177 
       
   178 	@return	KErrNone if successful, otherwise the error that occurred
       
   179 
       
   180 	@publishedPartner
       
   181 	@released
       
   182 	*/
       
   183 	IMPORT_C TInt GetServiceState(TUsbServiceState& aState);
       
   184 
       
   185 	/**
       
   186 	Request to be notified of a change in service state of the USB device. The
       
   187 	request only completes when the service state changes.
       
   188 
       
   189 	
       
   190 	@since	7.0s
       
   191 	@param	aState		State variable to be written to upon completion of the request
       
   192 	@param	aStatus		Status to complete when required state change occurs
       
   193 
       
   194 	@publishedPartner
       
   195 	@released
       
   196 	*/
       
   197 	IMPORT_C void ServiceStateNotification(
       
   198 		TUsbServiceState& aState,
       
   199 		TRequestStatus& aStatus
       
   200 	);
       
   201 
       
   202 	/**
       
   203 	Cancel the outstanding service state notification request.
       
   204 
       
   205 	
       
   206 	@since 7.0s
       
   207 
       
   208 	@publishedPartner
       
   209 	@released
       
   210 	*/
       
   211 	IMPORT_C void ServiceStateNotificationCancel();
       
   212 
       
   213 	/**
       
   214 	Gets the current device state (eg. powered, configured...).
       
   215 
       
   216 	
       
   217 	@since	7.0s
       
   218 	@param	aState	Set by the method to the current state of the USB device
       
   219 	@return	KErrNone if successful, otherwise the error that occurred
       
   220 
       
   221 	@publishedPartner
       
   222 	@released
       
   223 	*/
       
   224 	IMPORT_C TInt GetDeviceState(TUsbDeviceState& aState);
       
   225 
       
   226 	/**
       
   227 	Request to be notified of a change in state of the USB device.
       
   228 
       
   229 	
       
   230 	@since	7.0s
       
   231 	@param	aStateMask	State mask of the states the client is interested in	
       
   232 	@param	aState		State variable to be written to upon completion of the request
       
   233 	@param	aStatus		Status to complete when required state change occurs
       
   234 
       
   235 	@publishedPartner
       
   236 	@released
       
   237 	*/
       
   238 	IMPORT_C void DeviceStateNotification(
       
   239 		TUint aStateMask,
       
   240 		TUsbDeviceState& aState,
       
   241 		TRequestStatus& aStatus
       
   242 	);
       
   243 
       
   244 	/**
       
   245 	Cancel the outstanding device state notification request.
       
   246 
       
   247 	
       
   248 	@since 7.0s
       
   249 
       
   250 	@publishedPartner
       
   251 	@released
       
   252 	*/
       
   253 	IMPORT_C void DeviceStateNotificationCancel();
       
   254 	
       
   255 	/**
       
   256 	Try to start the device's USB service. It starts the current personality
       
   257 	only if the service is in the idle state. Calling this API while the server
       
   258 	is in any other states has no any effect on the service state.
       
   259 	 
       
   260 	Note: Asynchonous version, outcome returned when the status is completed
       
   261 	
       
   262 	@param aPersonalityId 	a personality id
       
   263 	@param aStatus			Status to complete once the start operation has completed.
       
   264 							It may be one of the following:	
       
   265 								KErrNotSupported
       
   266 								KErrAccessDenied
       
   267 								KErrServerBusy
       
   268 								KErrAbort
       
   269 								KErrNone
       
   270 	@capability NetworkControl
       
   271 	@publishedPartner
       
   272 	@released
       
   273 	*/
       
   274 	IMPORT_C void TryStart(TInt aPersonalityId, TRequestStatus& aStatus);
       
   275 
       
   276 	/**
       
   277 	Try to stop the device's USB service. It stops the service only if the serice
       
   278 	is in the started state. Calling this API while the server is in the other states 
       
   279 	has no any effect on the service state.
       
   280 
       
   281 	Note: Asynchonous version, outcome returned when the status is completed
       
   282 	
       
   283 	@param	aStatus		Status to complete once the stop operation has completed.
       
   284 						It may be one of the following:
       
   285 								KErrNotSupported
       
   286 								KErrAccessDenied
       
   287 								KErrServerBusy
       
   288 								KErrNone
       
   289 	@capability NetworkControl
       
   290 	@publishedPartner
       
   291 	@released
       
   292 	*/
       
   293 	IMPORT_C void TryStop(TRequestStatus& aStatus);
       
   294 
       
   295 	/**
       
   296 	Cancels the interest of the pending operation of the device's USB service, 
       
   297 	either starting or stopping. The pending request will run to the completion.
       
   298 	The caller of this function receives a status of KErrCancel.
       
   299 	
       
   300 	@param  aMessageId	a message id to identify the request to be cancelled
       
   301 	@publishedPartner
       
   302 	@released
       
   303 	*/
       
   304 	IMPORT_C TInt CancelInterest(TUsbReqType aMessageId);
       
   305 
       
   306 	/**
       
   307 	Gets the textual description of the personality identified by the aPersonalityId.
       
   308 	Caller is repsonsible for freeing up memories allocated to 
       
   309 	aLocalizedPersonalityDescriptor.
       
   310 
       
   311 	@param	aPersonalityId a personality id
       
   312 	@param  aLocalizedPersonalityDescriptor a localize text string
       
   313 	@return	KErrNone if successful, otherwise the error that occurred
       
   314 	@publishedPartner
       
   315 	@released
       
   316 	*/
       
   317 	IMPORT_C TInt GetDescription(TInt aPersonalityId, HBufC*& aLocalizedPersonalityDescriptor);
       
   318 
       
   319 	/**
       
   320 	Gets the current personality id of the device's USb service
       
   321 	
       
   322 	@param	aPersonalityId set to the current personality of USB device
       
   323 	@return	KErrNone if successful, otherwise the error that occurred
       
   324 	@publishedPartner
       
   325 	@released
       
   326 	*/
       
   327 	IMPORT_C TInt GetCurrentPersonalityId(TInt& aPersonalityId);
       
   328 	
       
   329 	/**
       
   330 	Gets supported classes by the given personality identified by the aPersonalityId
       
   331 
       
   332 	@param aPersonalityId a personality id 
       
   333 	@param aClassUids an array of class uids
       
   334 	@return	KErrNone if successful, otherwise the error that occurred
       
   335 	@publishedPartner
       
   336 	@released
       
   337 	*/
       
   338 	IMPORT_C TInt GetSupportedClasses(TInt aPersonalityId, RArray<TUid>& aClassUids);
       
   339 
       
   340 	/** 
       
   341 	Queries the USB manager to determine if a given class is supported
       
   342 	
       
   343 	@param aPersonalityId a personality id
       
   344 	@param aClassUid a class uid
       
   345 	@param aSupported set upon return
       
   346 	@return	KErrNone if successful, otherwise the error that occurred
       
   347 	@publishedPartner
       
   348 	@released
       
   349 	*/
       
   350 	IMPORT_C TInt ClassSupported(TInt aPersonalityId, TUid aClassUid, TBool& aSupported);
       
   351 	
       
   352 	/**
       
   353 	Gets all supported personality ids of the device's USB service.
       
   354 
       
   355 	@param	aPersonalityIds populated with all supported personality ids of the USB device
       
   356 	@return	KErrNone if successful, otherwise the error that occurred
       
   357 	@publishedPartner
       
   358 	@released
       
   359 	*/
       
   360 	IMPORT_C TInt GetPersonalityIds(RArray<TInt>& aPersonalityIds);
       
   361 
       
   362 	/**
       
   363 	Marks the start of heap cell checking for the USB Manager. This function is only defined
       
   364 	in debug builds.
       
   365 
       
   366 	@return	KErrNone if successful, otherwise the error that occurred
       
   367 
       
   368 	@publishedPartner
       
   369 	@released
       
   370 	*/
       
   371 	IMPORT_C TInt __DbgMarkHeap();
       
   372 
       
   373 	/**
       
   374 	Checks that the number of allocated cells on the USB Manager's heap is correct. The USB
       
   375 	Manager will be panicked if it is not. This function is only defined in debug builds.
       
   376 	
       
   377 	@param	aCount	The expected number of heap cells allocated
       
   378 	@return	KErrNone if successful, otherwise the error that occurred
       
   379 
       
   380 	@publishedPartner
       
   381 	@released
       
   382 	*/
       
   383 	IMPORT_C TInt __DbgCheckHeap(TInt aCount);
       
   384 
       
   385 	/**
       
   386 	Marks the end of heap cell checking for the USB Manager. Checks that the number of heap
       
   387 	cells allocated since the last __DbgMarkHeap() is aCount; the most common value to pass
       
   388 	here is zero. This function is only defined in debug builds.
       
   389 
       
   390 	@param	aCount	The expected number of heap cells allocated
       
   391 	@return	KErrNone if successful, otherwise the error that occurred
       
   392 
       
   393 	@publishedPartner
       
   394 	@released
       
   395 	*/
       
   396 	IMPORT_C TInt __DbgMarkEnd(TInt aCount);
       
   397 
       
   398 	/**
       
   399 	Simulates memory allocation failure in the USB Manager. This function is only defined in
       
   400 	debug builds.
       
   401 
       
   402 	@param	aCount	The number of allocations after which memory allocation should fail
       
   403 	@return	KErrNone if successful, otherwise the error that occurred
       
   404 
       
   405 	@publishedPartner
       
   406 	@released
       
   407 	*/
       
   408 	IMPORT_C TInt __DbgFailNext(TInt aCount);
       
   409 	
       
   410 	/**
       
   411 	Functions below this point are deprecated and should not be used.
       
   412 	*/
       
   413 
       
   414 	/**
       
   415 	Get the current state of the device's USB service. This function is deprecated and has been
       
   416 	replaced by the GetServiceState function from version 7.0s onwards.
       
   417 
       
   418 	
       
   419 	@since	7.0
       
   420 	@param	aState	Set by the method to the current state of the USB service
       
   421 
       
   422 	@return	KErrNone if successful, otherwise the error that occurred
       
   423 
       
   424 	@publishedPartner
       
   425 	@deprecated
       
   426 	*/
       
   427 	IMPORT_C TInt GetCurrentState(TUsbServiceState& aState);
       
   428 
       
   429 	/**
       
   430 	Request to be notified of a change in state of the USB device. This function is deprecated
       
   431 	and has been replaced by the DeviceStateNotification function from version 7.0s onwards.
       
   432 
       
   433 	
       
   434 	@since	7.0
       
   435 	@param	aStateMask	State mask of the states the client is interested in	
       
   436 	@param	aState		State variable to be written to upon completion of the request
       
   437 	@param	aStatus		Status to complete when required state change occurs
       
   438 
       
   439 	@publishedPartner
       
   440 	@deprecated
       
   441 	*/
       
   442 	IMPORT_C void StateNotification(
       
   443 		TUint aStateMask,
       
   444 		TUsbDeviceState& aState,
       
   445 		TRequestStatus& aStatus
       
   446 	);
       
   447 
       
   448 	/**
       
   449 	Cancel the outstanding device state notification request. This function is deprecated and
       
   450 	has been replaced by the DeviceStateNotificationCancel function from version 7.0s onwards.
       
   451 
       
   452 	
       
   453 	@since 7.0
       
   454 
       
   455 	@publishedPartner
       
   456 	@deprecated
       
   457 	*/
       
   458 	IMPORT_C void StateNotificationCancel();
       
   459 
       
   460 	/**
       
   461 	* Set or reset the mode in which current RUsb session operates.
       
   462 	* Recent implementation assumes that there is the one and only application
       
   463 	* which controls USBMAN, all other clients act as listeners to notification 
       
   464 	* requests. Only application which was previously granted 'control' mode is 
       
   465 	* allowed to reset it at later stage. Any calls from other applications will
       
   466 	* generate an error.
       
   467 	*
       
   468 	* @param	aValue		True to inform USBMAN that Application wants to 'control' 
       
   469 	*						USBMAN
       
   470 	*						False otherwise
       
   471 	*
       
   472 	* @capability NetworkControl
       
   473 	* @return	KErrNone		 if successful
       
   474 	*			KErrAccessDenied otherwise
       
   475 	*/
       
   476 	IMPORT_C TInt SetCtlSessionMode(TBool aValue);
       
   477 
       
   478 	/**
       
   479 	* Cable watcher wants to assert Bus_request.
       
   480 	* If ID-Pin is present this is an A-Device and this will result in an attempt 
       
   481 	* to raise VBus. Second attempt to raise VBus causes KErrUsbOtgVbusAlreadyRaised
       
   482 	* error.
       
   483 	* If ID-Pin is absent this is a B-Device and this will result in an attempt to 
       
   484 	* use SRP. Recently does nothing
       
   485 	* 
       
   486 	* When BusRequest() returns an error, VBus remains low until the errors are cleared by
       
   487 	* BusDrop() or BusClearErr() calls 
       
   488 	* 
       
   489 	* @capability NetworkControl
       
   490 	* @return KErrNone if successful, otherwise an error code returned by OTGDI
       
   491 	*/
       
   492 	IMPORT_C TInt BusRequest();
       
   493 
       
   494 	/**
       
   495 	* Cable watcher wants to assert Bus_request after SRP.
       
   496 	* If ID-Pin is present this is an A-Device and this will result in an attempt 
       
   497 	* to raise VBus
       
   498 	* 
       
   499 	* @capability NetworkControl
       
   500 	* @return KErrNone if successful, otherwise an error code returned by OTGDI
       
   501 	*/
       
   502 	IMPORT_C TInt BusRespondSrp();
       
   503 
       
   504 	/**
       
   505 	* Cable watcher wants to clear the Bus Error after A_VBUS_ERR
       
   506 	* Only works if ID-Pin is present (this is an A-Device) and there
       
   507 	* has already been a bus erorr.
       
   508 	* This will not result in any attempt to raise or drop VBus
       
   509 	* 
       
   510 	* @capability NetworkControl
       
   511 	* @return KErrNone if successful, otherwise an error code returned by OTGDI
       
   512 	*/
       
   513 	IMPORT_C TInt BusClearError();
       
   514 
       
   515 	/**
       
   516 	* Cable watcher wants to drop VBus.
       
   517 	* If ID-Pin is present this is an A-Device and this will result in stopping VBus 
       
   518 	* power-up
       
   519 	* 
       
   520 	* @capability NetworkControl
       
   521 	* @return KErrNone if successful, otherwise an error code returned by OTGDI
       
   522 	*/
       
   523 	IMPORT_C TInt BusDrop();
       
   524 	
       
   525 	/**
       
   526 	* Register for Messages notifications
       
   527 	* The request only completes when the new message arrives.
       
   528 	* Calling this function the first time initializes Messages queue
       
   529 	* 
       
   530 	*
       
   531 	* @param	aMessage	UI Message variable to be written to upon completion 
       
   532 	* 						of the request
       
   533 	* @param	aStatus		Status to complete when required state change occurs
       
   534 	*			KErrNone	- if successful
       
   535 	*			KErrInUse	- if there is another outstanding nofitication request 
       
   536 	* 						  for the same session
       
   537 	*			otherwise an error code returned by OTGDI or Host
       
   538 	*/
       
   539 	IMPORT_C void MessageNotification(TRequestStatus& aStatus, TInt& aMessage);
       
   540 
       
   541 	/**
       
   542 	* Cancel the outstanding Messages notification request.
       
   543 	*/
       
   544 	IMPORT_C void MessageNotificationCancel();
       
   545 
       
   546 	/**
       
   547 	* Register for Host Device Event notifications.
       
   548 	* The request only completes when the host event occurs.
       
   549 	* Calling this function the first time initializes Host Events queue
       
   550 	*
       
   551 	* @param	aStatus		Status to complete when required event occurs
       
   552 	* 
       
   553 	*			KErrNone	- if successful
       
   554 	*			KErrInUse	- if there is another outstanding nofitication 
       
   555 	*						  request for the same session
       
   556 	*			otherwise an error code returned by FDF
       
   557 	* @param	aDeviceInformation	device info to be written to upon completion 
       
   558 	*								of the request
       
   559 	*/
       
   560 	IMPORT_C void HostEventNotification(TRequestStatus& aStatus,
       
   561 										TDeviceEventInformation& aDeviceInformation);
       
   562 	/**
       
   563 	* Cancel the outstanding FDF Device Event notification request.
       
   564 	*/
       
   565 	IMPORT_C void HostEventNotificationCancel();
       
   566 
       
   567 	/**
       
   568 	* Enable Function Driver Loading.
       
   569 	*
       
   570 	* @capability NetworkControl
       
   571 	* @return	KErrNone		 - if successful
       
   572 	*			KErrNotSupported - if FDF is not included in current configuration
       
   573 	*			otherwise an error code returned by FDF
       
   574 	*/
       
   575 	IMPORT_C TInt EnableFunctionDriverLoading();
       
   576 
       
   577 	/**
       
   578 	* Disable Function Driver Loading.
       
   579 	*
       
   580 	* @capability NetworkControl
       
   581 	*/
       
   582 	IMPORT_C void DisableFunctionDriverLoading();
       
   583 
       
   584 	/**
       
   585 	* Get Supported Languages from USB Device
       
   586 	*
       
   587 	* @param	aDeviceId	DeviceID of given device
       
   588 	* @param	aLangIds	an array of language IDs supported by given device.
       
   589 	*						These language IDs are supplied by USB-IF and are 
       
   590 	*						different from standard Symbian TLanguage enumeration
       
   591 	*
       
   592 	* @return	KErrNone		 - if successful
       
   593 	*			otherwise an error code returned by FDF
       
   594 	*/
       
   595 	IMPORT_C TInt GetSupportedLanguages(TUint aDeviceId, RArray<TUint>& aLangIds);
       
   596 
       
   597 	/**
       
   598 	* Get Manufacturer Descriptor
       
   599 	*
       
   600 	* @param	aDeviceId	DeviceID of given device
       
   601 	* @param	aLangId		required language ID which is supplied by USB-IF and is 
       
   602 	*						different from standard Symbian TLanguage enumeration
       
   603 	* @param	aString		manufacturer descriptor value at output
       
   604 	*
       
   605 	* @return	KErrNone		 - if successful
       
   606 	*			otherwise an error code returned by FDF
       
   607 	*/
       
   608 	IMPORT_C TInt GetManufacturerStringDescriptor(TUint aDeviceId, TUint aLangId, TName& aString);
       
   609 
       
   610 	/**
       
   611 	* Get Product Descriptor
       
   612 	*
       
   613 	* @param	aDeviceId	DeviceID of given device
       
   614 	* @param	aLangId		required language ID which is supplied by USB-IF and is 
       
   615 	*						different from standard Symbian TLanguage enumeration
       
   616 	* @param	aString		product descriptor value at output
       
   617 	*
       
   618 	* @return	KErrNone		 - if successful
       
   619 	*			otherwise an error code returned by FDF
       
   620 	*/
       
   621 	IMPORT_C TInt GetProductStringDescriptor(TUint aDeviceId, TUint aLangId, TName& aString);
       
   622 		
       
   623 	/**
       
   624 	* Retrieve Otg Descriptor for device which has given device Id.
       
   625 	* Currently TOtgDescriptor has following fields:
       
   626 	*  - HNP supported
       
   627 	*  - SRP supported
       
   628 	* An OTG device should support them both. 
       
   629 	*
       
   630 	* @param	aDeviceId	DeviceID of given device
       
   631 	* @param	aDescriptor OTG descriptor value at output
       
   632 	*
       
   633 	* @return	KErrNone		 - if successful
       
   634 	*			otherwise an error code returned by FDF
       
   635 	*/
       
   636 	IMPORT_C TInt GetOtgDescriptor(TUint aDeviceId, TOtgDescriptor& aDescriptor);
       
   637 	
       
   638 	/**
       
   639 	Simulates memory allocation in the USB Manager. This function is only defined in
       
   640 	debug builds.
       
   641 
       
   642 	@return	KErrNone if successful, otherwise the error that occurred
       
   643 
       
   644 	@publishedPartner
       
   645 	@released
       
   646 	*/
       
   647 	IMPORT_C TInt __DbgAlloc();
       
   648 	
       
   649 	/**
       
   650 	Informs USB Manager that the client would like to initialte USB session.
       
   651 	On A-Device, it results in sending a notification to 'controller' application
       
   652 	On B-Device, it may trigger either SRP or HNP sequence depending on the state of VBus 
       
   653 
       
   654 	@return	KErrNone if successful, otherwise the error that occurred
       
   655 
       
   656 	@publishedPartner
       
   657 	@released
       
   658 	*/
       
   659 	IMPORT_C TInt RequestSession();
       
   660 	
       
   661 
       
   662 	/**
       
   663 	Gets the property of the personality identified by the aPersonalityId.
       
   664 
       
   665 	@param  aPersonalityId a personality id
       
   666 	@return the personality property
       
   667 	@publishedPartner
       
   668 	@released
       
   669 	*/
       
   670 	IMPORT_C TInt GetPersonalityProperty(TInt aPersonalityId, TUint32& aProperty);
       
   671 
       
   672 	/**
       
   673 	Gets the detailed textual description of the personality identified by the aPersonalityId.
       
   674 	Caller is repsonsible for freeing up memories allocated to 
       
   675 	aLocalizedPersonalityDescriptor.
       
   676 
       
   677 	@param  aPersonalityId a personality id
       
   678 	@param  aLocalizedPersonalityDescriptor a localize text string
       
   679 	@return KErrNone if successful, otherwise the error that occurred
       
   680 	@publishedPartner
       
   681 	@released
       
   682 	*/
       
   683 	IMPORT_C TInt GetDetailedDescription(TInt aPersonalityId, HBufC*& aLocalizedPersonalityDescriptor);
       
   684 	
       
   685 private:
       
   686 	/** 
       
   687 	Used to register device state notifications.
       
   688 	*/
       
   689 	TPckg<TUint32> iDeviceStatePkg;
       
   690 
       
   691 	/** 
       
   692 	Used to register service state notifications.
       
   693 	*/
       
   694 	TPckg<TUint32> iServiceStatePkg;
       
   695 
       
   696 	/**
       
   697 	Used to register OTG/Host message notifications.
       
   698 	*/
       
   699 	TPckg<TUint32> iMessagePkg;
       
   700 
       
   701 	/**
       
   702 	Used to register Host state notifications.
       
   703 	*/
       
   704 	TPckg<TDeviceEventInformation> iHostPkg;
       
   705 	};
       
   706 
       
   707 #endif //__USBMAN_H__