kerneltest/e32test/device/t_usb.cpp
author Tom Cosgrove <tom.cosgrove@nokia.com>
Fri, 28 May 2010 16:29:07 +0100
changeset 30 8aab599e3476
parent 0 a41df078684a
child 43 c1f20ce4abcf
permissions -rw-r--r--
Fix for bug 2283 (RVCT 4.0 support is missing from PDK 3.0.h) Have multiple extension sections in the bld.inf, one for each version of the compiler. The RVCT version building the tools will build the runtime libraries for its version, but make sure we extract all the other versions from zip archives. Also add the archive for RVCT4.

// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// e32test\device\t_usb.cpp
// USB Test Program, main part.
// Device-side part, to work against USBRFLCT running on the host.
// 
//

#include "t_usb.h"


void RunAppL(TBool aVerboseOutput)
	{
	RDebug::Print(_L("RunAppL()"));
	// Construct the active scheduler
	CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();

	// Push active scheduler onto the cleanup stack
	CleanupStack::PushL(myScheduler);

	// Install as the active scheduler
	CActiveScheduler::Install(myScheduler);

	// Create console handler
	CConsoleBase* myConsole =
		Console::NewL(_L("T_USB - USB Client Test Program"), TSize(KConsFullScreen, KConsFullScreen));
	CleanupStack::PushL(myConsole);

	CActiveConsole* myActiveConsole = CActiveConsole::NewL(myConsole, aVerboseOutput);
	CleanupStack::PushL(myActiveConsole);

	// Call request function
	myActiveConsole->RequestCharacter();

	// Start active scheduler
	CActiveScheduler::Start();

	// Suspend thread for 2 secs
	User::After(2000000);

	CleanupStack::PopAndDestroy(3);							// myActiveConsole, myConsole, myScheduler
	return;
	}


TInt E32Main()
	{
	RDebug::Print(_L("E32Main()"));

	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack

	__UHEAP_MARK;

	_LIT(KArg, "verbose");
	TBuf<64> c;
	User::CommandLine(c);
	TBool verbose = EFalse;
	if (c.CompareF(KArg) == 0)
		{
		RDebug::Print(_L("(Verbose output enabled.)\n"));
		verbose = ETrue;
		}

	TRAPD(error, RunAppL(verbose));

	__ASSERT_ALWAYS(!error, User::Panic(_L("T_USB: EPOC32EX"), error));

	__UHEAP_MARKEND;

	delete cleanup;											// destroy clean-up stack

	RDebug::Print(_L("Program exit: done.\n"));

	return 0;												// and return
	}


// -eof-