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_SimSSTestStepBase.h"
|
|
17 |
|
|
18 |
TVerdict CSimSSTestStepBase::doTestStepPreambleL()
|
|
19 |
{
|
|
20 |
__UHEAP_MARK;
|
|
21 |
|
|
22 |
TInt ret = iTelServer.Connect();
|
|
23 |
if (ret!=KErrNone)
|
|
24 |
{
|
|
25 |
INFO_PRINTF1(_L("Failed to connect to telephony server"));
|
|
26 |
User::Leave(ret);
|
|
27 |
}
|
|
28 |
ret=iTelServer.LoadPhoneModule(KSimtsyName);
|
|
29 |
if (ret!=KErrNone)
|
|
30 |
{
|
|
31 |
INFO_PRINTF1(_L("Failed to load phone module"));
|
|
32 |
iTelServer.Close();
|
|
33 |
User::Leave(ret);
|
|
34 |
}
|
|
35 |
|
|
36 |
ret=iPhone.Open(iTelServer,KPhoneName) ;
|
|
37 |
if (ret!=KErrNone)
|
|
38 |
{
|
|
39 |
INFO_PRINTF1(_L("Failed to open phone module"));
|
|
40 |
iTelServer.UnloadPhoneModule(KSimtsyName);
|
|
41 |
iTelServer.Close();
|
|
42 |
User::Leave(ret);
|
|
43 |
}
|
|
44 |
ret=iPhone.Initialise();
|
|
45 |
if (ret!=KErrNone)
|
|
46 |
{
|
|
47 |
INFO_PRINTF1(_L("Failed to initialise the phone"));
|
|
48 |
iPhone.Close();
|
|
49 |
iTelServer.UnloadPhoneModule(KSimtsyName);
|
|
50 |
iTelServer.Close();
|
|
51 |
User::Leave(ret);
|
|
52 |
}
|
|
53 |
|
|
54 |
RPhone::TCaps phoneCaps;
|
|
55 |
ret = iPhone.GetCaps(phoneCaps) ;
|
|
56 |
if ((KErrNone != ret) || !(phoneCaps.iFlags & RPhone::KCapsVoice))
|
|
57 |
{
|
|
58 |
INFO_PRINTF2(_L("This phone does not support Voice Calls (caps=0x%x)"), phoneCaps.iFlags);
|
|
59 |
iPhone.Close();
|
|
60 |
iTelServer.UnloadPhoneModule(KSimtsyName);
|
|
61 |
iTelServer.Close();
|
|
62 |
User::Leave(ret);
|
|
63 |
}
|
|
64 |
|
|
65 |
return TestStepResult();
|
|
66 |
}
|
|
67 |
|
|
68 |
TVerdict CSimSSTestStepBase::doTestStepPostambleL()
|
|
69 |
{
|
|
70 |
iPhone.Close();
|
|
71 |
iTelServer.UnloadPhoneModule(KSimtsyName);
|
|
72 |
iTelServer.Close();
|
|
73 |
|
|
74 |
__UHEAP_MARKEND;
|
|
75 |
return TestStepResult();
|
|
76 |
}
|
|
77 |
|
|
78 |
void CSimSSTestStepBase::CleanUp(TAny *aPtr)
|
|
79 |
/**
|
|
80 |
* Calls iLine.Close() & iCall.Close in leave case.
|
|
81 |
* @param this poiter pass cleanup stack when calls the function
|
|
82 |
*/
|
|
83 |
{
|
|
84 |
CSimSSTestStepBase* ptr = ((CSimSSTestStepBase*)aPtr) ;
|
|
85 |
ptr->iCall.Close() ;
|
|
86 |
ptr->iLine.Close() ;
|
|
87 |
}
|
|
88 |
|
|
89 |
void CSimSSTestStepBase::SetTestNumberL(TInt aTestNumber)
|
|
90 |
{
|
|
91 |
iPhone.Close();
|
|
92 |
|
|
93 |
INFO_PRINTF2(_L("Changing the Test Number to %d"),aTestNumber);
|
|
94 |
|
|
95 |
TInt ret = RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, aTestNumber);
|
|
96 |
if (ret != KErrNone)
|
|
97 |
{
|
|
98 |
INFO_PRINTF1(_L("Failed setting test number"));
|
|
99 |
User::Leave(ret);
|
|
100 |
}
|
|
101 |
|
|
102 |
ret=iPhone.Open(iTelServer,KPhoneName) ;
|
|
103 |
if (ret!=KErrNone)
|
|
104 |
{
|
|
105 |
INFO_PRINTF1(_L("Failed to open phone module"));
|
|
106 |
iTelServer.UnloadPhoneModule(KSimtsyName);
|
|
107 |
iTelServer.Close();
|
|
108 |
User::Leave(ret);
|
|
109 |
}
|
|
110 |
ret=iPhone.Initialise();
|
|
111 |
if (ret!=KErrNone)
|
|
112 |
{
|
|
113 |
INFO_PRINTF1(_L("Failed to initialise the phone"));
|
|
114 |
iPhone.Close();
|
|
115 |
iTelServer.UnloadPhoneModule(KSimtsyName);
|
|
116 |
iTelServer.Close();
|
|
117 |
User::Leave(ret);
|
|
118 |
}
|
|
119 |
}
|
|
120 |
|