sl@0: #ifndef __EP0_READER_H sl@0: #define __EPO_READER_H sl@0: sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * @file Ep0Reader.h sl@0: * @internalComponent sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include "controlendpointreader.h" sl@0: #include "endpointwriter.h" sl@0: sl@0: namespace NUnitTesting_USBDI sl@0: { sl@0: sl@0: /** sl@0: This class describes a processor for device directed requests and associated data sl@0: payload packets sl@0: */ sl@0: class CDeviceEndpoint0 : public CBase sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructor (2-phase) sl@0: @return a pointer to a new instance of control Ep0 reader sl@0: */ sl@0: sl@0: static CDeviceEndpoint0* NewL(MRequestHandler& aRequestHandler); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: sl@0: ~CDeviceEndpoint0(); sl@0: sl@0: /** sl@0: Starts this reader receiving device directed ep0 requests sl@0: @return KErrNone if successful or system wide error code sl@0: */ sl@0: sl@0: TInt Start(); sl@0: sl@0: /** sl@0: Stops this reader receiving device directed ep0 requests sl@0: @return KErrNone if successful or system wide error code sl@0: */ sl@0: TInt Stop(); sl@0: sl@0: /** sl@0: Send data back to the host through endpoint 0 sl@0: @param aData the descriptor with the data to send back sl@0: */ sl@0: void SendData(const TDesC8& aData); sl@0: sl@0: /** sl@0: Send data back to the host through endpoint 0 and do not return until completion sl@0: @param aData the descriptor with the data to send back sl@0: */ sl@0: TInt SendDataSynchronous(const TDesC8& aData); sl@0: sl@0: /** sl@0: Access the reader object for this control endpoint 0 sl@0: */ sl@0: CControlEndpointReader& Reader(); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: Constructor, build a reader for control endpoint 0 sl@0: */ sl@0: sl@0: CDeviceEndpoint0(); sl@0: sl@0: /** sl@0: 2nd phase constructor sl@0: */ sl@0: sl@0: void ConstructL(MRequestHandler& aRequestHandler); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: The channel to the USB client driver sl@0: */ sl@0: sl@0: RDevUsbcClient iClientDriver; sl@0: sl@0: /** sl@0: The endpoint reader for endpoint 0 sl@0: */ sl@0: sl@0: CControlEndpointReader* iEndpoint0Reader; sl@0: sl@0: /** sl@0: The endpoint writer for endpoint 0 sl@0: */ sl@0: sl@0: CEndpointWriter* iEndpoint0Writer; sl@0: }; sl@0: sl@0: } sl@0: sl@0: #endif sl@0: sl@0: