os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbmssuspendresume.cpp
First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 #include <d32usbtransfers.h>
27 #include "msgservice.h"
28 #include "botmsctypes.h"
30 #include "mprotocol.h"
31 #include "mtransport.h"
32 #include "cusbhostmslogicalunit.h"
33 #include "cusbhostmsdevice.h"
34 #include "cbulkonlytransport.h"
35 #include "cusbmssuspendresume.h"
41 void CUsbMsIfaceSuspendResume::RunL()
44 iDevice->ResumeCompletedL();
47 User::RequestComplete(iDeviceStatus, iStatus.Int());
52 iDevice->DoHandleRemoteWakeupL();
57 Cancellation of outstanding request
59 void CUsbMsIfaceSuspendResume::DoCancel()
64 TInt CUsbMsIfaceSuspendResume::RunError(TInt aError)
71 void CUsbMsIfaceSuspendResume::Resume(TRequestStatus& aStatus)
74 iCancelSuspend = ETrue;
75 aStatus = KRequestPending;
76 iDeviceStatus = &aStatus;
80 void CUsbMsIfaceSuspendResume::Suspend()
85 iCancelSuspend = EFalse;
86 iTransport->Suspend(iStatus);
89 CUsbMsIfaceSuspendResume* CUsbMsIfaceSuspendResume::NewL(MTransport *aTransport, CUsbHostMsDevice *aDevice)
91 return new (ELeave) CUsbMsIfaceSuspendResume(aTransport, aDevice);
94 CUsbMsIfaceSuspendResume::CUsbMsIfaceSuspendResume(MTransport* aTransport, CUsbHostMsDevice* aDevice)
95 : CActive(EPriorityHigh),
96 iTransport(aTransport),
98 iCancelSuspend(EFalse)
101 CActiveScheduler::Add(this);
104 CUsbMsIfaceSuspendResume::~CUsbMsIfaceSuspendResume()