|
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 "cmtpusbepbulkout.h" |
|
25 #include "mtpdebug.h" |
|
26 |
|
27 // Class constants. |
|
28 __FLOG_STMT(_LIT8(KComponent,"UsbEpBulkOut");) |
|
29 |
|
30 /** |
|
31 USB MTP device class bulk-out endpoint data transfer controller factory method. |
|
32 @param aId The internal endpoint identifier of the endpoint. |
|
33 @param aConnection USB MTP device class transport connection which controls |
|
34 the endpoint. |
|
35 @return A pointer to an USB MTP device class bulk-out endpoint data transfer |
|
36 controller. Ownership IS transfered. |
|
37 @leave One of the system wide error codes, if a processing failure occurs. |
|
38 */ |
|
39 CMTPUsbEpBulkOut* CMTPUsbEpBulkOut::NewL(TUint aId, CMTPUsbConnection& aConnection) |
|
40 { |
|
41 CMTPUsbEpBulkOut* self = new(ELeave) CMTPUsbEpBulkOut(aId, aConnection); |
|
42 CleanupStack::PushL(self); |
|
43 |
|
44 #ifdef __FLOG_ACTIVE |
|
45 self->ConstructL(KComponent); |
|
46 #else |
|
47 self->ConstructL(); |
|
48 #endif |
|
49 |
|
50 CleanupStack::Pop(self); |
|
51 return self; |
|
52 } |
|
53 |
|
54 /** |
|
55 Destructor. |
|
56 */ |
|
57 CMTPUsbEpBulkOut::~CMTPUsbEpBulkOut() |
|
58 { |
|
59 __FLOG(_L8("~CMTPUsbEpBulkOut - Entry")); |
|
60 __FLOG(_L8("~CMTPUsbEpBulkOut - Exit")); |
|
61 } |
|
62 |
|
63 /** |
|
64 Initiates an asynchronous generic bulk container dataset receive sequence. |
|
65 @param aData The bulk data sink buffer. |
|
66 @leave One of the system wide error codes, if a processing failure occurs. |
|
67 */ |
|
68 void CMTPUsbEpBulkOut::ReceiveBulkDataL(MMTPType& aData) |
|
69 { |
|
70 __FLOG(_L8("ReceiveBulkContainerL - Entry")); |
|
71 // Pass the bulk data sink buffer to the base class for processing. |
|
72 ReceiveDataL(aData); |
|
73 __FLOG(_L8("ReceiveBulkContainerL - Exit")); |
|
74 } |
|
75 |
|
76 void CMTPUsbEpBulkOut::ReceiveDataCompleteL(TInt aError, MMTPType& aSink) |
|
77 { |
|
78 __FLOG(_L8("ReceiveDataCompleteL - Entry")); |
|
79 Connection().ReceiveBulkDataCompleteL(aError, aSink); |
|
80 __FLOG(_L8("ReceiveDataCompleteL - Exit")); |
|
81 } |
|
82 |
|
83 /** |
|
84 Constructor. |
|
85 @param aId The internal endpoint identifier of the endpoint. |
|
86 @param aConnection USB MTP device class transport connection which controls |
|
87 the endpoint. |
|
88 */ |
|
89 CMTPUsbEpBulkOut::CMTPUsbEpBulkOut(TUint aId, CMTPUsbConnection& aConnection) : |
|
90 CMTPUsbEpBase(aId, EPriorityStandard, aConnection) |
|
91 { |
|
92 |
|
93 } |