|
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 "cmtpusbepbulkin.h" |
|
25 #include "mtpdebug.h" |
|
26 #include "mtpusbpanic.h" |
|
27 |
|
28 // Class constants. |
|
29 __FLOG_STMT(_LIT8(KComponent,"UsbEpBulkIn");) |
|
30 |
|
31 /** |
|
32 USB MTP device class bulk-in endpoint data transfer controller factory 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 bulk-in endpoint data transfer |
|
37 controller. Ownership IS transfered. |
|
38 @leave One of the system wide error codes, if a processing failure occurs. |
|
39 */ |
|
40 CMTPUsbEpBulkIn* CMTPUsbEpBulkIn::NewL(TUint aId, CMTPUsbConnection& aConnection) |
|
41 { |
|
42 CMTPUsbEpBulkIn* self = new(ELeave) CMTPUsbEpBulkIn(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 CMTPUsbEpBulkIn::~CMTPUsbEpBulkIn() |
|
59 { |
|
60 __FLOG(_L8("~CMTPUsbEpBulkIn - Entry")); |
|
61 __FLOG(_L8("~CMTPUsbEpBulkIn - Exit")); |
|
62 } |
|
63 |
|
64 /** |
|
65 Initiates an asynchronous bulk data send sequence. |
|
66 @param aData The bulk data source buffer. |
|
67 @leave One of the system wide error codes, if a processing failure occurs. |
|
68 */ |
|
69 void CMTPUsbEpBulkIn::SendBulkDataL(const MMTPType& aData) |
|
70 { |
|
71 __FLOG(_L8("SendBulkDataL - Entry")); |
|
72 // Pass the bulk data source buffer to the base class for processing. |
|
73 SendDataL(aData); |
|
74 __FLOG(_L8("SendBulkDataL - Exit")); |
|
75 } |
|
76 |
|
77 void CMTPUsbEpBulkIn::SendDataCompleteL(TInt aError, const MMTPType& aSource) |
|
78 { |
|
79 __FLOG(_L8("SendDataCompleteL - Entry")); |
|
80 Connection().SendBulkDataCompleteL(aError, aSource); |
|
81 __FLOG(_L8("SendDataCompleteL - Exit")); |
|
82 } |
|
83 |
|
84 /** |
|
85 Constructor. |
|
86 @param aId The internal endpoint identifier of the endpoint. |
|
87 @param aConnection USB MTP device class transport connection which controls |
|
88 the endpoint. |
|
89 */ |
|
90 CMTPUsbEpBulkIn::CMTPUsbEpBulkIn(TUint aId, CMTPUsbConnection& aConnection) : |
|
91 CMTPUsbEpBase(aId, EPriorityStandard, aConnection) |
|
92 { |
|
93 |
|
94 } |