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