os/kernelhwsrv/kerneltest/e32test/system/d_mstim.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32test\system\d_mstim.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#if !defined(__D_MSTIM_H__)
sl@0
    19
#define __D_MSTIM_H__
sl@0
    20
#include <e32cmn.h>
sl@0
    21
#ifndef __KERNEL_MODE__
sl@0
    22
#include <e32std.h>
sl@0
    23
#endif
sl@0
    24
sl@0
    25
_LIT(KMsTimerLddName,"MsTim");
sl@0
    26
sl@0
    27
class TCapsMsTimV01
sl@0
    28
	{
sl@0
    29
public:
sl@0
    30
	TVersion	iVersion;
sl@0
    31
	};
sl@0
    32
sl@0
    33
struct SMsTimerInfo
sl@0
    34
	{
sl@0
    35
	TInt iMin;
sl@0
    36
	TInt iMax;
sl@0
    37
	TInt iAvg;
sl@0
    38
	TInt iCount;
sl@0
    39
	};
sl@0
    40
sl@0
    41
struct SRandomTestInfo
sl@0
    42
	{
sl@0
    43
	TInt iMin;
sl@0
    44
	TInt iMax;
sl@0
    45
	TInt iXferC;
sl@0
    46
	TInt iCritC;
sl@0
    47
	TInt iStartFail;
sl@0
    48
	TInt iCallBacks;
sl@0
    49
	TInt iCompletions;
sl@0
    50
	};
sl@0
    51
sl@0
    52
class RMsTim : public RBusLogicalChannel
sl@0
    53
	{
sl@0
    54
public:
sl@0
    55
	enum TControl
sl@0
    56
		{
sl@0
    57
		EControlStartPeriodicInt,
sl@0
    58
		EControlStartPeriodicDfc,
sl@0
    59
		EControlStopPeriodic,
sl@0
    60
		EControlGetInfo,
sl@0
    61
		EControlBeginRandomTest,
sl@0
    62
		EControlEndRandomTest,
sl@0
    63
		EControlGetRandomTestInfo,
sl@0
    64
		EControlGetIdleTime,
sl@0
    65
		};
sl@0
    66
sl@0
    67
	enum TRequest
sl@0
    68
		{
sl@0
    69
		ERequestOneShotInt,
sl@0
    70
		ERequestOneShotDfc,
sl@0
    71
		ERequestIntCancel,
sl@0
    72
		ERequestOneShotIntAgain,
sl@0
    73
		ERequestOneShotUserDfc,
sl@0
    74
		ERequestOneShotUserDfcAgain
sl@0
    75
		};
sl@0
    76
public:
sl@0
    77
#ifndef __KERNEL_MODE__
sl@0
    78
	inline TInt Open()
sl@0
    79
		{ return DoCreate(KMsTimerLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
sl@0
    80
	inline TInt StartPeriodicInt(TInt aId, TInt aInterval)
sl@0
    81
		{ return DoControl(EControlStartPeriodicInt, (TAny*)aId, (TAny*)aInterval); }
sl@0
    82
	inline TInt StartPeriodicDfc(TInt aId, TInt aInterval)
sl@0
    83
		{ return DoControl(EControlStartPeriodicDfc, (TAny*)aId, (TAny*)aInterval); }
sl@0
    84
	inline TInt StopPeriodic(TInt aId)
sl@0
    85
		{ return DoControl(EControlStopPeriodic, (TAny*)aId); }
sl@0
    86
	inline TInt GetInfo(TInt aId, SMsTimerInfo& anInfo)
sl@0
    87
		{ return DoControl(EControlGetInfo, (TAny*)aId, &anInfo); }
sl@0
    88
	inline TInt BeginRandomTest()
sl@0
    89
		{ return DoControl(EControlBeginRandomTest); }
sl@0
    90
	inline TInt EndRandomTest()
sl@0
    91
		{ return DoControl(EControlEndRandomTest); }
sl@0
    92
	inline TInt GetRandomTestInfo(SRandomTestInfo& anInfo)
sl@0
    93
		{ return DoControl(EControlGetRandomTestInfo, &anInfo); }
sl@0
    94
	inline TInt GetIdleTime()
sl@0
    95
		{ return DoControl(EControlGetIdleTime); }
sl@0
    96
	inline void StartOneShotInt(TRequestStatus& aStatus, TInt aId, TInt aInterval)
sl@0
    97
		{ DoRequest(ERequestOneShotInt, aStatus, (TAny*)aId, (TAny*)aInterval); }
sl@0
    98
	inline void StartOneShotDfc(TRequestStatus& aStatus, TInt aId, TInt aInterval)
sl@0
    99
		{ DoRequest(ERequestOneShotDfc, aStatus, (TAny*)aId, (TAny*)aInterval); }
sl@0
   100
	inline void IntCancel(TRequestStatus& aStatus, TInt aId, TInt aInterval)
sl@0
   101
		{ DoRequest(ERequestIntCancel, aStatus, (TAny*)aId, (TAny*)aInterval); }
sl@0
   102
	inline void StartOneShotIntAgain(TRequestStatus& aStatus, TInt aId, TInt aInterval)
sl@0
   103
		{ DoRequest(ERequestOneShotIntAgain, aStatus, (TAny*)aId, (TAny*)aInterval); }
sl@0
   104
	inline void StartOneShotUserDfc(TRequestStatus& aStatus, TInt aId, TInt aInterval)
sl@0
   105
		{ DoRequest(ERequestOneShotUserDfc, aStatus, (TAny*)aId, (TAny*)aInterval); }
sl@0
   106
	inline void StartOneShotUserDfcAgain(TRequestStatus& aStatus, TInt aId, TInt aInterval)
sl@0
   107
		{ DoRequest(ERequestOneShotUserDfcAgain, aStatus, (TAny*)aId, (TAny*)aInterval); }
sl@0
   108
#endif
sl@0
   109
	};
sl@0
   110
sl@0
   111
#endif