1 /* |
|
2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: SetUpIdleModeText specific test class. Inherits CCommandBase. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <stifparser.h> |
|
22 #include "commandsetupidlemodetext.h" |
|
23 |
|
24 // CONSTANTS |
|
25 _LIT( KType, "Type" ); |
|
26 _LIT( KText, "Text" ); |
|
27 |
|
28 #ifndef LEGACY |
|
29 _LIT( KCodingScheme, "CodingScheme" ); |
|
30 #endif // LEGACY |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CCommandSetUpIdleModeText::CCommandSetUpIdleModeText |
|
34 // C++ default constructor can NOT contain any code, that |
|
35 // might leave. |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 CCommandSetUpIdleModeText::CCommandSetUpIdleModeText |
|
39 ( |
|
40 const TSatIpc aIpc, |
|
41 const RSat& aSat, |
|
42 CStifItemParser& aParser, |
|
43 CStifLogger& aLog |
|
44 ) : CSatCommandBase ( aIpc, aSat, aParser, aLog, RSat::ESetUpIdleModeText ), |
|
45 iDataPckg( iData ), |
|
46 iRspPckg( iRsp ) |
|
47 { |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CCommandSetUpIdleModeText::~CCommandSetUpIdleModeText |
|
52 // Destructor |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 CCommandSetUpIdleModeText::~CCommandSetUpIdleModeText() |
|
56 { |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CCommandSetUpIdleModeText::NotifySat |
|
61 // Send a notify request to Etel and clear internal data |
|
62 // (other items were commented in a header). |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 TInt CCommandSetUpIdleModeText::NotifySat |
|
66 ( |
|
67 TRequestStatus& aSimAtkStatus |
|
68 ) |
|
69 { |
|
70 TInt ret( KErrNone ); |
|
71 |
|
72 // Clear the package |
|
73 Init( iData ); |
|
74 Init( iRsp ); |
|
75 |
|
76 iSat.NotifySetUpIdleModeTextPCmd( aSimAtkStatus, iDataPckg ); |
|
77 |
|
78 return ret; |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // CCommandSetUpIdleModeText::CheckData |
|
83 // Verifies the validity of received command |
|
84 // (other items were commented in a header). |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 TInt CCommandSetUpIdleModeText::CheckData() |
|
88 { |
|
89 iLog.Log( _L( "CCommandSetUpIdleModeText::CheckData" ) ); |
|
90 |
|
91 TInt ret( KErrNone ); |
|
92 |
|
93 // Type, default "UpdateIdleModeText" |
|
94 if ( KErrNone != CheckValue( KType, iData.iType, |
|
95 RSat::EUpdateIdleModeText ) ) |
|
96 { |
|
97 ret = KErrCorrupt; |
|
98 } |
|
99 |
|
100 // Text |
|
101 if ( KErrNone != CheckText( KText, iData.iText ) ) |
|
102 { |
|
103 ret = KErrCorrupt; |
|
104 } |
|
105 |
|
106 // IconId |
|
107 if ( KErrCorrupt == CheckIcon( iData.iIconId ) ) |
|
108 { |
|
109 ret = KErrCorrupt; |
|
110 } |
|
111 |
|
112 #ifndef LEGACY |
|
113 // CodingScheme, default "16bit UCS2" |
|
114 if ( KErrNone != CheckValue( KCodingScheme, iData.iCodingScheme, |
|
115 RSat::E16bitUCS2 ) ) |
|
116 { |
|
117 ret = KErrCorrupt; |
|
118 } |
|
119 # endif // LEGACY |
|
120 |
|
121 return ret; |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CCommandSetUpIdleModeText::SendResponse |
|
126 // Creates terminal response according to scripted parameters |
|
127 // (other items were commented in a header). |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 TInt CCommandSetUpIdleModeText::SendResponse() |
|
131 { |
|
132 iLog.Log( _L( "CCommandSetUpIdleModeText::SendResponse" ) ); |
|
133 |
|
134 TInt ret( KErrNone ); |
|
135 |
|
136 // General result |
|
137 SetGeneralResult( iRsp.iGeneralResult ); |
|
138 |
|
139 // Additional info & type |
|
140 SetAdditionalInfo( iRsp.iInfoType, iRsp.iAdditionalInfo ); |
|
141 |
|
142 if ( KErrNone == ret ) |
|
143 { |
|
144 ret = CSatCommandBase::SendResponse( iRspPckg ); |
|
145 } |
|
146 |
|
147 return ret; |
|
148 } |
|
149 |
|
150 // End of File |
|