Update contrib.
1 // Copyright (c) 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.
16 //#include <d32usbdi.h>
17 //#include <d32otgdi.h>
18 //#include <d32usbdescriptors.h>
19 //#include <d32usbtransfers.h>
22 //#include "rusbhostmslogicalunit.h"
30 #include <d32usbdi_hubdriver.h>
32 #include "rusbhostmsdevice.h"
33 #include "rextfilesystem.h"
35 #include "cusbmsmountmanager.h"
36 //#include "cusbhost.h"
37 #include "cusbhostao.h"
42 _LIT(KTxtApp,"CUSBHOSTAO");
44 CUsbHostAo* CUsbHostAo::NewL(RUsbHubDriver& aHubDriver,
45 RUsbHubDriver::TBusEvent& aEvent,
46 MUsbHostBusEventObserver& aObserver)
49 CUsbHostAo* r = new (ELeave) CUsbHostAo(aHubDriver, aEvent, aObserver);
55 void CUsbHostAo::ConstructL()
61 CUsbHostAo::CUsbHostAo(RUsbHubDriver& aHubDriver,
62 RUsbHubDriver::TBusEvent& aEvent,
63 MUsbHostBusEventObserver& aObserver)
64 : CActive(EPriorityStandard),
65 iHubDriver(aHubDriver),
70 CActiveScheduler::Add(this);
74 CUsbHostAo::~CUsbHostAo()
82 void CUsbHostAo::Wait()
87 __ASSERT_ALWAYS(EFalse, User::Panic(KTxtApp, -1));
91 __USBHOSTPRINT(_L("WaitForBusEvent..."));
92 iHubDriver.WaitForBusEvent(iEvent, iStatus);
93 __USBHOSTPRINT2(_L("WaitForBusEvent done. Event=%d Status=%d"),
94 iEvent.iEventType, iStatus.Int());
99 void CUsbHostAo::DoCancel()
102 iHubDriver.CancelWaitForBusEvent();
106 void CUsbHostAo::RunL()
110 TInt status = iStatus.Int();
111 if (status == KErrNotReady)
113 const TInt KDelay = 500 * 1000; // in uSecs
119 // Let RunError handle any other error
120 User::LeaveIfError(status);
123 TRAP(status, iObserver.ProcessBusEventL());
124 if(status != KErrNone)
133 _LIT(KErrLog, "ERROR %d in CActiveUsbHost");
135 TInt CUsbHostAo::RunError(TInt aError)
138 RDebug::Print(KErrLog, aError);