keepalive/flextimer/server/inc/flextimersession.inl
changeset 32 5c4486441ae6
equal deleted inserted replaced
31:c16e04725da3 32:5c4486441ae6
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - Initial contribution
       
    11  *
       
    12  * Description:
       
    13  * This file contains inline functions of FlexTimerSession class.
       
    14  *
       
    15  */
       
    16 /*
       
    17  * %version: 1 %
       
    18  */
       
    19 // Protection against nested includes
       
    20 #ifndef FLEXTIMERSESSION_INL
       
    21 #define FLEXTIMERSESSION_INL
       
    22 
       
    23 // --------------------------------------------------------------------------
       
    24 // Function for calculating interval from current time to timestamp
       
    25 // --------------------------------------------------------------------------
       
    26 //
       
    27 inline void CFlexTimerSession::GetIntervalToMsgTime(
       
    28         const RMessage2& aMessage,
       
    29         TTime& aRefTime,
       
    30         TTimeIntervalMicroSeconds& aInterval )
       
    31     {
       
    32     // Construct requested timestamp from the message
       
    33     TInt timeLo( aMessage.Int0() );
       
    34     TInt timeHi( aMessage.Int1() );
       
    35     TInt64 timeStamp = MAKE_TINT64( timeHi, timeLo );
       
    36     TTime reqTime( timeStamp );
       
    37 
       
    38     // Calculate the difference between current time and requested time
       
    39     // Reference time used by pure At()-timer is HomeTime
       
    40     aInterval = reqTime.MicroSecondsFrom( aRefTime );
       
    41     }
       
    42 
       
    43 #endif  /* FLEXTIMERSESSION_INL */