1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #include "UsbMscPersonalityTestActiveObject.h" |
|
18 #include <e32debug.h> |
|
19 |
|
20 CUsbMscPersonalityTestActiveObject::CUsbMscPersonalityTestActiveObject( CUsbPersonalityPlugin* aPlugin, CStifLogger* aLog, TUsbPersonalityParams* aParams ) : |
|
21 CActive(EPriorityStandard) // Standard priority |
|
22 { |
|
23 iPlugin = aPlugin; |
|
24 iLog = aLog; |
|
25 iParams = aParams; |
|
26 } |
|
27 |
|
28 CUsbMscPersonalityTestActiveObject* CUsbMscPersonalityTestActiveObject::NewLC( CUsbPersonalityPlugin* aPlugin, CStifLogger* aLog, TUsbPersonalityParams* aParams ) |
|
29 { |
|
30 CUsbMscPersonalityTestActiveObject* self = |
|
31 new (ELeave) CUsbMscPersonalityTestActiveObject( aPlugin, aLog, aParams ); |
|
32 CleanupStack::PushL(self); |
|
33 self->ConstructL(); |
|
34 return self; |
|
35 } |
|
36 |
|
37 CUsbMscPersonalityTestActiveObject* CUsbMscPersonalityTestActiveObject::NewL( CUsbPersonalityPlugin* aPlugin, CStifLogger* aLog, TUsbPersonalityParams* aParams ) |
|
38 { |
|
39 CUsbMscPersonalityTestActiveObject* self = |
|
40 CUsbMscPersonalityTestActiveObject::NewLC( aPlugin, aLog, aParams ); |
|
41 CleanupStack::Pop(); // self; |
|
42 return self; |
|
43 } |
|
44 |
|
45 void CUsbMscPersonalityTestActiveObject::ConstructL() |
|
46 { |
|
47 CActiveScheduler::Add(this); // Add to scheduler |
|
48 } |
|
49 |
|
50 CUsbMscPersonalityTestActiveObject::~CUsbMscPersonalityTestActiveObject() |
|
51 { |
|
52 Cancel(); // Cancel any request, if outstanding |
|
53 |
|
54 // Delete instance variables if any |
|
55 } |
|
56 |
|
57 void CUsbMscPersonalityTestActiveObject::DoCancel() |
|
58 { |
|
59 } |
|
60 |
|
61 void CUsbMscPersonalityTestActiveObject::RunL() |
|
62 { |
|
63 CActiveScheduler::Stop(); |
|
64 } |
|
65 |
|
66 TInt CUsbMscPersonalityTestActiveObject::RunError(TInt aError) |
|
67 { |
|
68 return aError; |
|
69 } |
|
70 |
|
71 void CUsbMscPersonalityTestActiveObject::PreparePersonalityStart( TRequestStatus& aStatus) |
|
72 { |
|
73 iPlugin->PreparePersonalityStart(aStatus); |
|
74 RDebug::Printf( "prepare personality start, status: %d", aStatus.Int()); |
|
75 |
|
76 SetActive(); |
|
77 CActiveScheduler::Start(); |
|
78 } |
|
79 |
|
80 void CUsbMscPersonalityTestActiveObject::FinishPersonalityStart( TRequestStatus& aStatus) |
|
81 { |
|
82 iPlugin->FinishPersonalityStart(aStatus); |
|
83 RDebug::Printf( "finish personality start, status: %d", aStatus.Int()); |
|
84 |
|
85 SetActive(); |
|
86 CActiveScheduler::Start(); |
|
87 } |
|
88 |
|
89 void CUsbMscPersonalityTestActiveObject::PreparePersonalityStop( TRequestStatus& aStatus) |
|
90 { |
|
91 iPlugin->PreparePersonalityStop(aStatus); |
|
92 RDebug::Printf( "prepare personality start, status: %d", aStatus.Int()); |
|
93 |
|
94 SetActive(); |
|
95 CActiveScheduler::Start(); |
|
96 } |
|
97 |
|
98 void CUsbMscPersonalityTestActiveObject::FinishPersonalityStop( TRequestStatus& aStatus) |
|
99 { |
|
100 iPlugin->FinishPersonalityStop(aStatus); |
|
101 RDebug::Printf( "finish personality start, status: %d", aStatus.Int()); |
|
102 |
|
103 SetActive(); |
|
104 CActiveScheduler::Start(); |
|
105 } |
|
106 |
|
107 void CUsbMscPersonalityTestActiveObject::ConfirmPersonalityUnload( TRequestStatus& aStatus) |
|
108 { |
|
109 iPlugin->ConfirmPersonalityUnload(aStatus); |
|
110 RDebug::Printf( "confirm personality unload, status: %d", aStatus.Int()); |
|
111 |
|
112 iParams->PersonalityNotifier().CancelQuery(KQueriesNotifier); |
|
113 SetActive(); |
|
114 CActiveScheduler::Start(); |
|
115 } |
|