Update contrib.
1 #ifndef __CONTROL_ENDPOINT_READER_H
2 #define __CONTROL_ENDPOINT_READER_H
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
7 * This component and the accompanying materials are made available
8 * under the terms of the License "Eclipse Public License v1.0"
9 * which accompanies this distribution, and is available
10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
12 * Initial Contributors:
13 * Nokia Corporation - initial contribution.
18 * @file controlendpointreader.h
26 #include "endpointreader.h"
28 namespace NUnitTesting_USBDI
37 Called when a control vendor request from the host is received and does not require data being
38 sent back to the host.
39 @param aRequest the control request value
40 @param aValue a parameter value for the request
41 @param aIndex an index parameter for the request
42 @param aDataReqLength the length of the data to be returned to the host
43 @param aPayload the data payload sent to the device by the host in a data phase
46 virtual TInt ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,TUint16 aDataReqLength,
47 const TDesC8& aPayload) = 0;
53 This class describes a entity that reads control requests from endpoint 0
55 class CControlEndpointReader : public CEndpointReader, public MEndpointDataHandler
60 Constructor, build a reader of requests from endpoint zero
61 @param aClientDriver the channel to the USB client driver
62 @param aRequestHandler the handler of control requests
65 CControlEndpointReader(RDevUsbcClient& aClientDriver,MRequestHandler& aRequestHandler);
71 virtual ~CControlEndpointReader();
74 Reads requests sent by the host on endpoint 0. This includes any data from the data phase
80 public: // From MEndpointDataHandler
83 Interprets the data received as a control request on endpoint 0
84 @param aEndpointNumber the number of the endpoint read from
85 @param aData the data successfully read from the endpoint
88 virtual void DataReceivedFromEndpointL(TEndpointNumber aEndpointNumber,const TDesC8& aData);
91 Notified when an error occurs on a read from the endpoint
92 @param aEndpointNumber the number of the endpoint read from
93 @param aErrorCode the read operation completion error
96 void EndpointReadError(TEndpointNumber aEndpointNumber,TInt aErrorCode);
105 The request status of the entity processing requests
107 MRequestHandler& iRequestHandler;
110 The fields of the control transfer request
112 TUint8 ibRequestType;