sl@0: // Copyright (c) 2002-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 the License "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: // e32test\power\t_power_slave.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: // Get arguments from the command line sl@0: TInt len = User::CommandLineLength(); sl@0: TInt size = len * sizeof(TUint16); sl@0: __ASSERT_ALWAYS(size == sizeof(TInt),User::Invariant()); sl@0: TInt arg; sl@0: TPtr cmd((TUint16*) &arg, len); sl@0: User::CommandLine(cmd); sl@0: sl@0: TBool jit = User::JustInTime(); sl@0: User::SetJustInTime(EFalse); sl@0: sl@0: TRequestStatus status; sl@0: switch(arg) sl@0: { sl@0: case 0: sl@0: Power::PowerDown(); sl@0: break; sl@0: case 1: sl@0: Power::EnableWakeupEvents(EPwStandby); sl@0: break; sl@0: case 2: sl@0: Power::DisableWakeupEvents(); sl@0: break; sl@0: case 3: sl@0: Power::RequestWakeupEventNotification(status); sl@0: break; sl@0: case 4: sl@0: Power::CancelWakeupEventNotification(); sl@0: break; sl@0: default: sl@0: break; sl@0: } sl@0: sl@0: User::SetJustInTime(jit); sl@0: return KErrNone; sl@0: }