24
|
1 |
// Copyright (c) 2005-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 "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 |
//
|
|
15 |
|
|
16 |
#include "Te_SimDataTestServer.h"
|
|
17 |
#include "Te_SimData.h"
|
|
18 |
|
|
19 |
_LIT(KServerName,"Te_SimData");
|
|
20 |
|
|
21 |
CSimDataTestServer* CSimDataTestServer::NewL()
|
|
22 |
/**
|
|
23 |
* @return - Instance of the test server
|
|
24 |
* Same code for Secure and non-secure variants
|
|
25 |
* Called inside the MainL() function to create and start the
|
|
26 |
* CTestServer derived server.
|
|
27 |
*/
|
|
28 |
{
|
|
29 |
CSimDataTestServer * testServer = new (ELeave) CSimDataTestServer();
|
|
30 |
CleanupStack::PushL(testServer);
|
|
31 |
|
|
32 |
testServer->ConstructL(KServerName);
|
|
33 |
CleanupStack::Pop(testServer);
|
|
34 |
return testServer;
|
|
35 |
}
|
|
36 |
|
|
37 |
LOCAL_C void MainL()
|
|
38 |
/**
|
|
39 |
* Secure variant
|
|
40 |
* Much simpler, uses the new Rendezvous() call to sync with the client
|
|
41 |
*/
|
|
42 |
{
|
|
43 |
TInt result = StartC32();
|
|
44 |
if (result != KErrNone && result != KErrAlreadyExists)
|
|
45 |
{
|
|
46 |
User::Leave(result);
|
|
47 |
}
|
|
48 |
|
|
49 |
CActiveScheduler* sched=NULL;
|
|
50 |
sched=new(ELeave) CActiveScheduler;
|
|
51 |
CActiveScheduler::Install(sched);
|
|
52 |
|
|
53 |
|
|
54 |
// Create the CTestServer derived server
|
|
55 |
CSimDataTestServer* testServer = NULL;
|
|
56 |
TRAPD(err,testServer = CSimDataTestServer::NewL());
|
|
57 |
if(!err)
|
|
58 |
{
|
|
59 |
// Sync with the client and enter the active scheduler
|
|
60 |
RProcess::Rendezvous(KErrNone);
|
|
61 |
sched->Start();
|
|
62 |
}
|
|
63 |
delete testServer;
|
|
64 |
delete sched;
|
|
65 |
}
|
|
66 |
|
|
67 |
GLDEF_C TInt E32Main()
|
|
68 |
/**
|
|
69 |
* @return - Standard Epoc error code on process exit
|
|
70 |
* Secure variant only
|
|
71 |
* Process entry point. Called by client using RProcess API
|
|
72 |
*/
|
|
73 |
{
|
|
74 |
__UHEAP_MARK;
|
|
75 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
76 |
if(cleanup == NULL)
|
|
77 |
{
|
|
78 |
return KErrNoMemory;
|
|
79 |
}
|
|
80 |
TRAPD(err,MainL());
|
|
81 |
delete cleanup;
|
|
82 |
__UHEAP_MARKEND;
|
|
83 |
return err;
|
|
84 |
}
|
|
85 |
|
|
86 |
CTestStep* CSimDataTestServer::CreateTestStep(const TDesC& aStepName)
|
|
87 |
/**
|
|
88 |
* @return - A CTestStep derived instance
|
|
89 |
* Secure and non-secure variants
|
|
90 |
* Implementation of CTestServer pure virtual
|
|
91 |
*/
|
|
92 |
{
|
|
93 |
CTestStep* testStep = NULL;
|
|
94 |
|
|
95 |
if(aStepName == _L("TestLineStatusIncommingCall"))
|
|
96 |
{
|
|
97 |
testStep = new CTestLineStatusIncommingCall();
|
|
98 |
}
|
|
99 |
else if(aStepName == _L("TestLineStatusOutgoingCall"))
|
|
100 |
{
|
|
101 |
testStep = new CTestLineStatusOutgoingCall();
|
|
102 |
}
|
|
103 |
else if(aStepName == _L("TestLineInfo"))
|
|
104 |
{
|
|
105 |
testStep = new CTestLineInfo();
|
|
106 |
}
|
|
107 |
else if(aStepName == _L("TestLineNotificationsIncommingCall"))
|
|
108 |
{
|
|
109 |
testStep = new CTestLineNotificationsIncommingCall();
|
|
110 |
}
|
|
111 |
else if(aStepName == _L("TestLineNotificationsOutgoingCall"))
|
|
112 |
{
|
|
113 |
testStep = new CTestLineNotificationsOutgoingCall();
|
|
114 |
}
|
|
115 |
else if(aStepName == _L("TestLineCancels"))
|
|
116 |
{
|
|
117 |
testStep = new CTestLineCancels();
|
|
118 |
}
|
|
119 |
else if(aStepName == _L("TestCallInfo"))
|
|
120 |
{
|
|
121 |
testStep = new CTestCallInfo();
|
|
122 |
}
|
|
123 |
else if(aStepName == _L("TestCallNotifications"))
|
|
124 |
{
|
|
125 |
testStep = new CTestCallNotifications();
|
|
126 |
}
|
|
127 |
else if(aStepName == _L("TestCallStatusIncommingCall"))
|
|
128 |
{
|
|
129 |
testStep = new CTestCallStatusIncommingCall();
|
|
130 |
}
|
|
131 |
else if(aStepName == _L("TestCallStatusOutgoingCall"))
|
|
132 |
{
|
|
133 |
testStep = new CTestCallStatusOutgoingCall() ;
|
|
134 |
}
|
|
135 |
else if(aStepName == _L("TestCallCancels"))
|
|
136 |
{
|
|
137 |
testStep = new CTestCallCancels() ;
|
|
138 |
}
|
|
139 |
else if(aStepName == _L("TestCallDuration"))
|
|
140 |
{
|
|
141 |
testStep = new CTestCallDuration() ;
|
|
142 |
}
|
|
143 |
else if(aStepName == _L("TestRemoteHangup"))
|
|
144 |
{
|
|
145 |
testStep = new CTestRemoteHangup() ;
|
|
146 |
}
|
|
147 |
|
|
148 |
return testStep;
|
|
149 |
}
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|