os/boardsupport/haitest/bspsvs/suite/e32/inc/T_RDevUsbcClientData.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-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 *
    16 */
    17 // This contains T_RDevUsbcClientData.h
    18 
    19 #ifndef T_RDEVUSBCLIENT_DATA_H
    20 #define T_RDEVUSBCLIENT_DATA_H
    21 
    22 
    23 // User Includes
    24 #include "DataWrapperBase.h"
    25 #include "USBConstants.h"
    26 
    27 
    28 // System includes
    29 #include <e32base.h> // CActive
    30 #include <d32usbc.h> // RDevUsbcClient
    31 #include <e32debug.h>
    32 #include <f32file.h>
    33 #include <e32cmn.h>
    34 
    35 
    36 
    37 /**
    38  * CT_RDevUsbcClientData class
    39  */
    40 class CT_RDevUsbcClientData : public CDataWrapperBase
    41 	{
    42 public:
    43 	~CT_RDevUsbcClientData();
    44 	static CT_RDevUsbcClientData* NewL();
    45 
    46 	virtual TAny* GetObject();
    47 	virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    48 	void RunL(CActive* aActive, TInt aIndex);
    49 	void DoCancel();
    50 	void Signal(TInt aResult);		
    51 	void DestroyData();
    52 protected:
    53 	CT_RDevUsbcClientData();
    54 
    55 	void ConstructL();
    56 
    57 private:
    58     void DoCmdNewL();
    59 	void DoCmdUtilityLoadLogicalDevice(const TTEFSectionName& aSection);
    60 	void DoCmdOpen();
    61 	void DoCmdDeviceCaps(const TTEFSectionName& aSection);
    62 	void DoCmdGetDeviceDescriptorSize(const TTEFSectionName& aSection);
    63 	void DoCmdGetDeviceDescriptor(const TTEFSectionName& aSection);
    64 	void DoCmdSetDeviceDescriptor(const TTEFSectionName& aSection);
    65 	void DoCmdUtilitySetEndPointL(const TTEFSectionName& aSection);
    66 	void DoCmdSetInterface(const TTEFSectionName& aSection);			
    67 	void DoCmdDestructor();
    68 	void DoCmdEndpointCaps(); 
    69     /**
    70 	 * Returns current Testclass 
    71 	 */
    72 	TInt SetEndpoint(TUint aEndpointType, TUint aEndpointDirection);	
    73 	
    74 private:
    75 /**
    76 	* Provides handle to USB Driver channel
    77 	* USB Interface is configured using this channel
    78 	*/	
    79 	RDevUsbcClient *iChannel;
    80 	
    81 	/**
    82 	* Package buffer for a TUsbcInterfaceInfo object. This buffer
    83 	* is filled prior to a call to RDevUsbcClient::SetInterface
    84 	*/
    85 	TUsbcInterfaceInfoBuf iInterface;
    86 	
    87 	/** Data structures for endpoint data, KUsbcMaxEndpoints is defined in d32usbc.h 
    88 	 requires both endpoint data container and descripter the data is stored to*/
    89 	TUsbcEndpointData iEndpointData[KUsbcMaxEndpoints];	
    90 			
    91 	/** 
    92 	* Number of currently set endpoints, 
    93 	* maximum is defined in d32usbc.h KMaxEndpointsPerClient
    94 	*/
    95 	TInt iConfiguredEndpoints;
    96 			
    97 
    98 	/**
    99 	* Maximum packet size for sending.
   100 	*/
   101 	TInt iTxMaxPacketSize;
   102 	
   103 	/**
   104 	 * Capabilities
   105 	 */
   106 	TUsbDeviceCaps iCaps;	
   107 	
   108 	/**
   109 	 * Active Callback for asynchronous functions
   110 	 */
   111 	CActiveCallback* iActiveCallback;
   112 		
   113 	/**
   114 	 * Buffer for init device.
   115 	 */
   116 	HBufC8* iBuffer;	
   117     HBufC8* iBuffer_verify;
   118    	/**
   119 	 * Descriptor size.
   120 	 */ 
   121     TInt iDeviceDescriptorSize;
   122 	/**
   123 	 * Enum for the resources of the Endpoint
   124 	 */
   125 	static const TEnumEntryTable iEUsbcEndpointResource[];	
   126 	
   127 	};
   128 
   129 
   130 #endif // T_RDEVUSBCLIENT_DATA_H
   131