|
1 // Copyright (c) 2006-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 "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 #include <mtp/mmtptype.h> |
|
22 |
|
23 #include "cmtpusbconnection.h" |
|
24 #include "cmtpusbepinterruptin.h" |
|
25 #include "mtpdebug.h" |
|
26 |
|
27 // Class constants. |
|
28 __FLOG_STMT(_LIT8(KComponent,"UsbEpInterruptIn");) |
|
29 |
|
30 /** |
|
31 USB MTP device class interrupt endpoint data transfer controller factory |
|
32 method. |
|
33 @param aId The internal endpoint identifier of the endpoint. |
|
34 @param aConnection USB MTP device class transport connection which controls |
|
35 the endpoint. |
|
36 @return A pointer to an USB MTP device class interrupt endpoint data transfer |
|
37 controller. Ownership IS transfered. |
|
38 @leave One of the system wide error codes, if a processing failure occurs. |
|
39 */ |
|
40 CMTPUsbEpInterruptIn* CMTPUsbEpInterruptIn::NewL(TUint aId, CMTPUsbConnection& aConnection) |
|
41 { |
|
42 CMTPUsbEpInterruptIn* self = new(ELeave) CMTPUsbEpInterruptIn(aId, aConnection); |
|
43 CleanupStack::PushL(self); |
|
44 |
|
45 #ifdef __FLOG_ACTIVE |
|
46 self->ConstructL(KComponent); |
|
47 #else |
|
48 self->ConstructL(); |
|
49 #endif |
|
50 |
|
51 CleanupStack::Pop(self); |
|
52 return self; |
|
53 } |
|
54 |
|
55 /** |
|
56 Destructor. |
|
57 */ |
|
58 CMTPUsbEpInterruptIn::~CMTPUsbEpInterruptIn() |
|
59 { |
|
60 __FLOG(_L8("~CMTPUsbEpInterruptIn - Entry")); |
|
61 __FLOG(_L8("~CMTPUsbEpInterruptIn - Exit")); |
|
62 } |
|
63 |
|
64 /** |
|
65 Initiates an asynchronous interrupt data send sequence. |
|
66 @param aData The interrupt data source buffer. |
|
67 @leave KErrNotSupported, if the data source buffer is comprised of more than |
|
68 one data chunk. |
|
69 @leave One of the system wide error codes, if a processing failure occurs. |
|
70 */ |
|
71 void CMTPUsbEpInterruptIn::SendInterruptDataL(const MMTPType& aData) |
|
72 { |
|
73 __FLOG(_L8("SendInterruptDataL - Entry")); |
|
74 // Pass the bulk data source buffer to the base class for processing. |
|
75 SendDataL(aData); |
|
76 __FLOG(_L8("SendInterruptDataL - Exit")); |
|
77 } |
|
78 |
|
79 void CMTPUsbEpInterruptIn::SendDataCompleteL(TInt aError, const MMTPType& aData) |
|
80 { |
|
81 __FLOG(_L8("SendDataCompleteL - Entry")); |
|
82 Connection().SendInterruptDataCompleteL(aError, aData); |
|
83 __FLOG(_L8("SendDataCompleteL - Exit")); |
|
84 } |
|
85 |
|
86 /** |
|
87 Constructor. |
|
88 @param aId The internal endpoint identifier of the endpoint. |
|
89 @param aConnection USB MTP device class transport connection which controls |
|
90 the endpoint. |
|
91 */ |
|
92 CMTPUsbEpInterruptIn::CMTPUsbEpInterruptIn(TUint aId, CMTPUsbConnection& aConnection) : |
|
93 CMTPUsbEpBase(aId, EPriorityHigh, aConnection) |
|
94 { |
|
95 |
|
96 } |