Update contrib.
1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\device\d_lddturnaoundtimertest.cpp
15 // LDD for getting the timer count & ticks for testing turnaround timer implementation.
19 #include <kernel/kernel.h>
20 #include "d_lddturnaroundtimertest.h"
23 class DTestFactory : public DLogicalDevice
30 virtual TInt Install(); //overriding pure virtual
31 virtual void GetCaps(TDes8& aDes) const; //overriding pure virtual
32 virtual TInt Create(DLogicalChannelBase*& aChannel); //overriding pure virtual
35 class DTest1 : public DLogicalChannelBase
37 // Test logical channel
43 virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
44 virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
49 DECLARE_STANDARD_LDD()
51 return new DTestFactory;
57 DTestFactory::DTestFactory()
62 TInt DTestFactory::Create(DLogicalChannelBase*& aChannel)
68 return aChannel?KErrNone:KErrNoMemory;
71 TInt DTestFactory::Install()
73 // Install the LDD - overriding pure virtual
76 return SetName(&KLddName);
79 void DTestFactory::GetCaps(TDes8& /*aDes*/) const
81 // Get capabilities - overriding pure virtual
86 TInt DTest1::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
101 TInt DTest1::Request(TInt aReqNo, TAny* a1, TAny* /*a2*/)
104 // Get the timer tick count & ticks
109 case (RLddTest1::EGET_TIMERTICKS):
111 kumemget32(&temp, a1, sizeof(temp));
112 temp = NKern::TimerTicks(temp);
113 kumemput(a1, &temp, sizeof(temp));
116 case (RLddTest1::EGET_TIMERTICKCOUNT):
118 temp = NKern::TickCount();
119 kumemput(a1, &temp, sizeof(temp));