keepalive/flextimer/server/inc/flextimercommon.h
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 the License "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  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  * Common header for flextimer client interface and server.
       
    16  *
       
    17  */
       
    18 /*
       
    19  * %version: 1 %
       
    20  */
       
    21 // Protection against nested includes
       
    22 #ifndef FLEXTIMERCOMMON_H
       
    23 #define FLEXTIMERCOMMON_H
       
    24 
       
    25 // System includes
       
    26 #include <e32base.h>
       
    27 
       
    28 #include "flextimerpanic.h"
       
    29 
       
    30 // Constants
       
    31 /**
       
    32  * FlexTimerServer executable name used by clients when starting server
       
    33  */
       
    34 _LIT( KFlexTimerServerExe, "FlexTimerServer.exe" );
       
    35 
       
    36 /**
       
    37  * Identification name for the FlexTimerServer -server
       
    38  */
       
    39 _LIT( KFlexTimerServerName,"FlexTimerServer" );
       
    40 
       
    41 /**
       
    42  * Number of message slots reserved for each client session.
       
    43  * There can be at most one outstanding asynchronous request at a time
       
    44  * (pending timeout message). Second slot is needed for synchronous
       
    45  * communication during that (e.g. for cancellation message).
       
    46  */
       
    47 const TUint KFlexTimerServerMessageSlots = 2;
       
    48 
       
    49 /**
       
    50  *  Version identifier. Client-server message interface compatibility
       
    51  *  is maintained within a major version.
       
    52  */
       
    53 const TUint KFlexTimerServMajorVersionNumber = 1;
       
    54 const TUint KFlexTimerServMinorVersionNumber = 0;
       
    55 const TUint KFlexTimerServBuildVersionNumber = 0;
       
    56 
       
    57 /**
       
    58  * Default timeout window size. This is used, if client has not set the
       
    59  * used timeout window. Default window is a fraction of an interval
       
    60  * between current time and the expiration time.
       
    61  * 
       
    62  * @code
       
    63  *   interval = endTime - currentTime;
       
    64  *   defaultWindow = interval * KDefaultWindowMultiplier;
       
    65  *   startTime = endTime - defaultWindow;
       
    66  * @endcode
       
    67  */
       
    68 const TReal64 KDefaultWindowMultiplier = 0.2;
       
    69 
       
    70 /**
       
    71  *  Maximun lenght of FlexTimer  63072000000000 == 2a in microseconds.
       
    72  */
       
    73 const TInt64 KFlexTimerMaxTimerLength = 63072000000000;
       
    74 
       
    75 // Data types
       
    76 /**
       
    77  * Client-server interface message types (functions)
       
    78  */
       
    79 enum TFlexTimerServRqst
       
    80     {
       
    81     EFlexTimerServCancelRequest = 1,
       
    82     EFlexTimerServAtRequest,
       
    83     EFlexTimerServAtUTCRequest,
       
    84     EFlexTimerServAfterRequest,
       
    85     EFlexTimerServAfterTicksRequest,
       
    86     EFlexTimerServConfigureRequest
       
    87     };
       
    88 
       
    89 /**
       
    90  * Configuration message (EFlexTimerServConfigureRequest) type.
       
    91  * This is stored as a first parameter in configuration request message,
       
    92  * rest of the parameters and their types depend on this.
       
    93  */
       
    94 enum TFlexTimerConfigureRequestType
       
    95     {
       
    96     EConfigureRequestWindowSize = 1
       
    97     };
       
    98 
       
    99 #endif /* FLEXTIMERCOMMON_H */