33
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2010 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 "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: Encapsule the access to etelmm API in sat
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <mmtsy_names.h>
|
|
20 |
#include "csatmultimodeapi.h"
|
|
21 |
#include "csatsactivewrapper.h"
|
|
22 |
#include "SatLog.h"
|
|
23 |
|
|
24 |
#ifdef SAT_USE_DUMMY_TSY
|
|
25 |
_LIT( KSatSDummyTsyModuleName, "DSAT" );
|
|
26 |
_LIT( KSatSDummyTsyPhoneName, "DMobile" );
|
|
27 |
#endif
|
|
28 |
|
|
29 |
const TInt KLoopMaxTryouts = 5;
|
|
30 |
const TInt KLoopTimeout = 3000000;
|
|
31 |
|
48
|
32 |
const TUint8 KQuarterShift( 2 );
|
|
33 |
const TUint8 KHighNibbleShift( 4 );
|
|
34 |
const TUint8 KDcsCharacterSet7Bit( 0x00 );
|
|
35 |
const TUint8 KDcsCharacterSet8Bit( 0x01 );
|
|
36 |
const TUint8 KDcsCharacterSet16Bit( 0x02 );
|
|
37 |
const TUint8 KDcsCharacterSet7Bit2( 0x00 );
|
|
38 |
const TUint8 KDcsCharacterSet16Bit2( 0x01 );
|
|
39 |
|
33
|
40 |
// ================= MEMBER FUNCTIONS ==========================================
|
|
41 |
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
// Class constructor.
|
|
44 |
// -----------------------------------------------------------------------------
|
|
45 |
//
|
|
46 |
CSatMultiModeApi::CSatMultiModeApi()
|
|
47 |
{
|
|
48 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::CSatMultiModeApi calling-exiting" )
|
|
49 |
}
|
|
50 |
|
|
51 |
// -----------------------------------------------------------------------------
|
|
52 |
// Destructor
|
|
53 |
// -----------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
CSatMultiModeApi::~CSatMultiModeApi()
|
|
56 |
{
|
|
57 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::~CSatMultiModeApi calling" )
|
|
58 |
|
|
59 |
if ( iCallOpened )
|
|
60 |
{
|
|
61 |
iCall.Close();
|
|
62 |
}
|
|
63 |
|
|
64 |
if ( iLineOpened )
|
|
65 |
{
|
|
66 |
iLine.Close();
|
|
67 |
}
|
|
68 |
|
|
69 |
if ( iUssdOpened )
|
|
70 |
{
|
|
71 |
iUssd.Close();
|
|
72 |
}
|
|
73 |
|
|
74 |
iCustomPhone.Close();
|
|
75 |
|
|
76 |
iPhone.Close();
|
|
77 |
|
|
78 |
#ifdef SAT_USE_DUMMY_TSY
|
|
79 |
iDummyPhone.Close();
|
|
80 |
#endif
|
|
81 |
iTelServer.Close();
|
|
82 |
|
|
83 |
delete iWrapper;
|
|
84 |
iWrapper = NULL;
|
|
85 |
|
|
86 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::~CSatMultiModeApi calling" )
|
|
87 |
}
|
|
88 |
|
|
89 |
// -----------------------------------------------------------------------------
|
|
90 |
// CSatMultiModeApi::NewL
|
|
91 |
// -----------------------------------------------------------------------------
|
|
92 |
//
|
|
93 |
CSatMultiModeApi* CSatMultiModeApi::NewL()
|
|
94 |
{
|
|
95 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::NewL calling" )
|
|
96 |
|
|
97 |
CSatMultiModeApi* self = new( ELeave )CSatMultiModeApi();
|
|
98 |
CleanupStack::PushL( self );
|
|
99 |
self->ConstructL();
|
|
100 |
CleanupStack::Pop( self );
|
|
101 |
|
|
102 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::NewL calling" )
|
|
103 |
return self;
|
|
104 |
}
|
|
105 |
|
|
106 |
// -----------------------------------------------------------------------------
|
|
107 |
// CSatMultiModeApi::Phone
|
|
108 |
// (other items were commented in a header).
|
|
109 |
// -----------------------------------------------------------------------------
|
|
110 |
//
|
|
111 |
RMobilePhone* CSatMultiModeApi::Phone()
|
|
112 |
{
|
|
113 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::Phone calling-exiting" )
|
|
114 |
return &iPhone;
|
|
115 |
}
|
|
116 |
|
|
117 |
// -----------------------------------------------------------------------------
|
|
118 |
// CSatMultiModeApi::Phone
|
|
119 |
// (other items were commented in a header).
|
|
120 |
// -----------------------------------------------------------------------------
|
|
121 |
//
|
|
122 |
RMobilePhone* CSatMultiModeApi::DummyPhone()
|
|
123 |
{
|
|
124 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::Phone calling-exiting" )
|
|
125 |
#ifdef SAT_USE_DUMMY_TSY
|
|
126 |
return &iDummyPhone;
|
|
127 |
#else
|
|
128 |
return NULL;
|
|
129 |
#endif
|
|
130 |
}
|
|
131 |
|
|
132 |
// -----------------------------------------------------------------------------
|
|
133 |
// CSatMultiModeApi::CustomApi
|
|
134 |
// (other items were commented in a header).
|
|
135 |
// -----------------------------------------------------------------------------
|
|
136 |
//
|
|
137 |
RMmCustomAPI* CSatMultiModeApi::CustomApi()
|
|
138 |
{
|
|
139 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::CustomApi calling-exiting" )
|
|
140 |
return &iCustomPhone;
|
|
141 |
}
|
|
142 |
|
|
143 |
// -----------------------------------------------------------------------------
|
|
144 |
// CSatMultiModeApi::LowerErrorGranularity
|
|
145 |
// (other items were commented in a header).
|
|
146 |
// -----------------------------------------------------------------------------
|
|
147 |
//
|
|
148 |
void CSatMultiModeApi::LowerErrorGranularity()
|
|
149 |
{
|
|
150 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LowerErrorGranularity \
|
|
151 |
calling-exiting" )
|
|
152 |
iTelServer.SetExtendedErrorGranularity( RTelServer::EErrorBasic );
|
|
153 |
}
|
|
154 |
|
|
155 |
// -----------------------------------------------------------------------------
|
|
156 |
// CSatMultiModeApi::RaiseErrorGranularity
|
|
157 |
// (other items were commented in a header).
|
|
158 |
// -----------------------------------------------------------------------------
|
|
159 |
//
|
|
160 |
void CSatMultiModeApi::RaiseErrorGranularity()
|
|
161 |
{
|
|
162 |
LOG( NORMAL, "SATENGINE: CSatMultiModeApi::RaiseErrorGranularity \
|
|
163 |
calling-exiting" )
|
|
164 |
iTelServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended );
|
|
165 |
}
|
|
166 |
|
|
167 |
// -----------------------------------------------------------------------------
|
|
168 |
// CSatMultiModeApi::GetNetworkRegistrationStatus
|
|
169 |
// (other items were commented in a header).
|
|
170 |
// -----------------------------------------------------------------------------
|
|
171 |
//
|
|
172 |
void CSatMultiModeApi::GetNetworkRegistrationStatus(
|
|
173 |
TRequestStatus& aReqStatus,
|
|
174 |
RMobilePhone::TMobilePhoneRegistrationStatus& aStatus)
|
|
175 |
{
|
|
176 |
LOG( SIMPLE,
|
|
177 |
"SATENGINE: CSatMultiModeApi::GetNetworkRegistrationStatus calling" )
|
|
178 |
|
|
179 |
iPhone.GetNetworkRegistrationStatus( aReqStatus, aStatus );
|
|
180 |
|
|
181 |
LOG( SIMPLE,
|
|
182 |
"SATENGINE: CSatMultiModeApi::GetNetworkRegistrationStatus exiting" )
|
|
183 |
}
|
|
184 |
// -----------------------------------------------------------------------------
|
|
185 |
// CSatMultiModeApi::NotifyNetworkRegistrationStatusChange
|
|
186 |
// (other items were commented in a header).
|
|
187 |
// -----------------------------------------------------------------------------
|
|
188 |
//
|
|
189 |
void CSatMultiModeApi::NotifyNetworkRegistrationStatusChange(
|
|
190 |
TRequestStatus& aReqStatus,
|
|
191 |
RMobilePhone::TMobilePhoneRegistrationStatus& aStatus)
|
|
192 |
{
|
|
193 |
LOG( SIMPLE, "SATENGINE: \
|
|
194 |
CSatMultiModeApi::NotifyNetworkRegistrationStatusChange calling" )
|
|
195 |
|
|
196 |
iPhone.NotifyNetworkRegistrationStatusChange( aReqStatus, aStatus );
|
|
197 |
|
|
198 |
LOG( SIMPLE, "SATENGINE: \
|
|
199 |
CSatMultiModeApi::NotifyNetworkRegistrationStatusChange exiting" )
|
|
200 |
}
|
|
201 |
|
|
202 |
// -----------------------------------------------------------------------------
|
|
203 |
// CSatMultiModeApi::GetSubscriberId
|
|
204 |
// (other items were commented in a header).
|
|
205 |
// -----------------------------------------------------------------------------
|
|
206 |
//
|
|
207 |
void CSatMultiModeApi::GetSubscriberId(TRequestStatus& aReqStatus,
|
|
208 |
RMobilePhone::TMobilePhoneSubscriberId& aId)
|
|
209 |
{
|
|
210 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::GetSubscriberId calling" )
|
|
211 |
iPhone.GetSubscriberId( aReqStatus, aId );
|
|
212 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::GetSubscriberId exiting" )
|
|
213 |
}
|
|
214 |
|
|
215 |
// -----------------------------------------------------------------------------
|
|
216 |
// CSatMultiModeApi::SendDTMFTones
|
|
217 |
// (other items were commented in a header).
|
|
218 |
// -----------------------------------------------------------------------------
|
|
219 |
//
|
|
220 |
void CSatMultiModeApi::SendDTMFTones( TRequestStatus& aReqStatus,
|
|
221 |
const TDesC& aTones)
|
|
222 |
{
|
|
223 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::SendDTMFTones calling" )
|
|
224 |
iPhone.SendDTMFTones( aReqStatus, aTones );
|
|
225 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::SendDTMFTones exiting" )
|
|
226 |
}
|
|
227 |
|
|
228 |
// -----------------------------------------------------------------------------
|
|
229 |
// CSatMultiModeApi::ContinueDTMFStringSending
|
|
230 |
// (other items were commented in a header).
|
|
231 |
// -----------------------------------------------------------------------------
|
|
232 |
//
|
|
233 |
TInt CSatMultiModeApi::ContinueDTMFStringSending( TBool aContinue )
|
|
234 |
{
|
|
235 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::ContinueDTMFStringSending" )
|
|
236 |
return iPhone.ContinueDTMFStringSending( aContinue );
|
|
237 |
}
|
|
238 |
|
|
239 |
// -----------------------------------------------------------------------------
|
|
240 |
// CSatMultiModeApi::DialNoFdnCheck
|
|
241 |
// (other items were commented in a header).
|
|
242 |
// -----------------------------------------------------------------------------
|
|
243 |
//
|
|
244 |
void CSatMultiModeApi::DialNoFdnCheck( TRequestStatus& aStatus,
|
|
245 |
const TDesC8& aCallParams, const TDesC& aTelNumber)
|
|
246 |
{
|
|
247 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialNoFdnCheck calling" )
|
|
248 |
TInt err = LoadMobileCall();
|
|
249 |
LOG2( SIMPLE, "SATENGINE: CSatMultiModeApi::DialNoFdnCheck err %d", err )
|
|
250 |
|
|
251 |
iCall.DialNoFdnCheck( aStatus, aCallParams, aTelNumber );
|
|
252 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialNoFdnCheck exiting" )
|
|
253 |
}
|
|
254 |
|
|
255 |
// -----------------------------------------------------------------------------
|
|
256 |
// CSatMultiModeApi::SendNetworkServiceRequestNoFdnCheck
|
|
257 |
// (other items were commented in a header).
|
|
258 |
// -----------------------------------------------------------------------------
|
|
259 |
//
|
|
260 |
void CSatMultiModeApi::SendNetworkServiceRequestNoFdnCheck(
|
|
261 |
TRequestStatus& aReqStatus, const TDesC& aServiceString)
|
|
262 |
|
|
263 |
{
|
|
264 |
LOG( SIMPLE, "SATENGINE: \
|
|
265 |
CSatMultiModeApi::SendNetworkServiceRequestNoFdnCheck calling" )
|
|
266 |
|
|
267 |
iPhone.SendNetworkServiceRequestNoFdnCheck( aReqStatus, aServiceString );
|
|
268 |
|
|
269 |
LOG( SIMPLE, "SATENGINE: \
|
|
270 |
CSatMultiModeApi::SendNetworkServiceRequestNoFdnCheck exiting" )
|
|
271 |
}
|
|
272 |
|
|
273 |
// -----------------------------------------------------------------------------
|
|
274 |
// CSatMultiModeApi::SendMessageNoFdnCheck
|
|
275 |
// (other items were commented in a header).
|
|
276 |
// -----------------------------------------------------------------------------
|
|
277 |
//
|
|
278 |
void CSatMultiModeApi::SendMessageNoFdnCheck( TRequestStatus& aReqStatus,
|
|
279 |
const TDesC8& aMsgData, const TDesC8& aMsgAttributes )
|
|
280 |
{
|
|
281 |
LOG( SIMPLE,
|
|
282 |
"SATENGINE: CSatMultiModeApi::SendMessageNoFdnCheck calling" )
|
|
283 |
|
|
284 |
iUssd.SendMessageNoFdnCheck( aReqStatus, aMsgData, aMsgAttributes );
|
|
285 |
|
|
286 |
LOG( SIMPLE,
|
|
287 |
"SATENGINE: CSatMultiModeApi::SendMessageNoFdnCheck exiting" )
|
|
288 |
}
|
|
289 |
|
|
290 |
// -----------------------------------------------------------------------------
|
|
291 |
// CSatMultiModeApi::CancelAsyncRequest
|
|
292 |
// (other items were commented in a header).
|
|
293 |
// -----------------------------------------------------------------------------
|
|
294 |
//
|
|
295 |
void CSatMultiModeApi::CancelAsyncRequest(TInt aReqToCancel)
|
|
296 |
{
|
|
297 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::CancelAsyncRequest calling" )
|
|
298 |
iPhone.CancelAsyncRequest( aReqToCancel );
|
|
299 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::CancelAsyncRequest exiting" )
|
|
300 |
}
|
|
301 |
|
|
302 |
// -----------------------------------------------------------------------------
|
|
303 |
// CSatMultiModeApi::DialCancel
|
|
304 |
// (other items were commented in a header).
|
|
305 |
// -----------------------------------------------------------------------------
|
|
306 |
//
|
|
307 |
void CSatMultiModeApi::DialCancel()
|
|
308 |
{
|
|
309 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialCancel calling" )
|
|
310 |
iCall.DialCancel();
|
|
311 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialCancel exiting" )
|
|
312 |
}
|
|
313 |
|
|
314 |
// -----------------------------------------------------------------------------
|
|
315 |
// CSatMultiModeApi::IsCallIncoming
|
|
316 |
// (other items were commented in a header).
|
|
317 |
// -----------------------------------------------------------------------------
|
|
318 |
//
|
|
319 |
TBool CSatMultiModeApi::IsCallIncoming()
|
|
320 |
{
|
|
321 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::IsCallIncoming entering" )
|
|
322 |
TInt lines( 0 );
|
|
323 |
TBool callIncoming( EFalse );
|
|
324 |
|
|
325 |
// Enumerate all lines in the phone
|
|
326 |
TInt err( iPhone.EnumerateLines( lines ) );
|
|
327 |
|
|
328 |
if ( KErrNone == err )
|
|
329 |
{
|
|
330 |
RPhone::TLineInfo lineInfo;
|
|
331 |
// Check the lines' status one by one
|
|
332 |
for( TInt i = 0; ( i < lines ) && !callIncoming; ++i )
|
|
333 |
{
|
|
334 |
err = iPhone.GetLineInfo( i, lineInfo );
|
|
335 |
if ( KErrNone == err )
|
|
336 |
{
|
|
337 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::IsCallIncoming \
|
|
338 |
line status is %d", lineInfo.iStatus )
|
|
339 |
if ( ( RCall::EStatusDialling == lineInfo.iStatus ) ||
|
|
340 |
( RCall::EStatusRinging == lineInfo.iStatus ) )
|
|
341 |
{
|
|
342 |
// There is an incoming call
|
|
343 |
callIncoming = ETrue;
|
|
344 |
}
|
|
345 |
}
|
|
346 |
else
|
|
347 |
{
|
|
348 |
// Error happened when getting line info
|
|
349 |
// We currently do nothing but skip the error line and log it
|
|
350 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::IsCallIncoming \
|
|
351 |
getting line status error %d", err )
|
|
352 |
}
|
|
353 |
}
|
|
354 |
}
|
|
355 |
else
|
|
356 |
{
|
|
357 |
// Enumerate lines error
|
|
358 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::IsCallIncoming \
|
|
359 |
enumerate lines error %d", err )
|
|
360 |
}
|
|
361 |
|
|
362 |
LOG2( SIMPLE, "SATENGINE: CSatMultiModeApi::IsCallIncoming exiting %d",
|
|
363 |
callIncoming )
|
|
364 |
return callIncoming;
|
|
365 |
}
|
|
366 |
|
|
367 |
// -----------------------------------------------------------------------------
|
|
368 |
// CSatMultiModeApi::NotifyMobileCallStatusChange
|
|
369 |
// -----------------------------------------------------------------------------
|
|
370 |
//
|
|
371 |
void CSatMultiModeApi::NotifyMobileCallStatusChange (
|
|
372 |
TRequestStatus& aReqStatus, RMobileCall::TMobileCallStatus& aStatus )
|
|
373 |
{
|
|
374 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::NotifyMobileCallStatusChange \
|
|
375 |
calling" )
|
|
376 |
iCall.NotifyMobileCallStatusChange( aReqStatus, aStatus );
|
|
377 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::NotifyMobileCallStatusChange \
|
|
378 |
exiting" )
|
|
379 |
}
|
|
380 |
|
|
381 |
// -----------------------------------------------------------------------------
|
|
382 |
// CSatMultiModeApi::NotifyCallStatusChangeCancel
|
|
383 |
// (other items were commented in a header).
|
|
384 |
// -----------------------------------------------------------------------------
|
|
385 |
//
|
|
386 |
void CSatMultiModeApi::NotifyCallStatusChangeCancel()
|
|
387 |
{
|
|
388 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialCancel calling" )
|
|
389 |
iCall.NotifyStatusChangeCancel();
|
|
390 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialCancel exiting" )
|
|
391 |
}
|
|
392 |
|
|
393 |
// -----------------------------------------------------------------------------
|
|
394 |
// CSatMultiModeApi::NotifyMobileCallStatusChange
|
|
395 |
// -----------------------------------------------------------------------------
|
|
396 |
//
|
|
397 |
void CSatMultiModeApi::TerminateActiveCalls(TRequestStatus& aReqStatus)
|
|
398 |
{
|
|
399 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::TerminateAllCalls calling" )
|
|
400 |
|
|
401 |
iPhone.TerminateActiveCalls( aReqStatus );
|
|
402 |
|
|
403 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::TerminateAllCalls exiting" )
|
|
404 |
}
|
|
405 |
|
|
406 |
// -----------------------------------------------------------------------------
|
|
407 |
// CSatMultiModeApi::GetMobileCallInfo
|
|
408 |
// -----------------------------------------------------------------------------
|
|
409 |
//
|
|
410 |
TInt CSatMultiModeApi::GetMobileCallInfo(TDes8& aCallInfo)
|
|
411 |
{
|
|
412 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::GetMobileCallInfo calling" )
|
|
413 |
TInt ret = iCall.GetMobileCallInfo( aCallInfo );
|
|
414 |
LOG2( SIMPLE, "SATENGINE: CSatMultiModeApi::GetMobileCallInfo exiting %d",
|
|
415 |
ret )
|
|
416 |
return ret;
|
|
417 |
}
|
|
418 |
|
|
419 |
// -----------------------------------------------------------------------------
|
|
420 |
// CSatMultiModeApi::GetMobileCallInfo
|
|
421 |
// -----------------------------------------------------------------------------
|
|
422 |
//
|
|
423 |
void CSatMultiModeApi::DialEmergencyCall(TRequestStatus& aReqStatus,
|
|
424 |
const TDesC& aNumber)
|
|
425 |
{
|
|
426 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialEmergencyCall calling" )
|
|
427 |
TInt err = LoadMobileCall();
|
|
428 |
LOG2( SIMPLE, "SATENGINE: CSatMultiModeApi::DialEmergencyCall err %d", err )
|
|
429 |
iCall.DialEmergencyCall( aReqStatus, aNumber );
|
|
430 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialEmergencyCall exiting" )
|
|
431 |
}
|
|
432 |
|
|
433 |
// -----------------------------------------------------------------------------
|
48
|
434 |
// Check validity of a given Data Coding Scheme (Dcs).
|
|
435 |
// For the details how the DCS is validated please check TS_123038
|
|
436 |
// -----------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
TBool CSatMultiModeApi::IsValidUssdDcs( const TUint8 aDcs )
|
|
439 |
{
|
|
440 |
LOG2( SIMPLE,
|
|
441 |
"SATENGINE: CSatMultiModeApi::IsValidUssdDcs calling dcs = %x", aDcs)
|
|
442 |
|
|
443 |
TBool isDcsValid( EFalse );
|
|
444 |
// 76543210
|
|
445 |
TUint8 codingGroup = ( aDcs & 0xF0 ) >> KHighNibbleShift; // bits XXXX____
|
|
446 |
TUint8 characterSet = ( aDcs & 0x0C ) >> KQuarterShift; // bits ____XX__
|
|
447 |
TUint8 lowQuartet = ( aDcs & 0x0F ); // bits ____XXXX
|
|
448 |
|
|
449 |
LOG2( SIMPLE,
|
|
450 |
"SATENGINE: CSatMultiModeApi::IsValidUssdDcs codingGroup: %x", codingGroup)
|
|
451 |
LOG2( SIMPLE,
|
|
452 |
"SATENGINE: CSatMultiModeApi::IsValidUssdDcs charSet: %x", characterSet)
|
|
453 |
LOG2( SIMPLE,
|
|
454 |
"SATENGINE: CSatMultiModeApi::IsValidUssdDcs lowQuartet: %x", lowQuartet)
|
|
455 |
|
|
456 |
switch ( codingGroup )
|
|
457 |
{
|
|
458 |
case 0x00:
|
|
459 |
case 0x02:
|
|
460 |
case 0x03:
|
|
461 |
case 0x0F:
|
|
462 |
{
|
|
463 |
isDcsValid = ETrue;
|
|
464 |
break;
|
|
465 |
}
|
|
466 |
|
|
467 |
case 0x01:
|
|
468 |
{
|
|
469 |
if ( ( KDcsCharacterSet7Bit2 == lowQuartet ) ||
|
|
470 |
( KDcsCharacterSet16Bit2 == lowQuartet ) )
|
|
471 |
{
|
|
472 |
isDcsValid = ETrue;
|
|
473 |
}
|
|
474 |
break;
|
|
475 |
}
|
|
476 |
|
|
477 |
case 0x04:
|
|
478 |
case 0x05:
|
|
479 |
case 0x06:
|
|
480 |
case 0x07:
|
|
481 |
case 0x09:
|
|
482 |
{
|
|
483 |
if ( ( KDcsCharacterSet7Bit == characterSet ) ||
|
|
484 |
( KDcsCharacterSet8Bit == characterSet ) ||
|
|
485 |
( KDcsCharacterSet16Bit == characterSet ) )
|
|
486 |
{
|
|
487 |
isDcsValid = ETrue;
|
|
488 |
}
|
|
489 |
break;
|
|
490 |
}
|
|
491 |
|
|
492 |
default:
|
|
493 |
{
|
|
494 |
LOG2( SIMPLE, "SATENGINE: CSatMultiModeApi::IsValidUssdDcs \
|
|
495 |
Reserved Dcs found: %x", aDcs )
|
|
496 |
}
|
|
497 |
}
|
|
498 |
|
|
499 |
LOG2(
|
|
500 |
SIMPLE,
|
|
501 |
"SATENGINE: CSatMultiModeApi::IsValidUssdDcs exiting, valid = %d",
|
|
502 |
isDcsValid )
|
|
503 |
return isDcsValid;
|
|
504 |
}
|
|
505 |
|
|
506 |
// -----------------------------------------------------------------------------
|
33
|
507 |
// CSatMultiModeApi::ConstructL
|
|
508 |
// -----------------------------------------------------------------------------
|
|
509 |
//
|
|
510 |
void CSatMultiModeApi::ConstructL()
|
|
511 |
{
|
|
512 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::ConstructL calling" )
|
|
513 |
|
|
514 |
// Connect to ETel Server
|
|
515 |
ConnectETelServerL();
|
|
516 |
#if !defined ( __WINSCW__ )
|
|
517 |
//On the emulator the load will leave. We can not use the functionaly
|
|
518 |
//on enmulator
|
|
519 |
LoadUssdMessagingL();
|
|
520 |
#endif
|
|
521 |
|
|
522 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::ConstructL exiting" )
|
|
523 |
}
|
|
524 |
|
|
525 |
// -----------------------------------------------------------------------------
|
|
526 |
// CSatMultiModeApi::ConnectETelServerL
|
|
527 |
// (other items were commented in a header).
|
|
528 |
// -----------------------------------------------------------------------------
|
|
529 |
//
|
|
530 |
void CSatMultiModeApi::ConnectETelServerL()
|
|
531 |
{
|
|
532 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::ConnectETelServerL calling" )
|
|
533 |
|
|
534 |
TInt numberOfTries( 1 ); // Indicates loop tryouts
|
|
535 |
TBool loopSuccess( EFalse ); // Loop stopper, if this is ETrue
|
|
536 |
TInt error = KErrNone; // Error that is Leave'd
|
|
537 |
|
|
538 |
if ( !iWrapper )
|
|
539 |
{
|
|
540 |
LOG( NORMAL, "SATENGINE: CSatMultiModeApi::ConnectETelServerL \
|
|
541 |
iWrapper false" )
|
|
542 |
iWrapper = new ( ELeave ) CSatSActiveWrapper();
|
|
543 |
}
|
|
544 |
|
|
545 |
// First loop is for connecting to RTelServer. Loop is done until
|
|
546 |
// connection returns KErrNone or when max loop try outs has been
|
|
547 |
// reached
|
|
548 |
while ( !loopSuccess && numberOfTries <= KLoopMaxTryouts )
|
|
549 |
{
|
|
550 |
error = iTelServer.Connect();
|
|
551 |
if ( KErrNone == error )
|
|
552 |
{
|
|
553 |
LOG( NORMAL, "SATENGINE: \
|
|
554 |
CSatMultiModeApi::ConnectETelServerL KErrNone == error" )
|
|
555 |
loopSuccess = ETrue;
|
|
556 |
}
|
|
557 |
else
|
|
558 |
{
|
|
559 |
numberOfTries++;
|
|
560 |
iWrapper->After( KLoopTimeout );
|
|
561 |
}
|
|
562 |
}
|
|
563 |
|
|
564 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::ConnectETelServerL \
|
|
565 |
numberOfTries: %i", numberOfTries )
|
|
566 |
|
|
567 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::ConnectETelServerL \
|
|
568 |
error: %i", error )
|
|
569 |
|
|
570 |
// Check the error status
|
|
571 |
User::LeaveIfError( error );
|
|
572 |
|
|
573 |
// Now load phone module
|
|
574 |
LoadPhoneModuleL( iPhone, KMmTsyModuleName, KMmTsyPhoneName );
|
|
575 |
|
|
576 |
#ifdef SAT_USE_DUMMY_TSY
|
|
577 |
// Also load dummy tsy
|
|
578 |
LoadPhoneModuleL( iDummyPhone, KSatSDummyTsyModuleName, KSatSDummyTsyPhoneName );
|
|
579 |
#endif // SAT_USE_DUMMY_TSY
|
|
580 |
|
|
581 |
User::LeaveIfError( iCustomPhone.Open( iPhone ) );
|
|
582 |
|
|
583 |
// No need for wrapper anymore
|
|
584 |
delete iWrapper;
|
|
585 |
iWrapper = NULL;
|
|
586 |
|
|
587 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::ConnectETelServerL exiting" )
|
|
588 |
}
|
|
589 |
|
|
590 |
// -----------------------------------------------------------------------------
|
|
591 |
// CSatMultiModeApi::LoadPhoneModuleL
|
|
592 |
// (other items were commented in a header).
|
|
593 |
// -----------------------------------------------------------------------------
|
|
594 |
//
|
|
595 |
void CSatMultiModeApi::LoadPhoneModuleL( RMobilePhone& aPhone,
|
|
596 |
const TDesC& aModuleName, const TDesC& aPhoneName )
|
|
597 |
{
|
|
598 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL calling" )
|
|
599 |
|
|
600 |
TInt numberOfTries( 1 ); // Indicates loop tryouts
|
|
601 |
TBool loopSuccess( EFalse ); // Loop stopper, if this is ETrue
|
|
602 |
TInt error = KErrNone; // Error that is Leave'd
|
|
603 |
|
|
604 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL \
|
|
605 |
ModuleName: %S", &aModuleName )
|
|
606 |
|
|
607 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL \
|
|
608 |
PhoneName: %S", &aPhoneName )
|
|
609 |
|
|
610 |
// We wait here until the phone module gets loaded.
|
|
611 |
// Load the correct phone module depending on the TSY being used.
|
|
612 |
while ( !loopSuccess && numberOfTries <= KLoopMaxTryouts )
|
|
613 |
{
|
|
614 |
error = iTelServer.LoadPhoneModule( aModuleName );
|
|
615 |
if ( KErrNone == error )
|
|
616 |
{
|
|
617 |
loopSuccess = ETrue;
|
|
618 |
}
|
|
619 |
else
|
|
620 |
{
|
|
621 |
numberOfTries++;
|
|
622 |
iWrapper->After( KLoopTimeout );
|
|
623 |
}
|
|
624 |
}
|
|
625 |
|
|
626 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL \
|
|
627 |
numberOfTries: %i", numberOfTries )
|
|
628 |
|
|
629 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL \
|
|
630 |
error: %i", error )
|
|
631 |
|
|
632 |
// Check the error status
|
|
633 |
User::LeaveIfError( error );
|
|
634 |
|
|
635 |
// This function retrieves the total number of phones supported by all
|
|
636 |
// the currently loaded ETel (TSY) modules.
|
|
637 |
TInt phoneCount( 0 );
|
|
638 |
User::LeaveIfError( iTelServer.EnumeratePhones( phoneCount ) );
|
|
639 |
|
|
640 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL \
|
|
641 |
phoneCount: %i", phoneCount )
|
|
642 |
|
|
643 |
// This function retrieves information associated with the specified phone
|
|
644 |
RTelServer::TPhoneInfo phoneInfo;
|
|
645 |
while ( phoneCount-- )
|
|
646 |
{
|
|
647 |
User::LeaveIfError( iTelServer.GetPhoneInfo( phoneCount,
|
|
648 |
phoneInfo ) );
|
|
649 |
|
|
650 |
// Check that do we have the right phone
|
|
651 |
if ( phoneInfo.iName == aPhoneName )
|
|
652 |
{
|
|
653 |
LOG( NORMAL, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL \
|
|
654 |
phoneInfo.iName == aPhoneName" )
|
|
655 |
phoneCount = 0;
|
|
656 |
}
|
|
657 |
}
|
|
658 |
|
|
659 |
if ( phoneInfo.iName != aPhoneName )
|
|
660 |
{
|
|
661 |
// Did not found correct phone info -> Leave
|
|
662 |
LOG( SIMPLE,
|
|
663 |
"SATENGINE: CSatMultiModeApi::LoadPhoneModuleL Not found" )
|
|
664 |
User::Leave( KErrNotFound );
|
|
665 |
}
|
|
666 |
|
|
667 |
// Reset the counter and loop status for the next loop.
|
|
668 |
numberOfTries = 1;
|
|
669 |
loopSuccess = EFalse;
|
|
670 |
|
|
671 |
// We wait here until the phone gets opened.
|
|
672 |
// Open the correct phone depending on the TSY being used.
|
|
673 |
while ( !loopSuccess && ( numberOfTries <= KLoopMaxTryouts ) )
|
|
674 |
{
|
|
675 |
error = aPhone.Open( iTelServer, aPhoneName );
|
|
676 |
|
|
677 |
if ( KErrNone == error )
|
|
678 |
{
|
|
679 |
LOG( NORMAL, "SATENGINE: \
|
|
680 |
CSatMultiModeApi::LoadPhoneModuleL KErrNone == error" )
|
|
681 |
loopSuccess = ETrue;
|
|
682 |
}
|
|
683 |
else
|
|
684 |
{
|
|
685 |
numberOfTries++;
|
|
686 |
iWrapper->After( KLoopTimeout );
|
|
687 |
}
|
|
688 |
}
|
|
689 |
if ( !loopSuccess )
|
|
690 |
{
|
|
691 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL\
|
|
692 |
phone open failed" );
|
|
693 |
}
|
|
694 |
|
|
695 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadPhoneModuleL exiting" )
|
|
696 |
}
|
|
697 |
|
|
698 |
// -----------------------------------------------------------------------------
|
|
699 |
// CSatMultiModeApi::LoadMobileCall
|
|
700 |
// (other items were commented in a header).
|
|
701 |
// -----------------------------------------------------------------------------
|
|
702 |
//
|
|
703 |
TInt CSatMultiModeApi::LoadMobileCall()
|
|
704 |
{
|
|
705 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadMobileCallL calling" )
|
|
706 |
|
|
707 |
if ( iCallOpened )
|
|
708 |
{
|
|
709 |
iCall.Close();
|
|
710 |
}
|
|
711 |
|
|
712 |
if ( iLineOpened )
|
|
713 |
{
|
|
714 |
iLine.Close();
|
|
715 |
}
|
|
716 |
|
|
717 |
TInt numberOfTries( 1 ); // Indicates loop tryouts
|
|
718 |
TBool loopSuccess( EFalse ); // Loop stopper, if this is ETrue
|
|
719 |
TInt error = KErrNone; // Error that is Leave'd
|
|
720 |
|
|
721 |
while ( !loopSuccess && numberOfTries <= KLoopMaxTryouts )
|
|
722 |
{
|
|
723 |
error = iLine.Open( iPhone, KMmTsyVoice1LineName );
|
|
724 |
if ( KErrNone == error )
|
|
725 |
{
|
|
726 |
loopSuccess = ETrue;
|
|
727 |
iLineOpened = ETrue;
|
|
728 |
}
|
|
729 |
else
|
|
730 |
{
|
|
731 |
numberOfTries++;
|
|
732 |
iWrapper->After( KLoopTimeout );
|
|
733 |
}
|
|
734 |
}
|
|
735 |
|
|
736 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadMobileCallL \
|
|
737 |
iLine numberOfTries: %i", numberOfTries )
|
|
738 |
|
|
739 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadMobileCallL \
|
|
740 |
iLine error: %i", error )
|
|
741 |
|
|
742 |
numberOfTries = 1;
|
|
743 |
loopSuccess = EFalse;
|
|
744 |
|
|
745 |
while ( iLineOpened &&!loopSuccess && numberOfTries <= KLoopMaxTryouts )
|
|
746 |
{
|
|
747 |
error = iCall.OpenNewCall( iLine );
|
|
748 |
if ( KErrNone == error )
|
|
749 |
{
|
|
750 |
loopSuccess = ETrue;
|
|
751 |
iCallOpened = ETrue;
|
|
752 |
}
|
|
753 |
else
|
|
754 |
{
|
|
755 |
numberOfTries++;
|
|
756 |
iWrapper->After( KLoopTimeout );
|
|
757 |
}
|
|
758 |
}
|
|
759 |
|
|
760 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadMobileCallL \
|
|
761 |
iCall numberOfTries: %i", numberOfTries )
|
|
762 |
|
|
763 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadMobileCallL \
|
|
764 |
iCall error: %i", error )
|
|
765 |
|
|
766 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadMobileCallL exiting" )
|
|
767 |
return error;
|
|
768 |
}
|
|
769 |
|
|
770 |
// -----------------------------------------------------------------------------
|
|
771 |
// CSatMultiModeApi::LoadMobileCallL
|
|
772 |
// (other items were commented in a header).
|
|
773 |
// -----------------------------------------------------------------------------
|
|
774 |
//
|
|
775 |
void CSatMultiModeApi::LoadUssdMessagingL()
|
|
776 |
|
|
777 |
{
|
|
778 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadUssdMessagingL calling" )
|
|
779 |
|
|
780 |
TInt numberOfTries( 1 ); // Indicates loop tryouts
|
|
781 |
TBool loopSuccess( EFalse ); // Loop stopper, if this is ETrue
|
|
782 |
TInt error = KErrNone; // Error that is Leave'd
|
|
783 |
|
|
784 |
while ( !loopSuccess && numberOfTries <= KLoopMaxTryouts )
|
|
785 |
{
|
|
786 |
error = iUssd.Open( iPhone );
|
|
787 |
if ( KErrNone == error )
|
|
788 |
{
|
|
789 |
loopSuccess = ETrue;
|
|
790 |
iUssdOpened = ETrue;
|
|
791 |
}
|
|
792 |
else
|
|
793 |
{
|
|
794 |
numberOfTries++;
|
|
795 |
iWrapper->After( KLoopTimeout );
|
|
796 |
}
|
|
797 |
}
|
|
798 |
|
|
799 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadUssdMessagingL \
|
|
800 |
iUssd numberOfTries: %i", numberOfTries )
|
|
801 |
|
|
802 |
LOG2( NORMAL, "SATENGINE: CSatMultiModeApi::LoadUssdMessagingL \
|
|
803 |
iUssd error: %i", error )
|
|
804 |
|
|
805 |
User::LeaveIfError( error );
|
|
806 |
|
|
807 |
LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::LoadUssdMessagingL exiting" )
|
|
808 |
}
|
|
809 |
|
|
810 |
|
|
811 |
//End of file
|