Update contrib.
1 // Copyright (c) 2002-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\device\t_usb.cpp
15 // USB Test Program, main part.
16 // Device-side part, to work against USBRFLCT running on the host.
23 void RunAppL(TBool aVerboseOutput)
25 RDebug::Print(_L("RunAppL()"));
26 // Construct the active scheduler
27 CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
29 // Push active scheduler onto the cleanup stack
30 CleanupStack::PushL(myScheduler);
32 // Install as the active scheduler
33 CActiveScheduler::Install(myScheduler);
35 // Create console handler
36 CConsoleBase* myConsole =
37 Console::NewL(_L("T_USB - USB Client Test Program"), TSize(KConsFullScreen, KConsFullScreen));
38 CleanupStack::PushL(myConsole);
40 CActiveConsole* myActiveConsole = CActiveConsole::NewL(myConsole, aVerboseOutput);
41 CleanupStack::PushL(myActiveConsole);
43 // Call request function
44 myActiveConsole->RequestCharacter();
46 // Start active scheduler
47 CActiveScheduler::Start();
49 // Suspend thread for 2 secs
52 CleanupStack::PopAndDestroy(3); // myActiveConsole, myConsole, myScheduler
59 RDebug::Print(_L("E32Main()"));
61 CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
65 _LIT(KArg, "verbose");
68 TBool verbose = EFalse;
69 if (c.CompareF(KArg) == 0)
71 RDebug::Print(_L("(Verbose output enabled.)\n"));
75 TRAPD(error, RunAppL(verbose));
77 __ASSERT_ALWAYS(!error, User::Panic(_L("T_USB: EPOC32EX"), error));
81 delete cleanup; // destroy clean-up stack
83 RDebug::Print(_L("Program exit: done.\n"));
85 return 0; // and return