0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include <pn_obj_auto.h> // For PN_OBJ_EPOC_MONSERV_SERV
|
|
21 |
#include <isimsg.h> // For CIsiMsg
|
|
22 |
#include <isi_sos_bluetooth.h> // For CBtIsiMsg
|
|
23 |
#include <isi_call.h> // For CCallIsiMsg
|
|
24 |
#include <isi_sim.h> // For CSimIsiMsg
|
|
25 |
#include <isi_tone.h> // For CToneIsiMsg
|
|
26 |
#include <f32file.h> // For RDebug
|
|
27 |
#include "tisimsgerrcodestest.h" // For IsiMsgTestErrors
|
|
28 |
#include "tisimsghexstest.h" // For 0x00 etc..
|
|
29 |
#include "ctestlogger.h" // For CTestLogger
|
|
30 |
#include "tisimsgtestconstants.h"
|
|
31 |
#include "cisimsgbasetest.h"
|
|
32 |
|
|
33 |
// EXTERNAL DATA STRUCTURES
|
|
34 |
// None
|
|
35 |
|
|
36 |
// EXTERNAL FUNCTION PROTOTYPES
|
|
37 |
// None
|
|
38 |
|
|
39 |
// CONSTANTS
|
|
40 |
_LIT( KOpen, "CIsiMsgBaseTest::OpenIsaApiAndGetIsiMsgL" );
|
|
41 |
_LIT( KReceive, "CIsiMsgBaseTest::ReceiveIsiMsgL" );
|
|
42 |
_LIT( KSend, "CIsiMsgBaseTest::SendIsiMsgL" );
|
|
43 |
_LIT( KSendError, "*** Send: Wrong Message ID ***" );
|
|
44 |
|
|
45 |
// MACROS
|
|
46 |
// None
|
|
47 |
|
|
48 |
// LOCAL CONSTANTS AND MACROS
|
|
49 |
// None
|
|
50 |
|
|
51 |
// MODULE DATA STRUCTURES
|
|
52 |
// None
|
|
53 |
|
|
54 |
// LOCAL FUNCTION PROTOTYPES
|
|
55 |
// None
|
|
56 |
|
|
57 |
// FORWARD DECLARATIONS
|
|
58 |
// None
|
|
59 |
|
|
60 |
// ============================= LOCAL FUNCTIONS ===============================
|
|
61 |
// None
|
|
62 |
|
|
63 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
64 |
// -----------------------------------------------------------------------------
|
|
65 |
// CIsiMsgBaseTest::NewL
|
|
66 |
// Second phase static constuctor.
|
|
67 |
// -----------------------------------------------------------------------------
|
|
68 |
//
|
|
69 |
CIsiMsgBaseTest* CIsiMsgBaseTest::NewL
|
|
70 |
(
|
|
71 |
TExecutionAndDebugInfo& aInfo,
|
|
72 |
TInt& aResult
|
|
73 |
)
|
|
74 |
{
|
|
75 |
|
|
76 |
// Construct new CCommSubBlockTest instance.
|
|
77 |
CIsiMsgBaseTest* self = CIsiMsgBaseTest::NewLC( aInfo, aResult );
|
|
78 |
CleanupStack::Pop( self );
|
|
79 |
return self;
|
|
80 |
|
|
81 |
}
|
|
82 |
|
|
83 |
// -----------------------------------------------------------------------------
|
|
84 |
// CIsiMsgBaseTest::NewLC
|
|
85 |
// Second phase static constuctor.
|
|
86 |
// -----------------------------------------------------------------------------
|
|
87 |
//
|
|
88 |
CIsiMsgBaseTest* CIsiMsgBaseTest::NewLC
|
|
89 |
(
|
|
90 |
TExecutionAndDebugInfo& aInfo,
|
|
91 |
TInt& aResult
|
|
92 |
)
|
|
93 |
{
|
|
94 |
|
|
95 |
// Construct new CCommSubBlockTest instance.
|
|
96 |
CIsiMsgBaseTest* self = new ( ELeave )CIsiMsgBaseTest( aInfo, aResult );
|
|
97 |
CleanupStack::PushL( self );
|
|
98 |
self->ConstructL();
|
|
99 |
return self;
|
|
100 |
|
|
101 |
}
|
|
102 |
|
|
103 |
// -----------------------------------------------------------------------------
|
|
104 |
// CIsiMsgBaseTest::~CIsiMsgBaseTest
|
|
105 |
// Destructor
|
|
106 |
// -----------------------------------------------------------------------------
|
|
107 |
//
|
|
108 |
CIsiMsgBaseTest::~CIsiMsgBaseTest
|
|
109 |
(
|
|
110 |
// None
|
|
111 |
)
|
|
112 |
{
|
|
113 |
|
|
114 |
// Delete and free local variables.
|
|
115 |
ClearReceivedMsg();
|
|
116 |
delete iIsaApiMsgExc;
|
|
117 |
iIsaApiMsgExc = NULL;
|
|
118 |
delete iTestLog;
|
|
119 |
iTestLog = NULL;
|
|
120 |
|
|
121 |
}
|
|
122 |
|
|
123 |
// -----------------------------------------------------------------------------
|
|
124 |
// CIsiMsgBaseTest::OpenIsaApiAndGetIsiMsgL
|
|
125 |
// Opens the IsaApi and creates new IsiMsg.
|
|
126 |
//
|
|
127 |
// If the IsaApi connection was already open, tries again.
|
|
128 |
// -----------------------------------------------------------------------------
|
|
129 |
//
|
|
130 |
void CIsiMsgBaseTest::OpenIsaApiAndGetIsiMsgL
|
|
131 |
(
|
|
132 |
// None
|
|
133 |
)
|
|
134 |
{
|
|
135 |
|
|
136 |
// Prints that case started for STIF, ATS and Logger.
|
|
137 |
iTestLog->PrintCaseStatus( iInfo, iResult, iInfo.iCaseName, EStart );
|
|
138 |
// For debug.
|
|
139 |
RDebug::Print( KOpen );
|
|
140 |
|
|
141 |
// Fo until connection OK.
|
|
142 |
for( TInt i( 0 ), result = KErrAlreadyExists;
|
|
143 |
KErrNone != result;
|
|
144 |
i++ )
|
|
145 |
{
|
|
146 |
result = iIsaApi.Open( PN_OBJ_EPOC_MONSERV_SERV ); // 50
|
|
147 |
// If exist allready try again until previous connection is closed.
|
|
148 |
if( KErrAlreadyExists == result )
|
|
149 |
{
|
|
150 |
iResult = result;
|
|
151 |
PrintCaseProgress( result, KIsaApiNotReady );
|
|
152 |
// Wait for one second.
|
|
153 |
RDebug::Print( KIsaApiNotReady );
|
|
154 |
User::After( KOneSecond );
|
|
155 |
}
|
|
156 |
// If connection couldn't be opened and not open connection already
|
|
157 |
// panic and leave.
|
|
158 |
else if( KErrNone != result )
|
|
159 |
{
|
|
160 |
iResult = result;
|
|
161 |
PrintCaseProgress( iResult, KIsaApiPanic );
|
|
162 |
RDebug::Print( KIsaApiPanic );
|
|
163 |
User::Panic( KIsaApiPanic, KZero );
|
|
164 |
}
|
|
165 |
else
|
|
166 |
{
|
|
167 |
// Nothing.
|
|
168 |
}
|
|
169 |
}
|
|
170 |
|
|
171 |
iIsaApiMsgExc = CPnMsg::NewL( KLengthOfMessage - KSix );
|
|
172 |
iIsaApiMsgExc->Ptr().FillZ();
|
|
173 |
// If empty panic.
|
|
174 |
if( !iIsaApiMsgExc )
|
|
175 |
{
|
|
176 |
iResult = KErrNoMemory;
|
|
177 |
PrintCaseProgress( iResult, KIsaApiMsgEmpty );
|
|
178 |
RDebug::Print( KIsaApiMsgEmpty );
|
|
179 |
User::Panic( KIsaApiMsgEmpty, KOne );
|
|
180 |
}
|
|
181 |
|
|
182 |
}
|
|
183 |
|
|
184 |
// -----------------------------------------------------------------------------
|
|
185 |
// CIsiMsgBaseTest::CloseIsaApi
|
|
186 |
// Closes the IsaApi connection down.
|
|
187 |
// -----------------------------------------------------------------------------
|
|
188 |
//
|
|
189 |
void CIsiMsgBaseTest::CloseIsaApi
|
|
190 |
(
|
|
191 |
// None
|
|
192 |
)
|
|
193 |
{
|
|
194 |
|
|
195 |
iIsaApi.Close();
|
|
196 |
// Writes the end Status of case to STIF UI, ATS and log file.
|
|
197 |
iTestLog->PrintCaseStatus( iInfo, iResult, iInfo.iCaseName, EEnd );
|
|
198 |
|
|
199 |
}
|
|
200 |
|
|
201 |
// -----------------------------------------------------------------------------
|
|
202 |
// CIsiMsgBaseTest::ClearReceivedMsg
|
|
203 |
// Clears the memory reserved for PnMsg.
|
|
204 |
// -----------------------------------------------------------------------------
|
|
205 |
//
|
|
206 |
void CIsiMsgBaseTest::ClearReceivedMsg
|
|
207 |
(
|
|
208 |
// None
|
|
209 |
)
|
|
210 |
{
|
|
211 |
|
|
212 |
delete iPnMsg;
|
|
213 |
iPnMsg = NULL;
|
|
214 |
|
|
215 |
}
|
|
216 |
|
|
217 |
// -----------------------------------------------------------------------------
|
|
218 |
// CAccSubBlockTest::SetCaseProgress
|
|
219 |
// Set the status failed / passed of the case.
|
|
220 |
// -----------------------------------------------------------------------------
|
|
221 |
//
|
|
222 |
void CIsiMsgBaseTest::PrintCaseProgress
|
|
223 |
(
|
|
224 |
TInt aResult,
|
|
225 |
const TDesC& aComment
|
|
226 |
)
|
|
227 |
{
|
|
228 |
|
|
229 |
iResult = aResult;
|
|
230 |
iTestLog->PrintCaseProgress( iInfo, iResult, aComment );
|
|
231 |
|
|
232 |
}
|
|
233 |
|
|
234 |
// -----------------------------------------------------------------------------
|
|
235 |
// CIsiMsgBaseTest::ReceiveIsiMsgL
|
|
236 |
// Receveis an Isi message.
|
|
237 |
// -----------------------------------------------------------------------------
|
|
238 |
//
|
|
239 |
void CIsiMsgBaseTest::ReceiveIsiMsgL
|
|
240 |
(
|
|
241 |
CIsiMsg& aCopyRcvMsg
|
|
242 |
)
|
|
243 |
{
|
|
244 |
|
|
245 |
// For debug print.
|
|
246 |
RDebug::Print( KReceive );
|
|
247 |
|
|
248 |
iPnMsg = CPnMsg::NewL( KPnMsgSize );
|
|
249 |
CIsiMsg isaApiRcvMsg;
|
|
250 |
isaApiRcvMsg.SetMessage( *iPnMsg );
|
|
251 |
|
|
252 |
TRequestStatus localStatus;
|
|
253 |
TPckgBuf<TUint16> len;
|
|
254 |
iResult = iIsaApi.Receive( localStatus, isaApiRcvMsg, len );
|
|
255 |
if( KErrNone != iResult )
|
|
256 |
{
|
|
257 |
PrintCaseProgress( iResult, KSendFail );
|
|
258 |
RDebug::Print( KSendFail );
|
|
259 |
User::Panic( KSendFail, KTwo );
|
|
260 |
}
|
|
261 |
RTimer timer;
|
|
262 |
timer.CreateLocal();
|
|
263 |
// Set timer
|
|
264 |
TRequestStatus timerStatus;
|
|
265 |
// Wait for response is expired.
|
|
266 |
timer.After( timerStatus, RESP_EXPIRE_TIME );
|
|
267 |
// Wait for timer or response.
|
|
268 |
User::WaitForRequest( timerStatus, localStatus );
|
|
269 |
|
|
270 |
// When either one has returned, check if iStatus is the one
|
|
271 |
// that didn't return, thus meaning the timer did.
|
|
272 |
if( localStatus == KRequestPending )
|
|
273 |
{
|
|
274 |
iIsaApi.ReceiveCancel();
|
|
275 |
iResult = KErrTimedOut;
|
|
276 |
PrintCaseProgress( iResult, KTimeOut );
|
|
277 |
User::WaitForRequest( localStatus );
|
|
278 |
}
|
|
279 |
else
|
|
280 |
{
|
|
281 |
timer.Cancel();
|
|
282 |
User::WaitForRequest( timerStatus );
|
|
283 |
PrintCaseProgress( iResult, KInTime );
|
|
284 |
}
|
|
285 |
timer.Close();
|
|
286 |
// Copy the received message to icommIsiMsg
|
|
287 |
isaApiRcvMsg.CopyAndNull( &aCopyRcvMsg );
|
|
288 |
|
|
289 |
/*FOR HEX's
|
|
290 |
TRAPD( err, iTestLog->PrintHexL( iInfo, ERequest ) );
|
|
291 |
if( KErrNone != err )
|
|
292 |
{
|
|
293 |
PrintCaseProgress( err, KHexPrintFail );
|
|
294 |
}
|
|
295 |
*/
|
|
296 |
|
|
297 |
}
|
|
298 |
|
|
299 |
// -----------------------------------------------------------------------------
|
|
300 |
// CIsiMsgBaseTest::Receive16BitIsiMsgL
|
|
301 |
// Receveis an Isi message.
|
|
302 |
// -----------------------------------------------------------------------------
|
|
303 |
//
|
|
304 |
void CIsiMsgBaseTest::Receive16BitIsiMsgL
|
|
305 |
(
|
|
306 |
CIsiMsg& aCopyRcvMsg
|
|
307 |
)
|
|
308 |
{
|
|
309 |
|
|
310 |
// For debug print.
|
|
311 |
RDebug::Print( KReceive );
|
|
312 |
|
|
313 |
iPnMsg = CPnMsg::NewL( KPnMsgSize );
|
|
314 |
CSimIsiMsg isaApiRcvMsg;
|
|
315 |
isaApiRcvMsg.SetMessage16( *iPnMsg );
|
|
316 |
|
|
317 |
TRequestStatus localStatus;
|
|
318 |
TPckgBuf<TUint16> len;
|
|
319 |
iResult = iIsaApi.Receive( localStatus, isaApiRcvMsg, len );
|
|
320 |
if( KErrNone != iResult )
|
|
321 |
{
|
|
322 |
PrintCaseProgress( iResult, KSendFail );
|
|
323 |
RDebug::Print( KSendFail );
|
|
324 |
User::Panic( KSendFail, KTwo );
|
|
325 |
}
|
|
326 |
RTimer timer;
|
|
327 |
timer.CreateLocal();
|
|
328 |
// Set timer
|
|
329 |
TRequestStatus timerStatus;
|
|
330 |
// Wait for response is expired.
|
|
331 |
timer.After( timerStatus, RESP_EXPIRE_TIME );
|
|
332 |
// Wait for timer or response.
|
|
333 |
User::WaitForRequest( timerStatus, localStatus );
|
|
334 |
|
|
335 |
// When either one has returned, check if iStatus is the one
|
|
336 |
// that didn't return, thus meaning the timer did.
|
|
337 |
if( localStatus == KRequestPending )
|
|
338 |
{
|
|
339 |
iIsaApi.ReceiveCancel();
|
|
340 |
iResult = KErrTimedOut;
|
|
341 |
User::WaitForRequest( localStatus );
|
|
342 |
PrintCaseProgress( iResult, KTimeOut );
|
|
343 |
}
|
|
344 |
else
|
|
345 |
{
|
|
346 |
timer.Cancel();
|
|
347 |
PrintCaseProgress( iResult, KInTime );
|
|
348 |
User::WaitForRequest( timerStatus );
|
|
349 |
}
|
|
350 |
timer.Close();
|
|
351 |
// Copy the received message to icommIsiMsg
|
|
352 |
isaApiRcvMsg.CopyAndNull( &aCopyRcvMsg );
|
|
353 |
|
|
354 |
/*FOR HEX's
|
|
355 |
TRAPD( err, iTestLog->PrintHexL( iInfo, ERequest ) );
|
|
356 |
if( KErrNone != err )
|
|
357 |
{
|
|
358 |
PrintCaseProgress( err, KHexPrintFail );
|
|
359 |
}
|
|
360 |
*/
|
|
361 |
|
|
362 |
}
|
|
363 |
|
|
364 |
|
|
365 |
// -----------------------------------------------------------------------------
|
|
366 |
// CIsiMsgBaseTest::SendIsiMsgL
|
|
367 |
// Send an Isi message.
|
|
368 |
// -----------------------------------------------------------------------------
|
|
369 |
//
|
|
370 |
void CIsiMsgBaseTest::SendIsiMsgL
|
|
371 |
(
|
|
372 |
const TUint8 aFunctionType,
|
|
373 |
const TUint8 aMessageId,
|
|
374 |
CIsiMsg& aMessage,
|
|
375 |
TDesC8& aData
|
|
376 |
)
|
|
377 |
{
|
|
378 |
|
|
379 |
// For debug print.
|
|
380 |
RDebug::Print( KSend );
|
|
381 |
|
|
382 |
// Set message to point send buffer.
|
|
383 |
aMessage.SetMessage( *iIsaApiMsgExc );
|
|
384 |
|
|
385 |
if( PN_CALL == aFunctionType )
|
|
386 |
{
|
|
387 |
CCallIsiMsg& message = static_cast<CCallIsiMsg&>(aMessage);
|
|
388 |
message.Create( 0x01, aMessageId, aData[0] );
|
|
389 |
}
|
|
390 |
else if( PN_TONE == aFunctionType )
|
|
391 |
{
|
|
392 |
CToneIsiMsg& message = static_cast<CToneIsiMsg&>(aMessage);
|
|
393 |
message.Create( 0x01, aMessageId, &aData );
|
|
394 |
}
|
|
395 |
else
|
|
396 |
{
|
|
397 |
aMessage.Create( 0x01, aMessageId, &aData );
|
|
398 |
}
|
|
399 |
aMessage.Create( 0x01, aMessageId, &aData );
|
|
400 |
|
|
401 |
/*FOR HEX's
|
|
402 |
TRAPD( err, iTestLog->PrintHexL( iInfo, aData, ERequest ) );
|
|
403 |
if( KErrNone != err )
|
|
404 |
{
|
|
405 |
PrintCaseProgress( err, KHexPrintFail );
|
|
406 |
}
|
|
407 |
*/
|
|
408 |
|
|
409 |
aMessage.SetFunction( aFunctionType );
|
|
410 |
iResult = iIsaApi.Send( aMessage );
|
|
411 |
if( KErrNone != iResult )
|
|
412 |
{
|
|
413 |
PrintCaseProgress( iResult, KReceiveFail );
|
|
414 |
RDebug::Print( KReceiveFail );
|
|
415 |
User::Panic( KReceiveFail, KTwo );
|
|
416 |
}
|
|
417 |
// Wait until 1sec*aSeconds has gone
|
|
418 |
WaitASecond();
|
|
419 |
|
|
420 |
}
|
|
421 |
|
|
422 |
// -----------------------------------------------------------------------------
|
|
423 |
// CIsiMsgBaseTest::SendIsiMsgL
|
|
424 |
// Send an Isi message.
|
|
425 |
// -----------------------------------------------------------------------------
|
|
426 |
//
|
|
427 |
void CIsiMsgBaseTest::Send16BitIsiMsgL
|
|
428 |
(
|
|
429 |
const TUint8 aFunctionType,
|
|
430 |
const TUint8 aMessageId,
|
|
431 |
CIsiMsg& aMessage,
|
|
432 |
TDesC8& aData
|
|
433 |
)
|
|
434 |
{
|
|
435 |
|
|
436 |
// For debug print.
|
|
437 |
RDebug::Print( KSend );
|
|
438 |
|
|
439 |
if( aFunctionType != PN_SIM )
|
|
440 |
{
|
|
441 |
iResult = KErrNotSupported;
|
|
442 |
// For debug print.
|
|
443 |
RDebug::Print( KSend );
|
|
444 |
RDebug::Print( KSendError );
|
|
445 |
User::Leave( KErrNotSupported );
|
|
446 |
}
|
|
447 |
|
|
448 |
CSimIsiMsg& simIsiMsg = static_cast<CSimIsiMsg&>( aMessage );
|
|
449 |
// Set message to point send buffer.
|
|
450 |
simIsiMsg.SetMessage16( *iIsaApiMsgExc );
|
|
451 |
simIsiMsg.Create16( 0x01, aMessageId, &aData );
|
|
452 |
|
|
453 |
/*FOR HEX's
|
|
454 |
TRAPD( err, iTestLog->PrintHexL( iInfo, aData, ERequest ) );
|
|
455 |
if( KErrNone != err )
|
|
456 |
{
|
|
457 |
PrintCaseProgress( err, KHexPrintFail );
|
|
458 |
}
|
|
459 |
*/
|
|
460 |
|
|
461 |
simIsiMsg.SetFunction( aFunctionType );
|
|
462 |
iResult = iIsaApi.Send( aMessage );
|
|
463 |
if( KErrNone != iResult )
|
|
464 |
{
|
|
465 |
PrintCaseProgress( iResult, KReceiveFail );
|
|
466 |
RDebug::Print( KReceiveFail );
|
|
467 |
User::Panic( KReceiveFail, KTwo );
|
|
468 |
}
|
|
469 |
// Wait until 1sec*aSeconds has gone
|
|
470 |
WaitASecond();
|
|
471 |
|
|
472 |
}
|
|
473 |
|
|
474 |
// -----------------------------------------------------------------------------
|
|
475 |
// CIsiMsgBaseTest::SendIsiMsgL
|
|
476 |
// Send an Isi message.
|
|
477 |
// -----------------------------------------------------------------------------
|
|
478 |
//
|
|
479 |
void CIsiMsgBaseTest::CreateIsiMsgL
|
|
480 |
(
|
|
481 |
const TUint8 aFunctionType,
|
|
482 |
const TUint8 aMessageId,
|
|
483 |
CIsiMsg& aMessage,
|
|
484 |
TDesC8& aData
|
|
485 |
)
|
|
486 |
{
|
|
487 |
|
|
488 |
// If used with wrong messageID
|
|
489 |
if( aFunctionType != PN_BLUETOOTH_CORE && aFunctionType != PN_LOCATION
|
|
490 |
&& aFunctionType != PN_FM_RADIO && aFunctionType != PN_KEY
|
|
491 |
&& aFunctionType != PN_TUNEPLAYER && aFunctionType != PN_TONE
|
|
492 |
&& aFunctionType != PN_TIME && aFunctionType != PN_GSS
|
|
493 |
&& aFunctionType != PN_SELFTEST && aFunctionType != PN_EPOC_INFO
|
|
494 |
&& aFunctionType != PN_SIM && aFunctionType != PN_DSP_AUDIO
|
|
495 |
&& aFunctionType != PN_SMS_MEMORY )
|
|
496 |
{
|
|
497 |
iResult = KErrNotSupported;
|
|
498 |
// For debug print.
|
|
499 |
RDebug::Print( KSend );
|
|
500 |
RDebug::Print( KSendError );
|
|
501 |
User::Leave( KErrNotSupported );
|
|
502 |
}
|
|
503 |
// For debug print.
|
|
504 |
RDebug::Print( KSend );
|
|
505 |
|
|
506 |
// Set message to point send buffer.
|
|
507 |
aMessage.SetMessage( *iIsaApiMsgExc );
|
|
508 |
aMessage.Create( 0x01, aMessageId, &aData );
|
|
509 |
aMessage.SetFunction( aFunctionType );
|
|
510 |
|
|
511 |
/*FOR HEX's
|
|
512 |
TRAPD( err, iTestLog->PrintHexL( iInfo, aData, ERequest ) );
|
|
513 |
if( KErrNone != err )
|
|
514 |
{
|
|
515 |
PrintCaseProgress( err, KHexPrintFail );
|
|
516 |
}
|
|
517 |
*/
|
|
518 |
|
|
519 |
}
|
|
520 |
|
|
521 |
// -----------------------------------------------------------------------------
|
|
522 |
// CIsiMsgBaseTest::SendIsiMsgL
|
|
523 |
// Send an Isi message.
|
|
524 |
// -----------------------------------------------------------------------------
|
|
525 |
//
|
|
526 |
void CIsiMsgBaseTest::SendCreatedIsiMsgL
|
|
527 |
(
|
|
528 |
const TUint8 aFunctionType,
|
|
529 |
const TUint8, //aMessageId,
|
|
530 |
CIsiMsg& aMessage,
|
|
531 |
TDesC8& //aData
|
|
532 |
)
|
|
533 |
{
|
|
534 |
|
|
535 |
// If used with wrong messageID
|
|
536 |
if( aFunctionType != PN_BLUETOOTH_CORE && aFunctionType != PN_LOCATION
|
|
537 |
&& aFunctionType != PN_FM_RADIO && aFunctionType != PN_KEY
|
|
538 |
&& aFunctionType != PN_TUNEPLAYER && aFunctionType != PN_TONE
|
|
539 |
&& aFunctionType != PN_TIME && aFunctionType != PN_GSS
|
|
540 |
&& aFunctionType != PN_SELFTEST && aFunctionType != PN_EPOC_INFO
|
|
541 |
&& aFunctionType != PN_SIM && aFunctionType != PN_DSP_AUDIO
|
|
542 |
&& aFunctionType != PN_SMS_MEMORY )
|
|
543 |
{
|
|
544 |
iResult = KErrNotSupported;
|
|
545 |
// For debug print.
|
|
546 |
RDebug::Print( KSend );
|
|
547 |
RDebug::Print( KSendError );
|
|
548 |
User::Leave( KErrNotSupported );
|
|
549 |
}
|
|
550 |
|
|
551 |
iResult = iIsaApi.Send( aMessage );
|
|
552 |
if( KErrNone != iResult )
|
|
553 |
{
|
|
554 |
PrintCaseProgress( iResult, KReceiveFail );
|
|
555 |
RDebug::Print( KReceiveFail );
|
|
556 |
User::Panic( KReceiveFail, KTwo );
|
|
557 |
}
|
|
558 |
// Wait until 1sec*aSeconds has gone
|
|
559 |
WaitASecond();
|
|
560 |
|
|
561 |
}
|
|
562 |
|
|
563 |
// -----------------------------------------------------------------------------
|
|
564 |
// CIsiMsgBaseTest::CIsiMsgBaseTest
|
|
565 |
// Default constructor.
|
|
566 |
// -----------------------------------------------------------------------------
|
|
567 |
//
|
|
568 |
CIsiMsgBaseTest::CIsiMsgBaseTest
|
|
569 |
(
|
|
570 |
TExecutionAndDebugInfo& aInfo,
|
|
571 |
TInt& aResult
|
|
572 |
):iInfo( aInfo ), iResult( aResult )
|
|
573 |
{
|
|
574 |
|
|
575 |
// None
|
|
576 |
|
|
577 |
}
|
|
578 |
|
|
579 |
// -----------------------------------------------------------------------------
|
|
580 |
// CIsiMsgBaseTest::ConstructL
|
|
581 |
// Symbian OS second phase constructor.
|
|
582 |
// -----------------------------------------------------------------------------
|
|
583 |
//
|
|
584 |
void CIsiMsgBaseTest::ConstructL
|
|
585 |
(
|
|
586 |
// None
|
|
587 |
)
|
|
588 |
{
|
|
589 |
|
|
590 |
// Writes notices to STIF UI, ATS, and logfile.
|
|
591 |
iTestLog = CTestLogger::NewL();
|
|
592 |
iIsaApiMsgExc = NULL;
|
|
593 |
iPnMsg = NULL;
|
|
594 |
|
|
595 |
}
|
|
596 |
|
|
597 |
// -----------------------------------------------------------------------------
|
|
598 |
// CIsiMsgBaseTest::WaitASecond
|
|
599 |
// Waits a second.
|
|
600 |
// -----------------------------------------------------------------------------
|
|
601 |
//
|
|
602 |
void CIsiMsgBaseTest::WaitASecond
|
|
603 |
(
|
|
604 |
// None
|
|
605 |
)
|
|
606 |
{
|
|
607 |
|
|
608 |
// Wait until 1sec*aSeconds has gone
|
|
609 |
RTimer timer;
|
|
610 |
TRequestStatus timerStatus;
|
|
611 |
timer.CreateLocal();
|
|
612 |
timer.After( timerStatus, KThousand * AUTOMATIC_MODE_SWITCH_DELAY );
|
|
613 |
User::WaitForRequest( timerStatus );
|
|
614 |
timer.Close();
|
|
615 |
|
|
616 |
}
|