sl@0: /* sl@0: * Copyright (c) 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 "timerutils.h" sl@0: #include "timerclient.h" sl@0: #include "timerhandler.h" sl@0: #include sl@0: #include sl@0: sl@0: // ------------------------------------------------------------------------------- sl@0: // RTimerSession::Connect sl@0: // ------------------------------------------------------------------------------- sl@0: sl@0: TInt RTimerSession::Connect(RServer2 aServer) sl@0: { sl@0: TInt ret = CreateSession(aServer, TVersion(0, 0, 0), 1,EIpcSession_Sharable); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------------------- sl@0: // Function Name : RTimerSession::OnDemandConnect() sl@0: // Description : To create connection to server on demand sl@0: // sl@0: //------------------------------------------------------------------------------- sl@0: TInt RTimerSession::OnDemandConnect(RServer2 aServer) sl@0: { sl@0: TInt err = KErrNone; sl@0: //On Demand connection sl@0: if ( !iIsConnected ) sl@0: { sl@0: Lock(); sl@0: if ( !iIsConnected ) sl@0: { sl@0: err = Connect (aServer); sl@0: if ( KErrNone == err) sl@0: { sl@0: iIsConnected = ETrue; sl@0: } sl@0: } sl@0: UnLock(); sl@0: } sl@0: return err; sl@0: } sl@0: //-------------------------------------------------------------------------------- sl@0: //This sends a timer delete request to the server. sl@0: //-------------------------------------------------------------------------------- sl@0: sl@0: TInt RTimerSession::DeleteTimer(TInt aTimerId) sl@0: { sl@0: TInt ret = SendReceive(EDeleteTimer,TIpcArgs(aTimerId)); sl@0: return ret; sl@0: } sl@0: sl@0: //-------------------------------------------------------------------------------- sl@0: //This sends a set timer request to the timer server. sl@0: //-------------------------------------------------------------------------------- sl@0: sl@0: TInt RTimerSession::SetTime(TInt aTimerId) sl@0: { sl@0: TInt ret = SendReceive(ESetTimer,TIpcArgs(aTimerId)); sl@0: return ret; sl@0: } sl@0: