sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /*@{*/ sl@0: const TInt KDefaultInterval = 5000000; sl@0: _LIT(KPromptPressAnyKey, "And press any key to continue..."); sl@0: _LIT(KPromptConsole, "TEF"); sl@0: _LIT(KPromptMMCMessage, "After hitting a key to continue, eject and insert the MMC card (press F5 and release on the emulator).\n"); sl@0: /*@}*/ sl@0: sl@0: sl@0: LOCAL_C void MainL() sl@0: /** sl@0: * Secure variant, contain the prompt console sl@0: */ sl@0: { sl@0: CConsoleBase *console = Console::NewL(KPromptConsole, sl@0: TSize(KConsFullScreen,KConsFullScreen)); sl@0: CleanupStack::PushL(console); sl@0: sl@0: console->Printf(KPromptMMCMessage); sl@0: console->Printf(KPromptPressAnyKey); sl@0: sl@0: TRequestStatus timerStatus; sl@0: RTimer timer; sl@0: CleanupClosePushL(timer); sl@0: timer.CreateLocal(); sl@0: timer.After(timerStatus, TTimeIntervalMicroSeconds32(KDefaultInterval)); sl@0: sl@0: TRequestStatus readStatus; sl@0: console->Read(readStatus); sl@0: sl@0: User::WaitForRequest(timerStatus, readStatus); sl@0: if ( timerStatus!=KErrNone ) sl@0: { sl@0: timer.Cancel(); sl@0: User::WaitForRequest(timerStatus); sl@0: } sl@0: if ( readStatus==KRequestPending ) sl@0: { sl@0: console->ReadCancel(); sl@0: User::WaitForRequest(readStatus); sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(2, console); sl@0: } sl@0: sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: /** sl@0: * @return - Standard Epoc error code on process exit sl@0: * Secure variant only sl@0: * Process entry point. Called by client using RProcess API sl@0: */ sl@0: { sl@0: CTrapCleanup* cleanup = CTrapCleanup::New(); sl@0: if(cleanup == NULL) sl@0: { sl@0: RProcess::Rendezvous(KErrNoMemory); sl@0: return KErrNoMemory; sl@0: } sl@0: #if (defined TRAP_IGNORE) sl@0: TRAP_IGNORE(MainL()); sl@0: RProcess::Rendezvous(KErrNone); sl@0: #else sl@0: TRAPD(err,MainL()); sl@0: RProcess::Rendezvous(err); sl@0: #endif sl@0: sl@0: delete cleanup; sl@0: return KErrNone; sl@0: }