os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/Ep0Reader.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/Ep0Reader.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,122 @@
     1.4 +#ifndef __EP0_READER_H
     1.5 +#define __EPO_READER_H
     1.6 +
     1.7 +/*
     1.8 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.9 +* All rights reserved.
    1.10 +* This component and the accompanying materials are made available
    1.11 +* under the terms of the License "Eclipse Public License v1.0"
    1.12 +* which accompanies this distribution, and is available
    1.13 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.14 +*
    1.15 +* Initial Contributors:
    1.16 +* Nokia Corporation - initial contribution.
    1.17 +*
    1.18 +* Contributors:
    1.19 +*
    1.20 +* Description:
    1.21 +* @file Ep0Reader.h
    1.22 +* @internalComponent
    1.23 +* 
    1.24 +*
    1.25 +*/
    1.26 +
    1.27 +
    1.28 +
    1.29 +#include "controlendpointreader.h"
    1.30 +#include "endpointwriter.h"
    1.31 +
    1.32 +namespace NUnitTesting_USBDI
    1.33 +	{
    1.34 +
    1.35 +/**
    1.36 +This class describes a processor for device directed requests and associated data
    1.37 +payload packets
    1.38 +*/
    1.39 +class CDeviceEndpoint0 : public CBase
    1.40 +	{
    1.41 +public:
    1.42 +	
    1.43 +	/**
    1.44 +	Constructor (2-phase) 
    1.45 +	@return a pointer to a new instance of control Ep0 reader
    1.46 +	*/
    1.47 +	
    1.48 +	static CDeviceEndpoint0* NewL(MRequestHandler& aRequestHandler);
    1.49 +	
    1.50 +	/**
    1.51 +	Destructor
    1.52 +	*/
    1.53 +	
    1.54 +	~CDeviceEndpoint0();
    1.55 +
    1.56 +	/**
    1.57 +	Starts this reader receiving device directed ep0 requests
    1.58 +	@return KErrNone if successful or system wide error code
    1.59 +	*/
    1.60 +
    1.61 +	TInt Start();
    1.62 +
    1.63 +	/**
    1.64 +	Stops this reader receiving device directed ep0 requests
    1.65 +	@return KErrNone if successful or system wide error code
    1.66 +	*/
    1.67 +	TInt Stop();
    1.68 +	
    1.69 +	/**
    1.70 +	Send data back to the host through endpoint 0
    1.71 +	@param aData the descriptor with the data to send back
    1.72 +	*/
    1.73 +	void SendData(const TDesC8& aData);
    1.74 +
    1.75 +	/**
    1.76 +	Send data back to the host through endpoint 0 and do not return until completion
    1.77 +	@param aData the descriptor with the data to send back
    1.78 +	*/
    1.79 +	TInt SendDataSynchronous(const TDesC8& aData);
    1.80 +	
    1.81 +	/**
    1.82 +	Access the reader object for this control endpoint 0
    1.83 +	*/
    1.84 +	CControlEndpointReader& Reader();
    1.85 +	
    1.86 +private:
    1.87 +	
    1.88 +	/**
    1.89 +	Constructor, build a reader for control endpoint 0
    1.90 +	*/
    1.91 +	
    1.92 +	CDeviceEndpoint0();
    1.93 +	
    1.94 +	/**
    1.95 +	2nd phase constructor
    1.96 +	*/
    1.97 +	
    1.98 +	void ConstructL(MRequestHandler& aRequestHandler);
    1.99 +
   1.100 +private:
   1.101 +	
   1.102 +	/**
   1.103 +	The channel to the USB client driver
   1.104 +	*/
   1.105 +	
   1.106 +	RDevUsbcClient iClientDriver;
   1.107 +	
   1.108 +	/**
   1.109 +	The endpoint reader for endpoint 0
   1.110 +	*/
   1.111 +	
   1.112 +	CControlEndpointReader* iEndpoint0Reader;
   1.113 +		
   1.114 +	/**
   1.115 +	The endpoint writer for endpoint 0
   1.116 +	*/
   1.117 +	
   1.118 +	CEndpointWriter* iEndpoint0Writer;
   1.119 +	};
   1.120 +		
   1.121 +	}
   1.122 +
   1.123 +#endif
   1.124 +
   1.125 +