author | hgs |
Wed, 22 Sep 2010 10:53:45 +0100 | |
changeset 271 | dc268b18d709 |
parent 31 | 56f325a607ea |
child 297 | b2826f67641f |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2008-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 |
@internalTechnology |
|
19 |
*/ |
|
20 |
||
21 |
#include <e32base.h> |
|
22 |
#include <d32usbdi.h> |
|
23 |
||
24 |
#include <d32usbtransfers.h> |
|
25 |
#include "msctypes.h" |
|
26 |
#include "shared.h" |
|
27 |
#include "msgservice.h" |
|
28 |
#include "botmsctypes.h" |
|
29 |
||
30 |
#include "mprotocol.h" |
|
31 |
#include "mtransport.h" |
|
32 |
#include "cusbhostmslogicalunit.h" |
|
33 |
#include "cusbhostmsdevice.h" |
|
34 |
#include "cbulkonlytransport.h" |
|
35 |
#include "cusbmssuspendresume.h" |
|
36 |
||
37 |
#include "msdebug.h" |
|
38 |
#include "debug.h" |
|
39 |
||
40 |
||
41 |
void CUsbMsIfaceSuspendResume::RunL() |
|
42 |
{ |
|
43 |
__MSFNLOG |
|
44 |
iDevice->ResumeCompletedL(); |
|
45 |
if(iCancelSuspend) |
|
46 |
{ |
|
47 |
User::RequestComplete(iDeviceStatus, iStatus.Int()); |
|
48 |
iDeviceStatus = NULL; |
|
49 |
} |
|
50 |
else |
|
51 |
{ |
|
52 |
iDevice->DoHandleRemoteWakeupL(); |
|
53 |
} |
|
54 |
} |
|
55 |
||
56 |
/** |
|
57 |
Cancellation of outstanding request |
|
58 |
*/ |
|
59 |
void CUsbMsIfaceSuspendResume::DoCancel() |
|
60 |
{ |
|
61 |
__MSFNLOG |
|
62 |
} |
|
63 |
||
64 |
TInt CUsbMsIfaceSuspendResume::RunError(TInt aError) |
|
65 |
{ |
|
66 |
__MSFNLOG |
|
67 |
return KErrNone; |
|
68 |
} |
|
69 |
||
70 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
void CUsbMsIfaceSuspendResume::Resume(TRequestStatus& aStatus) |
0 | 72 |
{ |
73 |
__MSFNLOG |
|
74 |
iCancelSuspend = ETrue; |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
75 |
aStatus = KRequestPending; |
0 | 76 |
iDeviceStatus = &aStatus; |
77 |
iTransport->Resume(); |
|
78 |
} |
|
79 |
||
80 |
void CUsbMsIfaceSuspendResume::Suspend() |
|
81 |
{ |
|
82 |
__MSFNLOG |
|
83 |
if(!IsActive()) |
|
84 |
SetActive(); |
|
85 |
iCancelSuspend = EFalse; |
|
86 |
iTransport->Suspend(iStatus); |
|
87 |
} |
|
88 |
||
89 |
CUsbMsIfaceSuspendResume* CUsbMsIfaceSuspendResume::NewL(MTransport *aTransport, CUsbHostMsDevice *aDevice) |
|
90 |
{ |
|
91 |
return new (ELeave) CUsbMsIfaceSuspendResume(aTransport, aDevice); |
|
92 |
} |
|
93 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
CUsbMsIfaceSuspendResume::CUsbMsIfaceSuspendResume(MTransport* aTransport, CUsbHostMsDevice* aDevice) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
95 |
: CActive(EPriorityHigh), |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
96 |
iTransport(aTransport), |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
97 |
iDevice(aDevice), |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
iCancelSuspend(EFalse) |
0 | 99 |
{ |
100 |
__MSFNLOG |
|
101 |
CActiveScheduler::Add(this); |
|
102 |
} |
|
103 |
||
104 |
CUsbMsIfaceSuspendResume::~CUsbMsIfaceSuspendResume() |
|
105 |
{ |
|
106 |
__MSFNLOG |
|
107 |
Cancel(); |
|
108 |
} |
|
109 |