First public contribution.
1 #ifndef __TEST_ENDPOINT_BASE_H
2 #define __TEST_ENDPOINT_BASE_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 testendpointbase.h
29 namespace NUnitTesting_USBDI
33 This class describes a resource endpoint for use in transfers.
34 An endpoint is configured with respect to the host so an 'in' endpoint
35 is one where data is transfered to the host and an 'out' endpoint is where
36 data is received from the host
40 friend class CInterfaceBase;
41 friend class CInterfaceSettingBase;
42 friend class CControlXfer;
45 // Compiler copy constructor and assignment ok
50 @param aEndpointNumber the number of the endpoint on the setting for the interface
51 specify only EEndpoint1, EEndpoint2, EEndpoint3, EEndpoint4 or EEndpoint5
53 explicit TEndpoint(TEndpointNumber aEndpointNumber) : iEndpointNumber(aEndpointNumber)
58 Non-virtual Destructor
66 The information for the endpoint
68 TUsbcEndpointInfo iEndpointInfo;
71 The number for the endpoint w.r.t the interface it is associated with
73 TEndpointNumber iEndpointNumber;
78 This class represents an endpoint that a device can use to send
79 data to the host via a transfer pipe
81 class TInEndpoint : public TEndpoint
85 Constructor, build an endpoint that will be used to transfer data
87 @param the number for the endpoint
89 explicit TInEndpoint(TEndpointNumber aEndpointNumber)
90 : TEndpoint(aEndpointNumber)
92 iEndpointInfo.iDir = KUsbEpDirIn;
98 This class represents an endpoint that a device can use to receive
99 data from the host via a transfer pipe
101 class TOutEndpoint : public TEndpoint
105 Constructor, build an endpoint that will be used to receive data
106 from the host in a transfer
107 @param the number for the endpoint
109 explicit TOutEndpoint(TEndpointNumber aEndpointNumber)
110 : TEndpoint(aEndpointNumber)
112 iEndpointInfo.iDir = KUsbEpDirOut;
118 This class represents an allocated endpoint for bi-directional capacity
121 class TBiEndpoint : public TEndpoint
125 Constructor, build an endpoint that will be used to send/receive data with host
126 @param the number for the endpoint
128 explicit TBiEndpoint(TEndpointNumber aEndpointNumber)
129 : TEndpoint(aEndpointNumber)
131 iEndpointInfo.iDir = KUsbEpDirBidirect;
136 This class describes an endpoint for Bulk in tansfers
138 class TBulkInEndpoint : public TInEndpoint
142 Constructor, build a bulk in endpoint
143 @param the number for the endpoint
145 explicit TBulkInEndpoint(TEndpointNumber aEndpointNumber)
146 : TInEndpoint(aEndpointNumber)
148 iEndpointInfo.iType = KUsbEpTypeBulk;
153 This class describes an endpoint for Bulk out transfers
155 class TBulkOutEndpoint : public TOutEndpoint
159 Constructor, build a bulk out endpoint
160 @param the number for the endpoint
162 explicit TBulkOutEndpoint(TEndpointNumber aEndpointNumber)
163 : TOutEndpoint(aEndpointNumber)
165 iEndpointInfo.iType = KUsbEpTypeBulk;
171 This class describes an endpoint for Control transfers
173 class TCtrlEndpoint : public TBiEndpoint
177 Constructor, build a control endpoint
178 @param the number for the endpoint
180 explicit TCtrlEndpoint(TEndpointNumber aEndpointNumber)
181 : TBiEndpoint(aEndpointNumber)
183 iEndpointInfo.iType = KUsbEpTypeControl;
189 This class describes an endpoint for Interrupt in transfers
191 class TIntInEndpoint : public TInEndpoint
195 Constructor, build a interrupt in endpoint
196 @param the number for the endpoint
197 @param the interrupt transfer polling interval for the host
199 explicit TIntInEndpoint(TEndpointNumber aEndpointNumber,TInt aPollingInterval)
200 : TInEndpoint(aEndpointNumber)
202 iEndpointInfo.iType = KUsbEpTypeInterrupt;
203 iEndpointInfo.iInterval = aPollingInterval;
208 This class describes an endpoint for Interrupt out transfers
210 class TIntOutEndpoint : public TOutEndpoint
214 Constructor, build an interrupt out endpoint
215 @param the number for the endpoint
217 explicit TIntOutEndpoint(TEndpointNumber aEndpointNumber)
218 : TOutEndpoint(aEndpointNumber)
220 iEndpointInfo.iType = KUsbEpTypeInterrupt;
225 This class describes an endpoint for Isochronous in transfers
227 class TIsochInEndpoint : public TInEndpoint
231 Constructor, build an isochronous in endpoint
232 @param the number for the endpoint
234 explicit TIsochInEndpoint(TEndpointNumber aEndpointNumber)
235 : TInEndpoint(aEndpointNumber)
237 iEndpointInfo.iType = KUsbEpTypeIsochronous;
242 This class describes an endpoint for Isochronous out transfers
244 class TIsochOutEndpoint : public TOutEndpoint
248 Constructor, build an isochronous out endpoint
249 @param the number for the endpoint
251 explicit TIsochOutEndpoint(TEndpointNumber aEndpointNumber)
252 : TOutEndpoint(aEndpointNumber)
254 iEndpointInfo.iType = KUsbEpTypeIsochronous;