sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "T_TCommConfigV01Data.h"
|
sl@0
|
19 |
|
sl@0
|
20 |
/*@{*/
|
sl@0
|
21 |
_LIT(KStrNull, " ");
|
sl@0
|
22 |
|
sl@0
|
23 |
_LIT(KCmdConstructor, "new");
|
sl@0
|
24 |
_LIT(KCmdDestructor, "~");
|
sl@0
|
25 |
_LIT(KCmdiDataBits, "iDataBits");
|
sl@0
|
26 |
_LIT(KCmdiFifo, "iFifo");
|
sl@0
|
27 |
_LIT(KCmdiHandshake, "iHandshake");
|
sl@0
|
28 |
_LIT(KCmdiParity, "iParity");
|
sl@0
|
29 |
_LIT(KCmdiParityError, "iParityError");
|
sl@0
|
30 |
_LIT(KCmdiParityErrorChar, "iParityErrorChar");
|
sl@0
|
31 |
_LIT(KCmdiRate, "iRate");
|
sl@0
|
32 |
_LIT(KCmdiSIREnable, "iSIREnable");
|
sl@0
|
33 |
_LIT(KCmdiSIRSettings, "iSIRSettings");
|
sl@0
|
34 |
_LIT(KCmdiSpecialRate, "iSpecialRate");
|
sl@0
|
35 |
_LIT(KCmdiStopBits, "iStopBits");
|
sl@0
|
36 |
_LIT(KCmdiTerminator, "iTerminator");
|
sl@0
|
37 |
_LIT(KCmdiTerminatorCount, "iTerminatorCount");
|
sl@0
|
38 |
_LIT(KCmdiXoffChar, "iXoffChar");
|
sl@0
|
39 |
_LIT(KCmdiXonChar, "iXonChar");
|
sl@0
|
40 |
|
sl@0
|
41 |
_LIT(KFldExpected, "expected");
|
sl@0
|
42 |
_LIT(KFldExpectedIndex, "expected%d");
|
sl@0
|
43 |
_LIT(KFldValue, "value");
|
sl@0
|
44 |
_LIT(KFldValueIndex, "value%d");
|
sl@0
|
45 |
|
sl@0
|
46 |
_LIT(KLogError, "Error=%d");
|
sl@0
|
47 |
_LIT(KLogErrorExpectedValue, "Expected Value does not match actual");
|
sl@0
|
48 |
/*@}*/
|
sl@0
|
49 |
|
sl@0
|
50 |
_LIT(KStrEData5, "EData5");
|
sl@0
|
51 |
_LIT(KStrEData6, "EData6");
|
sl@0
|
52 |
_LIT(KStrEData7, "EData7");
|
sl@0
|
53 |
_LIT(KStrEData8, "EData8");
|
sl@0
|
54 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableDataBits[] =
|
sl@0
|
55 |
{
|
sl@0
|
56 |
// Enum as a descriptor Enum
|
sl@0
|
57 |
KStrEData5, EData5,
|
sl@0
|
58 |
KStrEData6, EData6,
|
sl@0
|
59 |
KStrEData7, EData7,
|
sl@0
|
60 |
KStrEData8, EData8,
|
sl@0
|
61 |
KStrNull, -1
|
sl@0
|
62 |
};
|
sl@0
|
63 |
|
sl@0
|
64 |
_LIT(KStrEFifoEnable, "EFifoEnable");
|
sl@0
|
65 |
_LIT(KStrEFifoDisable, "KStrEFifoDisable");
|
sl@0
|
66 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableFifo[] =
|
sl@0
|
67 |
{
|
sl@0
|
68 |
// Enum as a descriptor Enum
|
sl@0
|
69 |
KStrEFifoEnable, EFifoEnable,
|
sl@0
|
70 |
KStrEFifoDisable, EFifoDisable,
|
sl@0
|
71 |
KStrNull, -1
|
sl@0
|
72 |
};
|
sl@0
|
73 |
|
sl@0
|
74 |
_LIT(KStrKConfigObeyXoff, "KConfigObeyXoff");
|
sl@0
|
75 |
_LIT(KStrKConfigSendXoff, "KConfigSendXoff");
|
sl@0
|
76 |
_LIT(KStrKConfigObeyCTS, "KConfigObeyCTS");
|
sl@0
|
77 |
_LIT(KStrKConfigFailCTS, "KConfigFailCTS");
|
sl@0
|
78 |
_LIT(KStrKConfigObeyDSR, "KConfigObeyDSR");
|
sl@0
|
79 |
_LIT(KStrKConfigFailDSR, "KConfigFailDSR");
|
sl@0
|
80 |
_LIT(KStrKConfigObeyDCD, "KConfigObeyDCD");
|
sl@0
|
81 |
_LIT(KStrKConfigFailDCD, "KConfigFailDCD");
|
sl@0
|
82 |
_LIT(KStrKConfigFreeRTS, "KConfigFreeRTS");
|
sl@0
|
83 |
_LIT(KStrKConfigFreeDTR, "KConfigFreeDTR");
|
sl@0
|
84 |
_LIT(KStrKConfigObeyDTR, "KConfigObeyDTR");
|
sl@0
|
85 |
_LIT(KStrKConfigFailDTR, "KConfigFailDTR");
|
sl@0
|
86 |
_LIT(KStrKConfigObeyRTS, "KConfigObeyRTS");
|
sl@0
|
87 |
_LIT(KStrKConfigFailRTS, "KConfigFailRTS");
|
sl@0
|
88 |
_LIT(KStrKConfigFreeDSR, "KConfigFreeDSR");
|
sl@0
|
89 |
_LIT(KStrKConfigFreeCTS, "KConfigFreeCTS");
|
sl@0
|
90 |
_LIT(KStrKConfigFreeDCD, "KConfigFreeDCD");
|
sl@0
|
91 |
_LIT(KStrKConfigFreeRI, "KConfigFreeRI");
|
sl@0
|
92 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableHandshake[] =
|
sl@0
|
93 |
{
|
sl@0
|
94 |
// Enum as a descriptor Enum
|
sl@0
|
95 |
KStrKConfigObeyXoff, KConfigObeyXoff,
|
sl@0
|
96 |
KStrKConfigSendXoff, KConfigSendXoff,
|
sl@0
|
97 |
KStrKConfigObeyCTS, KConfigObeyCTS,
|
sl@0
|
98 |
KStrKConfigFailCTS, KConfigFailCTS,
|
sl@0
|
99 |
KStrKConfigObeyDSR, KConfigObeyDSR,
|
sl@0
|
100 |
KStrKConfigFailDSR, KConfigFailDSR,
|
sl@0
|
101 |
KStrKConfigObeyDCD, KConfigObeyDCD,
|
sl@0
|
102 |
KStrKConfigFailDCD, KConfigFailDCD,
|
sl@0
|
103 |
KStrKConfigFreeRTS, KConfigFreeRTS,
|
sl@0
|
104 |
KStrKConfigFreeDTR, KConfigFreeDTR,
|
sl@0
|
105 |
KStrKConfigObeyDTR, KConfigObeyDTR,
|
sl@0
|
106 |
KStrKConfigFailDTR, KConfigFailDTR,
|
sl@0
|
107 |
KStrKConfigObeyRTS, KConfigObeyRTS,
|
sl@0
|
108 |
KStrKConfigFailRTS, KConfigFailRTS,
|
sl@0
|
109 |
KStrKConfigFreeDSR, KConfigFreeDSR,
|
sl@0
|
110 |
KStrKConfigFreeCTS, KConfigFreeCTS,
|
sl@0
|
111 |
KStrKConfigFreeDCD, KConfigFreeDCD,
|
sl@0
|
112 |
KStrKConfigFreeRI, KConfigFreeRI,
|
sl@0
|
113 |
KStrNull, -1
|
sl@0
|
114 |
};
|
sl@0
|
115 |
|
sl@0
|
116 |
_LIT(KStrEParityNone, "EParityNone");
|
sl@0
|
117 |
_LIT(KStrEParityEven, "EParityEven");
|
sl@0
|
118 |
_LIT(KStrEParityOdd, "EParityOdd");
|
sl@0
|
119 |
_LIT(KStrEParityMark, "EParityMark");
|
sl@0
|
120 |
_LIT(KStrEParitySpace, "EParitySpace");
|
sl@0
|
121 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableParity[] =
|
sl@0
|
122 |
{
|
sl@0
|
123 |
// Enum as a descriptor Enum
|
sl@0
|
124 |
KStrEParityNone, EParityNone,
|
sl@0
|
125 |
KStrEParityEven, EParityEven,
|
sl@0
|
126 |
KStrEParityOdd, EParityOdd,
|
sl@0
|
127 |
KStrEParityMark, EParityMark,
|
sl@0
|
128 |
KStrEParitySpace, EParitySpace,
|
sl@0
|
129 |
KStrNull, -1
|
sl@0
|
130 |
};
|
sl@0
|
131 |
|
sl@0
|
132 |
_LIT(KStrKConfigParityErrorFail, "KConfigParityErrorFail");
|
sl@0
|
133 |
_LIT(KStrKConfigParityErrorIgnore, "KConfigParityErrorIgnore");
|
sl@0
|
134 |
_LIT(KStrKConfigParityErrorReplaceChar, "KConfigParityErrorReplaceChar");
|
sl@0
|
135 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableParityError[] =
|
sl@0
|
136 |
{
|
sl@0
|
137 |
// Enum as a descriptor Enum
|
sl@0
|
138 |
KStrKConfigParityErrorFail, KConfigParityErrorFail,
|
sl@0
|
139 |
KStrKConfigParityErrorIgnore, KConfigParityErrorIgnore,
|
sl@0
|
140 |
KStrKConfigParityErrorReplaceChar, KConfigParityErrorReplaceChar,
|
sl@0
|
141 |
KStrNull, -1
|
sl@0
|
142 |
};
|
sl@0
|
143 |
|
sl@0
|
144 |
_LIT(KStrEBps50, "EBps50");
|
sl@0
|
145 |
_LIT(KStrEBps75, "EBps75");
|
sl@0
|
146 |
_LIT(KStrEBps110, "EBps110");
|
sl@0
|
147 |
_LIT(KStrEBps134, "EBps134");
|
sl@0
|
148 |
_LIT(KStrEBps150, "EBps150");
|
sl@0
|
149 |
_LIT(KStrEBps300, "EBps300");
|
sl@0
|
150 |
_LIT(KStrEBps600, "EBps600");
|
sl@0
|
151 |
_LIT(KStrEBps1200, "EBps1200");
|
sl@0
|
152 |
_LIT(KStrEBps1800, "EBps1800");
|
sl@0
|
153 |
_LIT(KStrEBps2000, "EBps2000");
|
sl@0
|
154 |
_LIT(KStrEBps2400, "EBps2400");
|
sl@0
|
155 |
_LIT(KStrEBps3600, "EBps3600");
|
sl@0
|
156 |
_LIT(KStrEBps4800, "EBps4800");
|
sl@0
|
157 |
_LIT(KStrEBps7200, "EBps7200");
|
sl@0
|
158 |
_LIT(KStrEBps9600, "EBps9600");
|
sl@0
|
159 |
_LIT(KStrEBps19200, "EBps19200");
|
sl@0
|
160 |
_LIT(KStrEBps38400, "EBps38400");
|
sl@0
|
161 |
_LIT(KStrEBps57600, "EBps57600");
|
sl@0
|
162 |
_LIT(KStrEBps115200, "EBps115200");
|
sl@0
|
163 |
_LIT(KStrEBps230400, "EBps230400");
|
sl@0
|
164 |
_LIT(KStrEBps460800, "EBps460800");
|
sl@0
|
165 |
_LIT(KStrEBps576000, "EBps576000");
|
sl@0
|
166 |
_LIT(KStrEBps1152000, "EBps1152000");
|
sl@0
|
167 |
_LIT(KStrEBps4000000, "EBps4000000");
|
sl@0
|
168 |
_LIT(KStrEBps921600, "EBps921600");
|
sl@0
|
169 |
_LIT(KStrEBpsAutobaud, "EBpsAutobaud");
|
sl@0
|
170 |
_LIT(KStrEBpsSpecial, "EBpsSpecial");
|
sl@0
|
171 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableRate[] =
|
sl@0
|
172 |
{
|
sl@0
|
173 |
// Enum as a descriptor Enum
|
sl@0
|
174 |
KStrEBps50, EBps50,
|
sl@0
|
175 |
KStrEBps75, EBps75,
|
sl@0
|
176 |
KStrEBps110, EBps110,
|
sl@0
|
177 |
KStrEBps134, EBps134,
|
sl@0
|
178 |
KStrEBps150, EBps150,
|
sl@0
|
179 |
KStrEBps300, EBps300,
|
sl@0
|
180 |
KStrEBps600, EBps600,
|
sl@0
|
181 |
KStrEBps1200, EBps1200,
|
sl@0
|
182 |
KStrEBps1800, EBps1800,
|
sl@0
|
183 |
KStrEBps2000, EBps2000,
|
sl@0
|
184 |
KStrEBps2400, EBps2400,
|
sl@0
|
185 |
KStrEBps3600, EBps3600,
|
sl@0
|
186 |
KStrEBps4800, EBps4800,
|
sl@0
|
187 |
KStrEBps7200, EBps7200,
|
sl@0
|
188 |
KStrEBps9600, EBps9600,
|
sl@0
|
189 |
KStrEBps19200, EBps19200,
|
sl@0
|
190 |
KStrEBps38400, EBps38400,
|
sl@0
|
191 |
KStrEBps57600, EBps57600,
|
sl@0
|
192 |
KStrEBps115200, EBps115200,
|
sl@0
|
193 |
KStrEBps230400, EBps230400,
|
sl@0
|
194 |
KStrEBps460800, EBps460800,
|
sl@0
|
195 |
KStrEBps576000, EBps576000,
|
sl@0
|
196 |
KStrEBps1152000, EBps1152000,
|
sl@0
|
197 |
KStrEBps4000000, EBps4000000,
|
sl@0
|
198 |
KStrEBps921600, EBps921600,
|
sl@0
|
199 |
KStrEBpsAutobaud, EBpsAutobaud,
|
sl@0
|
200 |
KStrEBpsSpecial, EBpsSpecial,
|
sl@0
|
201 |
KStrNull, -1
|
sl@0
|
202 |
};
|
sl@0
|
203 |
|
sl@0
|
204 |
_LIT(KStrESIREnable, "ESIREnable");
|
sl@0
|
205 |
_LIT(KStrESIRDisable, "ESIRDisable");
|
sl@0
|
206 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableSir[] =
|
sl@0
|
207 |
{
|
sl@0
|
208 |
// Enum as a descriptor Enum
|
sl@0
|
209 |
KStrESIREnable, ESIREnable,
|
sl@0
|
210 |
KStrESIRDisable, ESIRDisable,
|
sl@0
|
211 |
KStrNull, -1
|
sl@0
|
212 |
};
|
sl@0
|
213 |
|
sl@0
|
214 |
_LIT(KStrKConfigSIRPulseWidthMaximum, "KConfigSIRPulseWidthMaximum");
|
sl@0
|
215 |
_LIT(KStrKConfigSIRPulseWidthMinimum, "KConfigSIRPulseWidthMinimum");
|
sl@0
|
216 |
_LIT(KStrKConfigSIRShutDown, "KConfigSIRShutDown");
|
sl@0
|
217 |
_LIT(KStrKConfigSIRMinimumRange, "KConfigSIRMinimumRange");
|
sl@0
|
218 |
_LIT(KStrKConfigSIRMediumRange, "KConfigSIRMediumRange");
|
sl@0
|
219 |
_LIT(KStrKConfigSIRMaximumRange, "KConfigSIRMaximumRange");
|
sl@0
|
220 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableSirSetting[] =
|
sl@0
|
221 |
{
|
sl@0
|
222 |
// Enum as a descriptor Enum
|
sl@0
|
223 |
KStrKConfigSIRPulseWidthMaximum, KConfigSIRPulseWidthMaximum,
|
sl@0
|
224 |
KStrKConfigSIRPulseWidthMinimum, KConfigSIRPulseWidthMinimum,
|
sl@0
|
225 |
KStrKConfigSIRShutDown, KConfigSIRShutDown,
|
sl@0
|
226 |
KStrKConfigSIRMinimumRange, KConfigSIRMinimumRange,
|
sl@0
|
227 |
KStrKConfigSIRMediumRange, KConfigSIRMediumRange,
|
sl@0
|
228 |
KStrKConfigSIRMaximumRange, KConfigSIRMaximumRange,
|
sl@0
|
229 |
KStrNull, -1
|
sl@0
|
230 |
};
|
sl@0
|
231 |
|
sl@0
|
232 |
_LIT(KStrEStop1, "EStop1");
|
sl@0
|
233 |
_LIT(KStrEStop2, "EStop2");
|
sl@0
|
234 |
const CDataWrapperBase::TEnumEntryTable CT_TCommConfigV01Data::iEnumTableStopBits[] =
|
sl@0
|
235 |
{
|
sl@0
|
236 |
// Enum as a descriptor Enum
|
sl@0
|
237 |
KStrEStop1, EStop1,
|
sl@0
|
238 |
KStrEStop2, EStop2,
|
sl@0
|
239 |
KStrNull, -1
|
sl@0
|
240 |
};
|
sl@0
|
241 |
|
sl@0
|
242 |
//////////////////////////////////////////////////////////////////////
|
sl@0
|
243 |
// Construction/Destruction
|
sl@0
|
244 |
//////////////////////////////////////////////////////////////////////
|
sl@0
|
245 |
|
sl@0
|
246 |
CT_TCommConfigV01Data::CT_TCommConfigV01Data()
|
sl@0
|
247 |
: CDataWrapperBase()
|
sl@0
|
248 |
, iCommConfig(NULL)
|
sl@0
|
249 |
{
|
sl@0
|
250 |
}
|
sl@0
|
251 |
|
sl@0
|
252 |
CT_TCommConfigV01Data::~CT_TCommConfigV01Data()
|
sl@0
|
253 |
/**
|
sl@0
|
254 |
* Public destructor
|
sl@0
|
255 |
*/
|
sl@0
|
256 |
{
|
sl@0
|
257 |
DestroyData();
|
sl@0
|
258 |
}
|
sl@0
|
259 |
|
sl@0
|
260 |
void CT_TCommConfigV01Data::DestroyData()
|
sl@0
|
261 |
{
|
sl@0
|
262 |
delete iCommConfig;
|
sl@0
|
263 |
iCommConfig=NULL;
|
sl@0
|
264 |
}
|
sl@0
|
265 |
|
sl@0
|
266 |
TDes8* CT_TCommConfigV01Data::Descriptor()
|
sl@0
|
267 |
/**
|
sl@0
|
268 |
* Return a pointer to the buffer
|
sl@0
|
269 |
*
|
sl@0
|
270 |
* @return pointer to the buffer
|
sl@0
|
271 |
*/
|
sl@0
|
272 |
{
|
sl@0
|
273 |
return iCommConfig;
|
sl@0
|
274 |
}
|
sl@0
|
275 |
|
sl@0
|
276 |
TAny* CT_TCommConfigV01Data::GetObject()
|
sl@0
|
277 |
/**
|
sl@0
|
278 |
* Return a pointer to the object that the data wraps
|
sl@0
|
279 |
*
|
sl@0
|
280 |
* @return pointer to the object that the data wraps
|
sl@0
|
281 |
*/
|
sl@0
|
282 |
{
|
sl@0
|
283 |
return iCommConfig;
|
sl@0
|
284 |
}
|
sl@0
|
285 |
|
sl@0
|
286 |
TBool CT_TCommConfigV01Data::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
|
sl@0
|
287 |
/**
|
sl@0
|
288 |
* Process a command read from the ini file
|
sl@0
|
289 |
*
|
sl@0
|
290 |
* @param aCommand The command to process
|
sl@0
|
291 |
* @param aSection The section in the ini containing data for the command
|
sl@0
|
292 |
* @param aAsyncErrorIndex Command index for async calls to return errors to
|
sl@0
|
293 |
*
|
sl@0
|
294 |
* @return ETrue if the command is processed
|
sl@0
|
295 |
*
|
sl@0
|
296 |
* @leave System wide error
|
sl@0
|
297 |
*/
|
sl@0
|
298 |
{
|
sl@0
|
299 |
TBool ret=ETrue;
|
sl@0
|
300 |
TInt err=KErrNone;
|
sl@0
|
301 |
|
sl@0
|
302 |
if ( aCommand==KCmdConstructor )
|
sl@0
|
303 |
{
|
sl@0
|
304 |
err=DoCmdConstructor();
|
sl@0
|
305 |
}
|
sl@0
|
306 |
else if ( aCommand==KCmdDestructor )
|
sl@0
|
307 |
{
|
sl@0
|
308 |
DoCmdDestructor();
|
sl@0
|
309 |
}
|
sl@0
|
310 |
else if ( aCommand==KCmdiDataBits )
|
sl@0
|
311 |
{
|
sl@0
|
312 |
DoCmdiDataBits(aSection);
|
sl@0
|
313 |
}
|
sl@0
|
314 |
else if ( aCommand==KCmdiFifo )
|
sl@0
|
315 |
{
|
sl@0
|
316 |
DoCmdiFifo(aSection);
|
sl@0
|
317 |
}
|
sl@0
|
318 |
else if ( aCommand==KCmdiHandshake )
|
sl@0
|
319 |
{
|
sl@0
|
320 |
DoCmdiHandshake(aSection);
|
sl@0
|
321 |
}
|
sl@0
|
322 |
else if ( aCommand==KCmdiParity )
|
sl@0
|
323 |
{
|
sl@0
|
324 |
DoCmdiParity(aSection);
|
sl@0
|
325 |
}
|
sl@0
|
326 |
else if ( aCommand==KCmdiParityError )
|
sl@0
|
327 |
{
|
sl@0
|
328 |
DoCmdiParityError(aSection);
|
sl@0
|
329 |
}
|
sl@0
|
330 |
else if ( aCommand==KCmdiParityErrorChar )
|
sl@0
|
331 |
{
|
sl@0
|
332 |
DoCmdiParityErrorChar(aSection);
|
sl@0
|
333 |
}
|
sl@0
|
334 |
else if ( aCommand==KCmdiRate )
|
sl@0
|
335 |
{
|
sl@0
|
336 |
DoCmdiRate(aSection);
|
sl@0
|
337 |
}
|
sl@0
|
338 |
else if ( aCommand==KCmdiSIREnable )
|
sl@0
|
339 |
{
|
sl@0
|
340 |
DoCmdiSIREnable(aSection);
|
sl@0
|
341 |
}
|
sl@0
|
342 |
else if ( aCommand==KCmdiSIRSettings )
|
sl@0
|
343 |
{
|
sl@0
|
344 |
DoCmdiSIRSettings(aSection);
|
sl@0
|
345 |
}
|
sl@0
|
346 |
else if ( aCommand==KCmdiSpecialRate )
|
sl@0
|
347 |
{
|
sl@0
|
348 |
DoCmdiSpecialRate(aSection);
|
sl@0
|
349 |
}
|
sl@0
|
350 |
else if ( aCommand==KCmdiStopBits )
|
sl@0
|
351 |
{
|
sl@0
|
352 |
DoCmdiStopBits(aSection);
|
sl@0
|
353 |
}
|
sl@0
|
354 |
else if ( aCommand==KCmdiTerminator )
|
sl@0
|
355 |
{
|
sl@0
|
356 |
DoCmdiTerminator(aSection);
|
sl@0
|
357 |
}
|
sl@0
|
358 |
else if ( aCommand==KCmdiTerminatorCount )
|
sl@0
|
359 |
{
|
sl@0
|
360 |
DoCmdiTerminatorCount(aSection);
|
sl@0
|
361 |
}
|
sl@0
|
362 |
else if ( aCommand==KCmdiXoffChar )
|
sl@0
|
363 |
{
|
sl@0
|
364 |
DoCmdiXoffChar(aSection);
|
sl@0
|
365 |
}
|
sl@0
|
366 |
else if ( aCommand==KCmdiXonChar )
|
sl@0
|
367 |
{
|
sl@0
|
368 |
DoCmdiXonChar(aSection);
|
sl@0
|
369 |
}
|
sl@0
|
370 |
else
|
sl@0
|
371 |
{
|
sl@0
|
372 |
ret=CDataWrapperBase::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
|
sl@0
|
373 |
}
|
sl@0
|
374 |
|
sl@0
|
375 |
if ( err!=KErrNone )
|
sl@0
|
376 |
{
|
sl@0
|
377 |
ERR_PRINTF2(KLogError, err);
|
sl@0
|
378 |
SetError(err);
|
sl@0
|
379 |
}
|
sl@0
|
380 |
|
sl@0
|
381 |
return ret;
|
sl@0
|
382 |
}
|
sl@0
|
383 |
|
sl@0
|
384 |
TCommConfigV01& CT_TCommConfigV01Data::GetCommConfigV01()
|
sl@0
|
385 |
{
|
sl@0
|
386 |
return (*iCommConfig)();
|
sl@0
|
387 |
}
|
sl@0
|
388 |
|
sl@0
|
389 |
TInt CT_TCommConfigV01Data::DoCmdConstructor()
|
sl@0
|
390 |
{
|
sl@0
|
391 |
DestroyData();
|
sl@0
|
392 |
TRAPD(err, iCommConfig=new (ELeave) TCommConfig());
|
sl@0
|
393 |
iCommConfig->FillZ();
|
sl@0
|
394 |
return err;
|
sl@0
|
395 |
}
|
sl@0
|
396 |
|
sl@0
|
397 |
void CT_TCommConfigV01Data::DoCmdDestructor()
|
sl@0
|
398 |
{
|
sl@0
|
399 |
DestroyData();
|
sl@0
|
400 |
}
|
sl@0
|
401 |
|
sl@0
|
402 |
void CT_TCommConfigV01Data::DoCmdiDataBits(const TDesC& aSection)
|
sl@0
|
403 |
{
|
sl@0
|
404 |
TDataBits actual=GetCommConfigV01().iDataBits;
|
sl@0
|
405 |
INFO_PRINTF2(_L("iDataBits : %d"), actual);
|
sl@0
|
406 |
|
sl@0
|
407 |
TInt expected;
|
sl@0
|
408 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableDataBits, expected) )
|
sl@0
|
409 |
{
|
sl@0
|
410 |
if ( expected!=actual )
|
sl@0
|
411 |
{
|
sl@0
|
412 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
413 |
SetBlockResult(EFail);
|
sl@0
|
414 |
}
|
sl@0
|
415 |
}
|
sl@0
|
416 |
|
sl@0
|
417 |
TInt value;
|
sl@0
|
418 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableDataBits, value) )
|
sl@0
|
419 |
{
|
sl@0
|
420 |
GetCommConfigV01().iDataBits=(TDataBits)value;
|
sl@0
|
421 |
}
|
sl@0
|
422 |
}
|
sl@0
|
423 |
|
sl@0
|
424 |
void CT_TCommConfigV01Data::DoCmdiFifo(const TDesC& aSection)
|
sl@0
|
425 |
{
|
sl@0
|
426 |
TFifo actual=(TFifo)GetCommConfigV01().iFifo;
|
sl@0
|
427 |
INFO_PRINTF2(_L("iFifo : %d"), actual);
|
sl@0
|
428 |
|
sl@0
|
429 |
TInt expected;
|
sl@0
|
430 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableFifo, expected) )
|
sl@0
|
431 |
{
|
sl@0
|
432 |
if ( expected!=actual )
|
sl@0
|
433 |
{
|
sl@0
|
434 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
435 |
SetBlockResult(EFail);
|
sl@0
|
436 |
}
|
sl@0
|
437 |
}
|
sl@0
|
438 |
|
sl@0
|
439 |
TInt value;
|
sl@0
|
440 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableFifo, value) )
|
sl@0
|
441 |
{
|
sl@0
|
442 |
GetCommConfigV01().iFifo=(TUint)value;
|
sl@0
|
443 |
}
|
sl@0
|
444 |
}
|
sl@0
|
445 |
|
sl@0
|
446 |
void CT_TCommConfigV01Data::DoCmdiHandshake(const TDesC& aSection)
|
sl@0
|
447 |
{
|
sl@0
|
448 |
TUint actual=GetCommConfigV01().iHandshake;
|
sl@0
|
449 |
INFO_PRINTF2(_L("iHandshake : %d"), actual);
|
sl@0
|
450 |
|
sl@0
|
451 |
TUint expected;
|
sl@0
|
452 |
if ( GetOrFromConfig(aSection, KFldExpected(), iEnumTableHandshake, expected) )
|
sl@0
|
453 |
{
|
sl@0
|
454 |
if ( expected!=actual )
|
sl@0
|
455 |
{
|
sl@0
|
456 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
457 |
SetBlockResult(EFail);
|
sl@0
|
458 |
}
|
sl@0
|
459 |
}
|
sl@0
|
460 |
|
sl@0
|
461 |
TUint value;
|
sl@0
|
462 |
if ( GetOrFromConfig(aSection, KFldValue(), iEnumTableHandshake, value) )
|
sl@0
|
463 |
{
|
sl@0
|
464 |
GetCommConfigV01().iHandshake=value;
|
sl@0
|
465 |
}
|
sl@0
|
466 |
}
|
sl@0
|
467 |
|
sl@0
|
468 |
void CT_TCommConfigV01Data::DoCmdiParity(const TDesC& aSection)
|
sl@0
|
469 |
{
|
sl@0
|
470 |
TParity actual=GetCommConfigV01().iParity;
|
sl@0
|
471 |
INFO_PRINTF2(_L("iParity : %d"), actual);
|
sl@0
|
472 |
|
sl@0
|
473 |
TInt expected;
|
sl@0
|
474 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableParity, expected) )
|
sl@0
|
475 |
{
|
sl@0
|
476 |
if ( expected!=actual )
|
sl@0
|
477 |
{
|
sl@0
|
478 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
479 |
SetBlockResult(EFail);
|
sl@0
|
480 |
}
|
sl@0
|
481 |
}
|
sl@0
|
482 |
|
sl@0
|
483 |
TInt value;
|
sl@0
|
484 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableParity, value) )
|
sl@0
|
485 |
{
|
sl@0
|
486 |
GetCommConfigV01().iParity=(TParity)value;
|
sl@0
|
487 |
}
|
sl@0
|
488 |
}
|
sl@0
|
489 |
|
sl@0
|
490 |
void CT_TCommConfigV01Data::DoCmdiParityError(const TDesC& aSection)
|
sl@0
|
491 |
{
|
sl@0
|
492 |
TUint actual=GetCommConfigV01().iParityError;
|
sl@0
|
493 |
INFO_PRINTF2(_L("iParityError : %d"), actual);
|
sl@0
|
494 |
|
sl@0
|
495 |
TInt expected;
|
sl@0
|
496 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableParityError, expected) )
|
sl@0
|
497 |
{
|
sl@0
|
498 |
if ( expected!=(TInt)actual )
|
sl@0
|
499 |
{
|
sl@0
|
500 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
501 |
SetBlockResult(EFail);
|
sl@0
|
502 |
}
|
sl@0
|
503 |
}
|
sl@0
|
504 |
|
sl@0
|
505 |
TInt value;
|
sl@0
|
506 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableParityError, value) )
|
sl@0
|
507 |
{
|
sl@0
|
508 |
GetCommConfigV01().iParityError=(TUint)value;
|
sl@0
|
509 |
}
|
sl@0
|
510 |
}
|
sl@0
|
511 |
|
sl@0
|
512 |
void CT_TCommConfigV01Data::DoCmdiParityErrorChar(const TDesC& aSection)
|
sl@0
|
513 |
{
|
sl@0
|
514 |
TText8 actual=GetCommConfigV01().iParityErrorChar;
|
sl@0
|
515 |
INFO_PRINTF2(_L("iParityErrorChar : 0x%x"), (TUint)actual);
|
sl@0
|
516 |
|
sl@0
|
517 |
TInt expected;
|
sl@0
|
518 |
if ( GetHexFromConfig(aSection, KFldExpected(), expected) )
|
sl@0
|
519 |
{
|
sl@0
|
520 |
if ( expected!=(TInt)actual )
|
sl@0
|
521 |
{
|
sl@0
|
522 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
523 |
SetBlockResult(EFail);
|
sl@0
|
524 |
}
|
sl@0
|
525 |
}
|
sl@0
|
526 |
|
sl@0
|
527 |
TInt value;
|
sl@0
|
528 |
if ( GetHexFromConfig(aSection, KFldValue(), value) )
|
sl@0
|
529 |
{
|
sl@0
|
530 |
GetCommConfigV01().iParityErrorChar=(TText8)value;
|
sl@0
|
531 |
}
|
sl@0
|
532 |
}
|
sl@0
|
533 |
|
sl@0
|
534 |
void CT_TCommConfigV01Data::DoCmdiRate(const TDesC& aSection)
|
sl@0
|
535 |
{
|
sl@0
|
536 |
TBps actual=GetCommConfigV01().iRate;
|
sl@0
|
537 |
INFO_PRINTF2(_L("iRate : %d"), actual);
|
sl@0
|
538 |
|
sl@0
|
539 |
TInt expected;
|
sl@0
|
540 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableRate, expected) )
|
sl@0
|
541 |
{
|
sl@0
|
542 |
if ( expected!=(TInt)actual )
|
sl@0
|
543 |
{
|
sl@0
|
544 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
545 |
SetBlockResult(EFail);
|
sl@0
|
546 |
}
|
sl@0
|
547 |
}
|
sl@0
|
548 |
|
sl@0
|
549 |
TInt value;
|
sl@0
|
550 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableRate, value) )
|
sl@0
|
551 |
{
|
sl@0
|
552 |
GetCommConfigV01().iRate=(TBps)value;
|
sl@0
|
553 |
}
|
sl@0
|
554 |
}
|
sl@0
|
555 |
|
sl@0
|
556 |
void CT_TCommConfigV01Data::DoCmdiSIREnable(const TDesC& aSection)
|
sl@0
|
557 |
{
|
sl@0
|
558 |
TSir actual=GetCommConfigV01().iSIREnable;
|
sl@0
|
559 |
INFO_PRINTF2(_L("iSIREnable : %d"), actual);
|
sl@0
|
560 |
|
sl@0
|
561 |
TInt expected;
|
sl@0
|
562 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableSir, expected) )
|
sl@0
|
563 |
{
|
sl@0
|
564 |
if ( expected!=(TInt)actual )
|
sl@0
|
565 |
{
|
sl@0
|
566 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
567 |
SetBlockResult(EFail);
|
sl@0
|
568 |
}
|
sl@0
|
569 |
}
|
sl@0
|
570 |
|
sl@0
|
571 |
TInt value;
|
sl@0
|
572 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableSir, value) )
|
sl@0
|
573 |
{
|
sl@0
|
574 |
GetCommConfigV01().iSIREnable=(TSir)value;
|
sl@0
|
575 |
}
|
sl@0
|
576 |
}
|
sl@0
|
577 |
|
sl@0
|
578 |
void CT_TCommConfigV01Data::DoCmdiSIRSettings(const TDesC& aSection)
|
sl@0
|
579 |
{
|
sl@0
|
580 |
TUint actual=GetCommConfigV01().iSIRSettings;
|
sl@0
|
581 |
INFO_PRINTF2(_L("iSIRSettings : %d"), actual);
|
sl@0
|
582 |
|
sl@0
|
583 |
TInt expected;
|
sl@0
|
584 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableSirSetting, expected) )
|
sl@0
|
585 |
{
|
sl@0
|
586 |
if ( expected!=(TInt)actual )
|
sl@0
|
587 |
{
|
sl@0
|
588 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
589 |
SetBlockResult(EFail);
|
sl@0
|
590 |
}
|
sl@0
|
591 |
}
|
sl@0
|
592 |
|
sl@0
|
593 |
TInt value;
|
sl@0
|
594 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableSirSetting, value) )
|
sl@0
|
595 |
{
|
sl@0
|
596 |
GetCommConfigV01().iSIRSettings=(TUint)value;
|
sl@0
|
597 |
}
|
sl@0
|
598 |
}
|
sl@0
|
599 |
|
sl@0
|
600 |
void CT_TCommConfigV01Data::DoCmdiSpecialRate(const TDesC& aSection)
|
sl@0
|
601 |
{
|
sl@0
|
602 |
TInt actual=GetCommConfigV01().iSpecialRate;
|
sl@0
|
603 |
INFO_PRINTF2(_L("iSpecialRate : %d"), actual);
|
sl@0
|
604 |
|
sl@0
|
605 |
TInt expected;
|
sl@0
|
606 |
if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
|
sl@0
|
607 |
{
|
sl@0
|
608 |
if ( expected!=actual )
|
sl@0
|
609 |
{
|
sl@0
|
610 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
611 |
SetBlockResult(EFail);
|
sl@0
|
612 |
}
|
sl@0
|
613 |
}
|
sl@0
|
614 |
|
sl@0
|
615 |
TInt value;
|
sl@0
|
616 |
if ( GetIntFromConfig(aSection, KFldValue(), value) )
|
sl@0
|
617 |
{
|
sl@0
|
618 |
GetCommConfigV01().iSpecialRate=value;
|
sl@0
|
619 |
}
|
sl@0
|
620 |
}
|
sl@0
|
621 |
|
sl@0
|
622 |
void CT_TCommConfigV01Data::DoCmdiStopBits(const TDesC& aSection)
|
sl@0
|
623 |
{
|
sl@0
|
624 |
TStopBits actual=GetCommConfigV01().iStopBits;
|
sl@0
|
625 |
INFO_PRINTF2(_L("iStopBits : %d"), actual);
|
sl@0
|
626 |
|
sl@0
|
627 |
TInt expected;
|
sl@0
|
628 |
if ( GetEnumFromConfig(aSection, KFldExpected(), iEnumTableStopBits, expected) )
|
sl@0
|
629 |
{
|
sl@0
|
630 |
if ( expected!=actual )
|
sl@0
|
631 |
{
|
sl@0
|
632 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
633 |
SetBlockResult(EFail);
|
sl@0
|
634 |
}
|
sl@0
|
635 |
}
|
sl@0
|
636 |
|
sl@0
|
637 |
TInt value;
|
sl@0
|
638 |
if ( GetEnumFromConfig(aSection, KFldValue(), iEnumTableStopBits, value) )
|
sl@0
|
639 |
{
|
sl@0
|
640 |
GetCommConfigV01().iStopBits=(TStopBits)value;
|
sl@0
|
641 |
}
|
sl@0
|
642 |
}
|
sl@0
|
643 |
|
sl@0
|
644 |
void CT_TCommConfigV01Data::DoCmdiTerminator(const TDesC& aSection)
|
sl@0
|
645 |
{
|
sl@0
|
646 |
TBuf<KMaxTestExecuteCommandLength> tempStore;
|
sl@0
|
647 |
|
sl@0
|
648 |
for ( TInt index=0; index<KConfigMaxTerminators; ++index )
|
sl@0
|
649 |
{
|
sl@0
|
650 |
TText8 actual=GetCommConfigV01().iTerminator[index];
|
sl@0
|
651 |
INFO_PRINTF3(_L("iTerminator[%d] : 0x%x"), index, (TUint)actual);
|
sl@0
|
652 |
|
sl@0
|
653 |
tempStore.Format(KFldExpectedIndex(), index);
|
sl@0
|
654 |
TInt expected;
|
sl@0
|
655 |
if ( GetHexFromConfig(aSection, tempStore, expected) )
|
sl@0
|
656 |
{
|
sl@0
|
657 |
if ( expected!=(TInt)actual )
|
sl@0
|
658 |
{
|
sl@0
|
659 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
660 |
SetBlockResult(EFail);
|
sl@0
|
661 |
}
|
sl@0
|
662 |
}
|
sl@0
|
663 |
|
sl@0
|
664 |
tempStore.Format(KFldValueIndex(), index);
|
sl@0
|
665 |
TInt value;
|
sl@0
|
666 |
if ( GetHexFromConfig(aSection, tempStore, value) )
|
sl@0
|
667 |
{
|
sl@0
|
668 |
GetCommConfigV01().iTerminator[index]=(TText8)value;
|
sl@0
|
669 |
}
|
sl@0
|
670 |
}
|
sl@0
|
671 |
}
|
sl@0
|
672 |
|
sl@0
|
673 |
void CT_TCommConfigV01Data::DoCmdiTerminatorCount(const TDesC& aSection)
|
sl@0
|
674 |
{
|
sl@0
|
675 |
TInt actual=GetCommConfigV01().iTerminatorCount;
|
sl@0
|
676 |
INFO_PRINTF2(_L("iTerminatorCount : %d"), actual);
|
sl@0
|
677 |
|
sl@0
|
678 |
TInt expected;
|
sl@0
|
679 |
if ( GetIntFromConfig(aSection, KFldExpected(), expected) )
|
sl@0
|
680 |
{
|
sl@0
|
681 |
if ( expected!=actual )
|
sl@0
|
682 |
{
|
sl@0
|
683 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
684 |
SetBlockResult(EFail);
|
sl@0
|
685 |
}
|
sl@0
|
686 |
}
|
sl@0
|
687 |
|
sl@0
|
688 |
TInt value;
|
sl@0
|
689 |
if ( GetIntFromConfig(aSection, KFldValue(), value) )
|
sl@0
|
690 |
{
|
sl@0
|
691 |
GetCommConfigV01().iTerminatorCount=value;
|
sl@0
|
692 |
}
|
sl@0
|
693 |
}
|
sl@0
|
694 |
|
sl@0
|
695 |
void CT_TCommConfigV01Data::DoCmdiXoffChar(const TDesC& aSection)
|
sl@0
|
696 |
{
|
sl@0
|
697 |
TText8 actual=GetCommConfigV01().iXoffChar;
|
sl@0
|
698 |
INFO_PRINTF2(_L("iXoffChar : 0x%x"), (TUint)actual);
|
sl@0
|
699 |
|
sl@0
|
700 |
TInt expected;
|
sl@0
|
701 |
if ( GetHexFromConfig(aSection, KFldExpected(), expected) )
|
sl@0
|
702 |
{
|
sl@0
|
703 |
if ( expected!=(TInt)actual )
|
sl@0
|
704 |
{
|
sl@0
|
705 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
706 |
SetBlockResult(EFail);
|
sl@0
|
707 |
}
|
sl@0
|
708 |
}
|
sl@0
|
709 |
|
sl@0
|
710 |
TInt value;
|
sl@0
|
711 |
if ( GetHexFromConfig(aSection, KFldValue(), value) )
|
sl@0
|
712 |
{
|
sl@0
|
713 |
GetCommConfigV01().iXoffChar=(TText8)value;
|
sl@0
|
714 |
}
|
sl@0
|
715 |
}
|
sl@0
|
716 |
|
sl@0
|
717 |
void CT_TCommConfigV01Data::DoCmdiXonChar(const TDesC& aSection)
|
sl@0
|
718 |
{
|
sl@0
|
719 |
TText8 actual=GetCommConfigV01().iXonChar;
|
sl@0
|
720 |
INFO_PRINTF2(_L("iXonChar : 0x%x"), (TUint)actual);
|
sl@0
|
721 |
|
sl@0
|
722 |
TInt expected;
|
sl@0
|
723 |
if ( GetHexFromConfig(aSection, KFldExpected(), expected) )
|
sl@0
|
724 |
{
|
sl@0
|
725 |
if ( expected!=(TInt)actual )
|
sl@0
|
726 |
{
|
sl@0
|
727 |
ERR_PRINTF1(KLogErrorExpectedValue);
|
sl@0
|
728 |
SetBlockResult(EFail);
|
sl@0
|
729 |
}
|
sl@0
|
730 |
}
|
sl@0
|
731 |
|
sl@0
|
732 |
TInt value;
|
sl@0
|
733 |
if ( GetHexFromConfig(aSection, KFldValue(), value) )
|
sl@0
|
734 |
{
|
sl@0
|
735 |
GetCommConfigV01().iXonChar=(TText8)value;
|
sl@0
|
736 |
}
|
sl@0
|
737 |
}
|