Update contrib.
1 // Copyright (c) 2000-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.
14 // e32test/usb\t_usb_device\src\activestallnotifier.cpp
15 // USB Test Program T_USB_DEVICE, functional part.
16 // Device-side part, to work against T_USB_HOST running on the host.
20 #include "general.h" // CActiveControl, CActiveRW
21 #include "activestallnotifier.h"
24 extern TBool gVerbose;
26 extern TBool gStopOnFail;
27 extern TInt gSoakCount;
30 // --- class CActiveStallNotifier ---------------------------------------------------------
33 CActiveStallNotifier::CActiveStallNotifier(CConsoleBase* aConsole, RDEVCLIENT* aPort)
34 : CActive(EPriorityNormal),
39 CActiveScheduler::Add(this);
42 CActiveStallNotifier* CActiveStallNotifier::NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort)
44 CActiveStallNotifier* self = new (ELeave) CActiveStallNotifier(aConsole, aPort);
45 CleanupStack::PushL(self);
47 CleanupStack::Pop(); // self
52 void CActiveStallNotifier::ConstructL()
56 CActiveStallNotifier::~CActiveStallNotifier()
58 TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
59 Cancel(); // base class
63 void CActiveStallNotifier::DoCancel()
65 TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
66 iPort->EndpointStatusNotifyCancel();
70 void CActiveStallNotifier::RunL()
72 // This just displays the bitmap, showing which endpoints (if any) are now stalled.
73 // In a real world program, the user could take here appropriate action (cancel a
74 // transfer request or whatever).
75 TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
80 void CActiveStallNotifier::Activate()
82 __ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
83 iPort->EndpointStatusNotify(iStatus, iEndpointState);