189
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalComponent
|
|
19 |
*/
|
|
20 |
|
|
21 |
#ifndef USBTRANSFERSTRATEGY_H
|
|
22 |
#define USBTRANSFERSTRATEGY_H
|
|
23 |
|
|
24 |
#include <e32std.h>
|
|
25 |
#include <d32usbtransfers.h>
|
|
26 |
|
|
27 |
|
|
28 |
NONSHARABLE_CLASS(RUsbTransferStrategy)
|
|
29 |
{
|
|
30 |
public:
|
|
31 |
virtual void Close();
|
|
32 |
|
|
33 |
virtual TInt RegisterTransferDescriptor(RUsbTransferDescriptor& aTransferDesc, TInt aRequiredSize, TUint aStartAlignment, TInt aRequiredMaxPackets) =0;
|
|
34 |
virtual void ResetTransferDescriptors() =0;
|
|
35 |
virtual TInt InitialiseTransferDescriptors(RUsbInterface& aInterface) =0;
|
|
36 |
|
|
37 |
public: // Interrupt transfer descriptor methods
|
|
38 |
virtual TPtr8 IntrWritableBuffer(TInt aHandle) =0;
|
|
39 |
virtual void IntrSaveData(TInt aHandle, TInt aLength) =0;
|
|
40 |
virtual void IntrSetZlpStatus(TInt aHandle, RUsbTransferDescriptor::TZlpStatus aZlpStatus) =0;
|
|
41 |
virtual TPtrC8 IntrBuffer(TInt aHandle) const =0;
|
|
42 |
|
|
43 |
public: // Bulk transfer descriptor methods
|
|
44 |
virtual TPtr8 BulkWritableBuffer(TInt aHandle) =0;
|
|
45 |
virtual void BulkSaveData(TInt aHandle, TInt aLength) =0;
|
|
46 |
virtual void BulkSetZlpStatus(TInt aHandle, RUsbTransferDescriptor::TZlpStatus aZlpStatus) =0;
|
|
47 |
virtual TPtrC8 BulkBuffer(TInt aHandle) const =0;
|
|
48 |
|
|
49 |
public: // Isochronous transfer descriptor methods
|
|
50 |
virtual void IsocReset(TInt aHandle) =0;
|
|
51 |
virtual TPacketLengths IsocLengths(TInt aHandle) =0;
|
|
52 |
virtual TPacketResults IsocResults(TInt aHandle) =0;
|
|
53 |
virtual TInt IsocMaxPacketSize(TInt aHandle) =0;
|
|
54 |
virtual TPtr8 IsocWritablePackets(TInt aHandle, TInt aWriteHandle, TInt aNumPacketsRequested, TInt& aMaxNumPacketsAbleToWrite) =0;
|
|
55 |
virtual TInt IsocSaveMultiple(TInt aHandle, TInt aWriteHandle, TInt aNumOfPackets) =0;
|
|
56 |
virtual TPtrC8 IsocPackets(TInt aHandle, TInt aFirstPacketIndex, TInt aNumPacketsRequested, TInt& aNumPacketsReturned) const =0;
|
|
57 |
virtual void IsocReceivePackets(TInt aHandle, TInt aNumOfPackets) =0;
|
|
58 |
|
|
59 |
protected:
|
|
60 |
void SetTransferHandle(RUsbTransferDescriptor& aTransfer, TInt aHandle) const;
|
|
61 |
};
|
|
62 |
|
|
63 |
|
|
64 |
#endif // USBTRANSFERSTRATEGY_H
|