kerneltest/e32test/misc/d_rndtim.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\misc\d_rndtim.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #if !defined(__D_RNDTIM_H__)
       
    19 #define __D_RNDTIM_H__
       
    20 #include <e32cmn.h>
       
    21 #ifndef __KERNEL_MODE__
       
    22 #include <e32std.h>
       
    23 #endif
       
    24 
       
    25 _LIT(KRndTimLddName,"RndTim");
       
    26 
       
    27 class TCapsRndTimV01
       
    28 	{
       
    29 public:
       
    30 	TVersion	iVersion;
       
    31 	};
       
    32 
       
    33 class RRndTim : public RBusLogicalChannel
       
    34 	{
       
    35 public:
       
    36 	enum TControl
       
    37 		{
       
    38 		EControlWait,
       
    39 		EControlSetPriority,
       
    40 		EControlStartTimer,
       
    41 		EControlStopTimer,
       
    42 		EControlCalibrate,
       
    43 		};
       
    44 public:
       
    45 #ifndef __KERNEL_MODE__
       
    46 	inline TInt Open()
       
    47 		{ return DoCreate(KRndTimLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
       
    48 	inline void Wait()
       
    49 		{ DoControl(EControlWait); }
       
    50 	inline TInt SetPriority(RThread aThread, TInt aPriority)
       
    51 		{ return DoControl(EControlSetPriority, (TAny*)aThread.Handle(), (TAny*)aPriority); }
       
    52 	inline void StartTimer()
       
    53 		{ DoControl(EControlStartTimer); }
       
    54 	inline void StopTimer()
       
    55 		{ DoControl(EControlStopTimer); }
       
    56 	inline TInt Calibrate(TInt aMilliseconds)
       
    57 		{ return DoControl(EControlCalibrate, (TAny*)aMilliseconds); }
       
    58 #endif
       
    59 	};
       
    60 
       
    61 #endif