24
|
1 |
// Copyright (c) 2006-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 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "cmmsmstsy.h"
|
|
20 |
#include "cmmphonetsy.h"
|
|
21 |
#include "cmmsmsstoragetsy.h"
|
|
22 |
#include "cmmsmsgsmext.h"
|
|
23 |
#include "cmmtsyreqhandlestore.h"
|
|
24 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
25 |
#include "MmTsy_numberOfSlots.h"
|
|
26 |
#include <ctsy/serviceapi/cmmsmsutility.h>
|
|
27 |
#include "cmmsmssendrequest.h"
|
|
28 |
#include <ctsy/serviceapi/mstktsysatservice.h>
|
|
29 |
#include "CMmCommonStaticUtility.h"
|
|
30 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
31 |
#include <ctsy/pluginapi/cmmdatapackage.h>
|
|
32 |
#include <etelsat.h> // for Sat MO SM Control error values
|
|
33 |
|
|
34 |
|
|
35 |
// ======== MEMBER FUNCTIONS ========
|
|
36 |
|
|
37 |
CMmSmsTsy::CMmSmsTsy():
|
|
38 |
iReqHandleType(EMultimodeSmsReqHandleUnknown)
|
|
39 |
{
|
|
40 |
TFLOGSTRING("TSY: CMmSmsTsy::CMmSmsTsy: constructor");
|
|
41 |
}
|
|
42 |
|
|
43 |
void CMmSmsTsy::ConstructL()
|
|
44 |
{
|
|
45 |
TFLOGSTRING("TSY: CMmSmsTsy::ConstructL");
|
|
46 |
#ifdef REQHANDLE_TIMER
|
|
47 |
//create req handle store
|
|
48 |
iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone,
|
|
49 |
EMultimodeSmsMaxNumOfRequests, iSmsReqHandles );
|
|
50 |
#else
|
|
51 |
// create req handle store
|
|
52 |
iTsyReqHandleStore = CMmTsyReqHandleStore::NewL(
|
|
53 |
EMultimodeSmsMaxNumOfRequests, iSmsReqHandles );
|
|
54 |
#endif // REQHANDLE_TIMER
|
|
55 |
|
|
56 |
// Reset all CMmSmsTsy variables
|
|
57 |
ResetVariables();
|
|
58 |
|
|
59 |
// SMS message array
|
|
60 |
iSmsMsgArray = new ( ELeave ) CArrayPtrFlat<TSmsMsg>( 1 );
|
|
61 |
|
|
62 |
// Create GSM mode SMS extension
|
|
63 |
iMmSmsExtInterface = CMmSmsGsmExt::NewL();
|
|
64 |
|
|
65 |
|
|
66 |
// register sms tsy in the message manager
|
|
67 |
iMmPhone->MessageManager()->RegisterTsyObject(
|
|
68 |
CMmMessageManagerBase::ESmsMessagingTsy, this );
|
|
69 |
|
|
70 |
// at startup, there is no pending Send request
|
|
71 |
iSmsSendReq = NULL;
|
|
72 |
|
|
73 |
// Initialise off-line/on-line mode variable with information
|
|
74 |
// from PhoneTsy. After object construction, this information
|
|
75 |
// will be updated using DOS indications.
|
|
76 |
TRfStateInfo phoneRfInfo = iMmPhone->GetRfStateInfo();
|
|
77 |
if ( ERfsStateInfoInactive == phoneRfInfo )
|
|
78 |
{
|
|
79 |
iIsOffline = ETrue;
|
|
80 |
}
|
|
81 |
else
|
|
82 |
{
|
|
83 |
iIsOffline = EFalse;
|
|
84 |
}
|
|
85 |
TFLOGSTRING2("TSY: CMmSmsTsy::ConstructL: iIsOffline has been initialised to %d", iIsOffline);
|
|
86 |
|
|
87 |
// there's no pending ResumeSmsReception request at startup
|
|
88 |
iResumeSmsReceptionPending = EFalse;
|
|
89 |
|
|
90 |
// Initialization for sms NoFdnCheck
|
|
91 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUnknown;
|
|
92 |
|
|
93 |
iExpectAckOrNack = 0;
|
|
94 |
|
|
95 |
}
|
|
96 |
|
|
97 |
CMmSmsTsy* CMmSmsTsy::NewL(
|
|
98 |
CMmPhoneTsy* aMmPhone )
|
|
99 |
{
|
|
100 |
CMmSmsTsy* aMmSmsTsy = new ( ELeave ) CMmSmsTsy();
|
|
101 |
CleanupClosePushL(*aMmSmsTsy);
|
|
102 |
aMmSmsTsy->iMmPhone = aMmPhone;
|
|
103 |
aMmSmsTsy->ConstructL();
|
|
104 |
CleanupStack::Pop();
|
|
105 |
|
|
106 |
return aMmSmsTsy;
|
|
107 |
}
|
|
108 |
|
|
109 |
CMmSmsTsy::~CMmSmsTsy()
|
|
110 |
{
|
|
111 |
TFLOGSTRING("TSY: CMmSmsTsy::~CMmSmsTsy");
|
|
112 |
if ( iMmPhone )
|
|
113 |
{
|
|
114 |
// deregister tsy object from message manager
|
|
115 |
iMmPhone->MessageManager()->DeregisterTsyObject(this);
|
|
116 |
|
|
117 |
// Release the SMS routing from DOS to TSY.
|
|
118 |
// Send request to the Domestic OS layer. Ignore if it leaves
|
|
119 |
TInt trapError = KErrNone;
|
|
120 |
TRAP( trapError, iMmPhone->MessageManager()->HandleRequestL(
|
|
121 |
EMmTsyDeactivateSmsRouting ); );
|
|
122 |
}
|
|
123 |
|
|
124 |
// try to complete send sms message.
|
|
125 |
if ( iTsySatMessaging )
|
|
126 |
{
|
|
127 |
iTsySatMessaging->CompleteSendSmsMessage( KErrAccessDenied );
|
|
128 |
}
|
|
129 |
|
|
130 |
if ( iTsyReqHandleStore )
|
|
131 |
{
|
|
132 |
delete iTsyReqHandleStore;
|
|
133 |
iTsyReqHandleStore = NULL;
|
|
134 |
}
|
|
135 |
|
|
136 |
if ( iSmsMsgArray )
|
|
137 |
{
|
|
138 |
iSmsMsgArray->ResetAndDestroy();
|
|
139 |
delete iSmsMsgArray;
|
|
140 |
iSmsMsgArray = NULL;
|
|
141 |
}
|
|
142 |
|
|
143 |
// Delete extension object
|
|
144 |
if ( iMmSmsExtInterface )
|
|
145 |
{
|
|
146 |
delete iMmSmsExtInterface;
|
|
147 |
iMmSmsExtInterface = NULL;
|
|
148 |
}
|
|
149 |
|
|
150 |
if ( iMmPhone )
|
|
151 |
{
|
|
152 |
iMmPhone->SetSmsSession( NULL );
|
|
153 |
iMmPhone = NULL;
|
|
154 |
}
|
|
155 |
|
|
156 |
if ( iSmsSendReq )
|
|
157 |
{
|
|
158 |
delete iSmsSendReq;
|
|
159 |
iSmsSendReq = NULL;
|
|
160 |
}
|
|
161 |
|
|
162 |
if ( iSMSPClientId )
|
|
163 |
{
|
|
164 |
delete iSMSPClientId;
|
|
165 |
iSMSPClientId = NULL;
|
|
166 |
}
|
|
167 |
|
|
168 |
// set pointers to NULL
|
|
169 |
iMmSmsStorageTsy = NULL;
|
|
170 |
iTsySatMessaging = NULL;
|
|
171 |
iNotifyReceiveModeChangePtr = NULL;
|
|
172 |
iReceiveMessageParamsPtr = NULL;
|
|
173 |
iReceiveMessagePduPtr = NULL;
|
|
174 |
iNotifySmsBearerPtr = NULL;
|
|
175 |
iSendMessageMsgAttrPckgPtr = NULL;
|
|
176 |
iGetMessageStoreInfoPtr = NULL;
|
|
177 |
iStoreSmspBufferPtr = NULL;
|
|
178 |
}
|
|
179 |
|
|
180 |
// ---------------------------------------------------------------------------
|
|
181 |
// CMmSmsTsy::Init
|
|
182 |
// Initialisation method that is called from ETel Server
|
|
183 |
// (other items were commented in a header).
|
|
184 |
// ---------------------------------------------------------------------------
|
|
185 |
//
|
|
186 |
void CMmSmsTsy::Init()
|
|
187 |
{
|
|
188 |
}
|
|
189 |
|
|
190 |
// ---------------------------------------------------------------------------
|
|
191 |
// CMmSmsTsy::OpenNewObjectByNameL
|
|
192 |
// Creates new object and returns a pointer to it
|
|
193 |
// (other items were commented in a header).
|
|
194 |
// ---------------------------------------------------------------------------
|
|
195 |
//
|
|
196 |
CTelObject* CMmSmsTsy::OpenNewObjectByNameL(
|
|
197 |
const TDesC& aName )
|
|
198 |
{
|
|
199 |
if ( aName.Compare( KETelIccSmsStore ) == KErrNone )
|
|
200 |
{
|
|
201 |
iMmSmsStorageTsy = CMmSmsStorageTsy::NewL( this, iMmPhone,
|
|
202 |
iMmSmsExtInterface, iTsyReqHandleStore );
|
|
203 |
|
|
204 |
return iMmSmsStorageTsy;
|
|
205 |
}
|
|
206 |
|
|
207 |
// ME memory (KETelMeSmsStore) and combined memory (KETelCombinedSmsStore)
|
|
208 |
// are not supported
|
|
209 |
User::Leave( KErrNotSupported );
|
|
210 |
//lint -e{527} "unreachable code"
|
|
211 |
|
|
212 |
return NULL;
|
|
213 |
}
|
|
214 |
|
|
215 |
// ---------------------------------------------------------------------------
|
|
216 |
// CMmSmsTsy::OpenNewObjectL
|
|
217 |
// Creates new object and returns a pointer to it
|
|
218 |
// (other items were commented in a header).
|
|
219 |
// ---------------------------------------------------------------------------
|
|
220 |
//
|
|
221 |
CTelObject* CMmSmsTsy::OpenNewObjectL(
|
|
222 |
TDes& /*aNewName*/ )
|
|
223 |
{
|
|
224 |
// Not supported
|
|
225 |
User::Leave( KErrNotSupported );
|
|
226 |
//lint -e{527} "unreachable code"
|
|
227 |
|
|
228 |
return NULL;
|
|
229 |
}
|
|
230 |
|
|
231 |
// ---------------------------------------------------------------------------
|
|
232 |
// CMmSmsTsy::ExtFunc
|
|
233 |
// ExtFunc is called by the server when it has a "extended",
|
|
234 |
// i.e. non-core ETel request for the TSY. To process a request handle,
|
|
235 |
// request type and request data are passed to the TSY
|
|
236 |
// (other items were commented in a header).
|
|
237 |
// ---------------------------------------------------------------------------
|
|
238 |
//
|
|
239 |
TInt CMmSmsTsy::ExtFunc(
|
|
240 |
const TTsyReqHandle aTsyReqHandle,
|
|
241 |
const TInt aIpc,
|
|
242 |
const TDataPackage& aPackage )
|
|
243 |
{
|
|
244 |
TAny* dataPtr = aPackage.Ptr1();
|
|
245 |
TInt ret( KErrNone );
|
|
246 |
|
|
247 |
// before processing further the request, check if offline mode status
|
|
248 |
// is enabled and if the given request can be perfomed in that case.
|
|
249 |
if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() &&
|
|
250 |
!IsRequestPossibleInOffline( aIpc ) )
|
|
251 |
{
|
|
252 |
TFLOGSTRING2 ("TSY: Offline mode ON, request is not allowed: %d", aIpc );
|
|
253 |
TInt error = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral,
|
|
254 |
KErrGsmOfflineOpNotAllowed );
|
|
255 |
|
|
256 |
// Complete the request with appropiate error
|
|
257 |
ReqCompleted ( aTsyReqHandle, error );
|
|
258 |
}
|
|
259 |
else
|
|
260 |
{
|
|
261 |
switch ( aIpc )
|
|
262 |
{
|
|
263 |
// SMS messaging requests that doesn't need trapping
|
|
264 |
case EMobileSmsMessagingGetCaps:
|
|
265 |
ret = GetCaps( aTsyReqHandle, aPackage.Des1n() );
|
|
266 |
break;
|
|
267 |
case EMobileSmsMessagingGetReceiveMode:
|
|
268 |
ret = GetReceiveMode( aTsyReqHandle, reinterpret_cast<
|
|
269 |
RMobileSmsMessaging::TMobileSmsReceiveMode* >( dataPtr ) );
|
|
270 |
break;
|
|
271 |
case EMobileSmsMessagingGetMoSmsBearer:
|
|
272 |
ret = GetMoSmsBearer( aTsyReqHandle, reinterpret_cast<
|
|
273 |
RMobileSmsMessaging::TMobileSmsBearer* >( dataPtr) );
|
|
274 |
break;
|
|
275 |
case EMobileSmsMessagingSetMoSmsBearer:
|
|
276 |
ret = SetMoSmsBearer( aTsyReqHandle, reinterpret_cast<
|
|
277 |
RMobileSmsMessaging::TMobileSmsBearer*>( dataPtr) );
|
|
278 |
break;
|
|
279 |
case EMobileSmsMessagingEnumerateMessageStores:
|
|
280 |
ret = EnumerateMessageStores( aTsyReqHandle,
|
|
281 |
reinterpret_cast< TInt* >( dataPtr ) );
|
|
282 |
break;
|
|
283 |
case EMobileSmsMessagingGetSmspListPhase2:
|
|
284 |
ret = ReadSmspListPhase2( aTsyReqHandle, reinterpret_cast<
|
|
285 |
RMobilePhone::TClientId*>( dataPtr ), aPackage.Des2n() );
|
|
286 |
break;
|
|
287 |
// SMS messaging requests that need trapping
|
|
288 |
default:
|
|
289 |
// Ensure the ReqHandleType is unset.
|
|
290 |
// This will detect cases where this method indirectly calls itself
|
|
291 |
// (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
|
|
292 |
// Such cases are not supported because iReqHandleType is in the context of this class instance,
|
|
293 |
// not this request, and we don't want the values set by the inner request and the outer request
|
|
294 |
// interfering with each other.
|
|
295 |
__ASSERT_DEBUG(iReqHandleType==EMultimodeSmsReqHandleUnknown, User::Invariant());
|
|
296 |
|
|
297 |
TInt leaveCode( KErrNone );
|
|
298 |
TRAP( leaveCode, ret = DoExtFuncL( aTsyReqHandle, aIpc,
|
|
299 |
aPackage ); );
|
|
300 |
|
|
301 |
if ( KErrNone != leaveCode )
|
|
302 |
{
|
|
303 |
TFLOGSTRING3("CMmSmsTsy: Leave trapped!, IPC=%d, error value:%d", aIpc, leaveCode );
|
|
304 |
ReqCompleted( aTsyReqHandle, leaveCode );
|
|
305 |
}
|
|
306 |
|
|
307 |
//save request handle
|
|
308 |
if ( EMultimodeSmsReqHandleUnknown != iReqHandleType )
|
|
309 |
{
|
|
310 |
#ifdef REQHANDLE_TIMER
|
|
311 |
SetTypeOfResponse( iReqHandleType, aTsyReqHandle );
|
|
312 |
#else
|
|
313 |
//Never comes here. See SetTypeOfResponse.
|
|
314 |
iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType,
|
|
315 |
aTsyReqHandle );
|
|
316 |
#endif // REQHANDLE_TIMER
|
|
317 |
// We've finished with this value now. Clear it so it doesn't leak
|
|
318 |
// up to any other instances of this method down the call stack
|
|
319 |
iReqHandleType = EMultimodeSmsReqHandleUnknown;
|
|
320 |
}
|
|
321 |
break;
|
|
322 |
}
|
|
323 |
}
|
|
324 |
|
|
325 |
return ret;
|
|
326 |
}
|
|
327 |
|
|
328 |
// ---------------------------------------------------------------------------
|
|
329 |
// CMmSmsTsy::DoExtFuncL
|
|
330 |
// DoExtFuncL calls messaging methods that can leave
|
|
331 |
// (other items were commented in a header).
|
|
332 |
// ---------------------------------------------------------------------------
|
|
333 |
//
|
|
334 |
TInt CMmSmsTsy::DoExtFuncL(
|
|
335 |
const TTsyReqHandle aTsyReqHandle,
|
|
336 |
const TInt aIpc,
|
|
337 |
const TDataPackage& aPackage )
|
|
338 |
{
|
|
339 |
TAny* dataPtr = aPackage.Ptr1();
|
|
340 |
TAny* dataPtr2 = aPackage.Ptr2();
|
|
341 |
|
|
342 |
TInt ret( KErrNone );
|
|
343 |
|
|
344 |
switch ( aIpc )
|
|
345 |
{
|
|
346 |
// SMS messaging requests
|
|
347 |
case EMobileSmsMessagingSetReceiveMode:
|
|
348 |
ret = SetReceiveMode( aTsyReqHandle, reinterpret_cast<
|
|
349 |
RMobileSmsMessaging::TMobileSmsReceiveMode* >( dataPtr ) );
|
|
350 |
break;
|
|
351 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
352 |
ret = NotifyReceiveModeChange( reinterpret_cast<
|
|
353 |
RMobileSmsMessaging::TMobileSmsReceiveMode*>( dataPtr) );
|
|
354 |
break;
|
|
355 |
case EMobileSmsMessagingReceiveMessage:
|
|
356 |
ret = ReceiveMessageL( aTsyReqHandle, aPackage.Des1n(),
|
|
357 |
aPackage.Des2n() );
|
|
358 |
break;
|
|
359 |
case EMobileSmsMessagingAckSmsStored:
|
|
360 |
ret = AckSmsStoredL( aTsyReqHandle, aPackage.Des1n(),
|
|
361 |
reinterpret_cast< TBool* >( dataPtr2 ) );
|
|
362 |
break;
|
|
363 |
case EMobileSmsMessagingNackSmsStored:
|
|
364 |
ret = NackSmsStoredL( aTsyReqHandle, aPackage.Des1n(),
|
|
365 |
reinterpret_cast< TInt* >( dataPtr2 ) );
|
|
366 |
break;
|
|
367 |
case EMobileSmsMessagingResumeSmsReception:
|
|
368 |
ret = ResumeSmsReceptionL( aTsyReqHandle );
|
|
369 |
break;
|
|
370 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
371 |
ret = NotifyMoSmsBearerChange( reinterpret_cast<
|
|
372 |
RMobileSmsMessaging::TMobileSmsBearer*> ( dataPtr ) );
|
|
373 |
break;
|
|
374 |
case EMobileSmsMessagingSendMessage:
|
|
375 |
{
|
|
376 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckNotUsed;
|
|
377 |
ret = SendMessageL( aTsyReqHandle, aPackage.Des1n(),
|
|
378 |
aPackage.Des2n() );
|
|
379 |
}
|
|
380 |
break;
|
|
381 |
case EMobileSmsMessagingSendMessageNoFdnCheck:
|
|
382 |
{
|
|
383 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUsed;
|
|
384 |
ret = SendMessageL( aTsyReqHandle, aPackage.Des1n(),
|
|
385 |
aPackage.Des2n() );
|
|
386 |
}
|
|
387 |
break;
|
|
388 |
case EMobileSmsMessagingGetMessageStoreInfo:
|
|
389 |
ret = GetMessageStoreInfoL( aTsyReqHandle,
|
|
390 |
reinterpret_cast< TInt* >( dataPtr ), aPackage.Des2n() );
|
|
391 |
break;
|
|
392 |
case EMobileSmsMessagingGetSmspListPhase1:
|
|
393 |
ret = ReadSmspListPhase1L( aTsyReqHandle,
|
|
394 |
reinterpret_cast< RMobilePhone::TClientId*>( dataPtr ),
|
|
395 |
reinterpret_cast< TInt* >( dataPtr2 ) );
|
|
396 |
break;
|
|
397 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
398 |
ret = NotifySmspListChange();
|
|
399 |
break;
|
|
400 |
case EMobileSmsMessagingStoreSmspList:
|
|
401 |
ret = StoreSmspList( aTsyReqHandle, aPackage.Des1n() );
|
|
402 |
break;
|
|
403 |
default:
|
|
404 |
ret = KErrNotSupported;
|
|
405 |
break;
|
|
406 |
}
|
|
407 |
|
|
408 |
return ret;
|
|
409 |
}
|
|
410 |
|
|
411 |
// ---------------------------------------------------------------------------
|
|
412 |
// CMmSmsTsy::ReqModeL
|
|
413 |
// When the ETel server receives an "extension" client request,
|
|
414 |
// it will pass the IPC request number down to the TSY in order to find out
|
|
415 |
// what type of request it is
|
|
416 |
// (other items were commented in a header).
|
|
417 |
// ---------------------------------------------------------------------------
|
|
418 |
//
|
|
419 |
CTelObject::TReqMode CMmSmsTsy::ReqModeL(
|
|
420 |
const TInt aIpc )
|
|
421 |
{
|
|
422 |
CTelObject::TReqMode ret = 0;
|
|
423 |
switch ( aIpc )
|
|
424 |
{
|
|
425 |
// Non-flow Controlled Services
|
|
426 |
case EMobileSmsMessagingGetCaps:
|
|
427 |
case EMobileSmsMessagingGetMoSmsBearer:
|
|
428 |
case EMobileSmsMessagingSetMoSmsBearer:
|
|
429 |
case EMobileSmsMessagingGetReceiveMode:
|
|
430 |
case EMobileSmsMessagingEnumerateMessageStores:
|
|
431 |
case EMobileSmsMessagingGetSmspListPhase2:
|
|
432 |
case EMobileSmsMessagingAckSmsStored:
|
|
433 |
case EMobileSmsMessagingNackSmsStored:
|
|
434 |
case EMobileSmsMessagingSendMessage:
|
|
435 |
case EMobileSmsMessagingSendMessageNoFdnCheck:
|
|
436 |
case EMobileSmsMessagingResumeSmsReception:
|
|
437 |
case EMobileSmsMessagingGetMessageStoreInfo:
|
|
438 |
case EMobileSmsMessagingGetSmspListPhase1:
|
|
439 |
case EMobileSmsMessagingStoreSmspList:
|
|
440 |
case EMobileSmsMessagingSetReceiveMode:
|
|
441 |
break;
|
|
442 |
// Immediate Server Repost - but not multiple completion enabled
|
|
443 |
case EMobileSmsMessagingReceiveMessage:
|
|
444 |
ret = KReqModeRePostImmediately;
|
|
445 |
break;
|
|
446 |
// Multiple Completion Services with Immediate Server Repost
|
|
447 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
448 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
449 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
450 |
ret = KReqModeMultipleCompletionEnabled |
|
|
451 |
KReqModeRePostImmediately;
|
|
452 |
break;
|
|
453 |
default:
|
|
454 |
User::Leave( KErrNotSupported );
|
|
455 |
break;
|
|
456 |
}
|
|
457 |
|
|
458 |
return ret;
|
|
459 |
}
|
|
460 |
|
|
461 |
//----------------------------------------------------------------------------
|
|
462 |
// CMmSmsTsy::NumberOfSlotsL
|
|
463 |
// When the ETel server discovers that a request is "repost
|
|
464 |
// immediately" it will ask the TSY how big a buffer it wants.
|
|
465 |
// NumberOfSlotsL Returns number of slots to be used for given requests
|
|
466 |
// (other items were commented in a header).
|
|
467 |
// ---------------------------------------------------------------------------
|
|
468 |
//
|
|
469 |
TInt CMmSmsTsy::NumberOfSlotsL(
|
|
470 |
const TInt aIpc )
|
|
471 |
{
|
|
472 |
TInt numberOfSlots = 1;
|
|
473 |
switch ( aIpc )
|
|
474 |
{
|
|
475 |
case EMobileSmsMessagingReceiveMessage:
|
|
476 |
numberOfSlots = KMmSmsMessagingReceiveMessageSlots;
|
|
477 |
break;
|
|
478 |
// It is safer that normal notification trigger value is three
|
|
479 |
// => Slotlimits are defined according to the requirements of
|
|
480 |
// environment, five for messagereception and three for normal
|
|
481 |
// notifications
|
|
482 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
483 |
numberOfSlots = KMmSmsMessagingNotifyReceiveModeChangeSlots;
|
|
484 |
break;
|
|
485 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
486 |
numberOfSlots = KMmSmsMessagingNotifyMoSmsBearerChangeSlots;
|
|
487 |
break;
|
|
488 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
489 |
numberOfSlots = KMmSmsMessagingNotifySmspListChangeSlots;
|
|
490 |
break;
|
|
491 |
default:
|
|
492 |
User::Leave( KErrNotSupported );
|
|
493 |
break;
|
|
494 |
}
|
|
495 |
|
|
496 |
return numberOfSlots;
|
|
497 |
}
|
|
498 |
|
|
499 |
//----------------------------------------------------------------------------
|
|
500 |
// CMmSmsTsy::CancelService
|
|
501 |
// CancelService is called by the server when it is
|
|
502 |
// "cleaning-up" any still outstanding asynchronous requests before closing
|
|
503 |
// a client's sub-session. This will happen if a client closes its R-class
|
|
504 |
// handle without cancelling outstanding asynchronous requests on
|
|
505 |
// (other items were commented in a header).
|
|
506 |
// ---------------------------------------------------------------------------
|
|
507 |
//
|
|
508 |
TInt CMmSmsTsy::CancelService(
|
|
509 |
const TInt aIpc,
|
|
510 |
const TTsyReqHandle aTsyReqHandle )
|
|
511 |
{
|
|
512 |
TInt ret( KErrNone );
|
|
513 |
|
|
514 |
switch ( aIpc )
|
|
515 |
{
|
|
516 |
case EMobileSmsMessagingSetReceiveMode:
|
|
517 |
ret = SetReceiveModeCancel( aTsyReqHandle );
|
|
518 |
break;
|
|
519 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
520 |
ret = NotifyReceiveModeChangeCancel( aTsyReqHandle );
|
|
521 |
break;
|
|
522 |
case EMobileSmsMessagingSetMoSmsBearer:
|
|
523 |
ret = SetMoSmsBearerCancel( aTsyReqHandle );
|
|
524 |
break;
|
|
525 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
526 |
ret = NotifyMoSmsBearerChangeCancel( aTsyReqHandle );
|
|
527 |
break;
|
|
528 |
case EMobileSmsMessagingGetMessageStoreInfo:
|
|
529 |
ret = GetMessageStoreInfoCancel( aTsyReqHandle );
|
|
530 |
break;
|
|
531 |
case EMobileSmsMessagingGetSmspListPhase1:
|
|
532 |
case EMobileSmsMessagingGetSmspListPhase2:
|
|
533 |
ret = ReadAllSmspCancel( aTsyReqHandle );
|
|
534 |
break;
|
|
535 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
536 |
ret = NotifySmspListChangeCancel( aTsyReqHandle );
|
|
537 |
break;
|
|
538 |
case EMobileSmsMessagingSendMessage:
|
|
539 |
case EMobileSmsMessagingAckSmsStored:
|
|
540 |
case EMobileSmsMessagingNackSmsStored:
|
|
541 |
case EMobileSmsMessagingResumeSmsReception:
|
|
542 |
case EMobileSmsMessagingStoreSmspList:
|
|
543 |
break;
|
|
544 |
case EMobileSmsMessagingReceiveMessage:
|
|
545 |
ret = ReceiveMessageCancel( aTsyReqHandle );
|
|
546 |
break;
|
|
547 |
case EMobileSmsMessagingSendMessageNoFdnCheck:
|
|
548 |
ret = SendMessageNoFdnCheckCancel( aTsyReqHandle );
|
|
549 |
break;
|
|
550 |
default:
|
|
551 |
ret = KErrGeneral;
|
|
552 |
break;
|
|
553 |
}
|
|
554 |
|
|
555 |
return ret;
|
|
556 |
}
|
|
557 |
|
|
558 |
//----------------------------------------------------------------------------
|
|
559 |
// CMmSmsTsy::RegisterNotification
|
|
560 |
// Called when the server recognises that this notification
|
|
561 |
// is being posted for the first time on this sub-session object.It enables
|
|
562 |
// the TSY to "turn on" any regular notification messages that it may
|
|
563 |
// receive from DOS
|
|
564 |
// (other items were commented in a header).
|
|
565 |
// ---------------------------------------------------------------------------
|
|
566 |
//
|
|
567 |
TInt CMmSmsTsy::RegisterNotification(
|
|
568 |
const TInt aIpc )
|
|
569 |
{
|
|
570 |
TInt ret( KErrNotSupported );
|
|
571 |
|
|
572 |
switch ( aIpc )
|
|
573 |
{
|
|
574 |
case EMobileSmsMessagingReceiveMessage:
|
|
575 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
576 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
577 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
578 |
ret = KErrNone;
|
|
579 |
break;
|
|
580 |
default:
|
|
581 |
ret = KErrNotSupported;
|
|
582 |
}
|
|
583 |
|
|
584 |
return ret;
|
|
585 |
}
|
|
586 |
|
|
587 |
//----------------------------------------------------------------------------
|
|
588 |
// CMmSmsTsy::DeregisterNotification
|
|
589 |
// Called when the server recognises that this notification
|
|
590 |
// will not be posted again because the last client to have
|
|
591 |
// a handle on this sub-session object has just closed the handle.
|
|
592 |
// It enables the TSY to "turn off" any regular notification messages that
|
|
593 |
// it may receive from the DOS
|
|
594 |
// (other items were commented in a header).
|
|
595 |
// ---------------------------------------------------------------------------
|
|
596 |
//
|
|
597 |
TInt CMmSmsTsy::DeregisterNotification(
|
|
598 |
const TInt aIpc )
|
|
599 |
{
|
|
600 |
TInt ret( KErrNotSupported );
|
|
601 |
|
|
602 |
switch ( aIpc )
|
|
603 |
{
|
|
604 |
case EMobileSmsMessagingReceiveMessage:
|
|
605 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
606 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
607 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
608 |
ret = KErrNone;
|
|
609 |
break;
|
|
610 |
default:
|
|
611 |
ret = KErrNotSupported;
|
|
612 |
}
|
|
613 |
|
|
614 |
return ret;
|
|
615 |
}
|
|
616 |
|
|
617 |
//----------------------------------------------------------------------------
|
|
618 |
// CMmSmsTsy::GetCaps
|
|
619 |
// This method returns SMS messaging capabilities of the phone
|
|
620 |
// (other items were commented in a header).
|
|
621 |
// ---------------------------------------------------------------------------
|
|
622 |
//
|
|
623 |
TInt CMmSmsTsy::GetCaps(
|
|
624 |
const TTsyReqHandle aTsyReqHandle,
|
|
625 |
TDes8* aCaps )
|
|
626 |
{
|
|
627 |
if(sizeof(RMobileSmsMessaging::TMobileSmsCapsV1) > aCaps->Size())
|
|
628 |
{
|
|
629 |
return KErrArgument;
|
|
630 |
}
|
|
631 |
|
|
632 |
RMobileSmsMessaging::TMobileSmsCapsV1Pckg* smsCapsPckg =
|
|
633 |
reinterpret_cast< RMobileSmsMessaging::TMobileSmsCapsV1Pckg* >( aCaps );
|
|
634 |
RMobileSmsMessaging::TMobileSmsCapsV1& smsCaps = ( *smsCapsPckg )();
|
|
635 |
|
|
636 |
// Capabilities depend on the TSY implementation.
|
|
637 |
smsCaps.iSmsMode = KSmsGsmModeCaps;
|
|
638 |
smsCaps.iSmsControl = KSmsControlCaps;
|
|
639 |
|
|
640 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
641 |
|
|
642 |
return KErrNone;
|
|
643 |
}
|
|
644 |
|
|
645 |
//----------------------------------------------------------------------------
|
|
646 |
// CMmSmsTsy::GetReceiveMode
|
|
647 |
// This method retrieves the current setting of the TSY-phone
|
|
648 |
// incoming SMS receive mode
|
|
649 |
// (other items were commented in a header).
|
|
650 |
// ---------------------------------------------------------------------------
|
|
651 |
//
|
|
652 |
TInt CMmSmsTsy::GetReceiveMode(
|
|
653 |
const TTsyReqHandle aTsyReqHandle,
|
|
654 |
RMobileSmsMessaging::TMobileSmsReceiveMode* aReceiveMode )
|
|
655 |
{
|
|
656 |
*aReceiveMode = iMobileSmsReceiveMode;
|
|
657 |
|
|
658 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
659 |
|
|
660 |
return KErrNone;
|
|
661 |
}
|
|
662 |
|
|
663 |
//----------------------------------------------------------------------------
|
|
664 |
// CMmSmsTsy::SetReceiveMode
|
|
665 |
// This method sets the setting of the TSY-phone incoming SMS receive mode
|
|
666 |
// (other items were commented in a header).
|
|
667 |
// ---------------------------------------------------------------------------
|
|
668 |
//
|
|
669 |
TInt CMmSmsTsy::SetReceiveMode(
|
|
670 |
const TTsyReqHandle aTsyReqHandle,
|
|
671 |
RMobileSmsMessaging::TMobileSmsReceiveMode const* aReceiveMode )
|
|
672 |
{
|
|
673 |
if ( RMobileSmsMessaging::EReceiveUnstoredClientAck == *aReceiveMode )
|
|
674 |
{
|
|
675 |
iMobileSmsReceiveMode = *aReceiveMode;
|
|
676 |
|
|
677 |
CompleteNotifyReceiveModeChange();
|
|
678 |
|
|
679 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
680 |
}
|
|
681 |
else
|
|
682 |
{
|
|
683 |
// EReceiveModeUnspecified, EReceiveStored, EReceiveUnstoredPhoneAck &
|
|
684 |
// EReceiveAny modes not supported because of CS functionality.
|
|
685 |
ReqCompleted( aTsyReqHandle, KErrNotSupported );
|
|
686 |
}
|
|
687 |
|
|
688 |
return KErrNone;
|
|
689 |
}
|
|
690 |
|
|
691 |
//----------------------------------------------------------------------------
|
|
692 |
// CMmSmsTsy::SetReceiveModeCancel
|
|
693 |
// This method is used to cancel the outstanding asynchronous
|
|
694 |
// SetReceiveMode request
|
|
695 |
// (other items were commented in a header).
|
|
696 |
// ---------------------------------------------------------------------------
|
|
697 |
//
|
|
698 |
TInt CMmSmsTsy::SetReceiveModeCancel(
|
|
699 |
const TTsyReqHandle aTsyReqHandle )
|
|
700 |
{
|
|
701 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
702 |
|
|
703 |
return KErrNone;
|
|
704 |
}
|
|
705 |
|
|
706 |
//----------------------------------------------------------------------------
|
|
707 |
// CMmSmsTsy::NotifyReceiveModeChange
|
|
708 |
// This method is used to notify the client if there is a
|
|
709 |
// change to the receive mode setting
|
|
710 |
// (other items were commented in a header).
|
|
711 |
// ---------------------------------------------------------------------------
|
|
712 |
//
|
|
713 |
TInt CMmSmsTsy::NotifyReceiveModeChange(
|
|
714 |
RMobileSmsMessaging::TMobileSmsReceiveMode* aReceiveMode )
|
|
715 |
{
|
|
716 |
iReqHandleType = EMultimodeSmsNotifyReceiveModeChange;
|
|
717 |
iNotifyReceiveModeChangePtr = aReceiveMode;
|
|
718 |
|
|
719 |
return KErrNone;
|
|
720 |
}
|
|
721 |
|
|
722 |
//----------------------------------------------------------------------------
|
|
723 |
// CMmSmsTsy::NotifyReceiveModeChangeCancel
|
|
724 |
// This method cancel notify receive mode change request
|
|
725 |
// (other items were commented in a header).
|
|
726 |
// ---------------------------------------------------------------------------
|
|
727 |
//
|
|
728 |
TInt CMmSmsTsy::NotifyReceiveModeChangeCancel(
|
|
729 |
const TTsyReqHandle aTsyReqHandle )
|
|
730 |
{
|
|
731 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
732 |
EMultimodeSmsNotifyReceiveModeChange );
|
|
733 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
734 |
iNotifyReceiveModeChangePtr = NULL;
|
|
735 |
|
|
736 |
return KErrNone;
|
|
737 |
}
|
|
738 |
|
|
739 |
//----------------------------------------------------------------------------
|
|
740 |
// CMmSmsTsy::CompleteNotifyReceiveModeChange
|
|
741 |
// This method completes notify receive mode change request
|
|
742 |
// (other items were commented in a header).
|
|
743 |
// ---------------------------------------------------------------------------
|
|
744 |
//
|
|
745 |
void CMmSmsTsy::CompleteNotifyReceiveModeChange()
|
|
746 |
{
|
|
747 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
748 |
EMultimodeSmsNotifyReceiveModeChange );
|
|
749 |
|
|
750 |
if ( reqHandle )
|
|
751 |
{
|
|
752 |
if ( iNotifyReceiveModeChangePtr )
|
|
753 |
{
|
|
754 |
*iNotifyReceiveModeChangePtr = iMobileSmsReceiveMode;
|
|
755 |
}
|
|
756 |
ReqCompleted( reqHandle, KErrNone );
|
|
757 |
}
|
|
758 |
}
|
|
759 |
|
|
760 |
//----------------------------------------------------------------------------
|
|
761 |
// CMmSmsTsy::ReceiveMessageL
|
|
762 |
// This method starts the reception of incoming unstored SMS
|
|
763 |
// (other items were commented in a header).
|
|
764 |
// ---------------------------------------------------------------------------
|
|
765 |
//
|
|
766 |
TInt CMmSmsTsy::ReceiveMessageL(
|
|
767 |
const TTsyReqHandle aTsyReqHandle,
|
|
768 |
TDes8* aMsgData,
|
|
769 |
TDes8* aMsgAttributes )
|
|
770 |
{
|
|
771 |
TFLOGSTRING("TSY: CMmSmsTsy::ReceiveMessageL\n");
|
|
772 |
|
|
773 |
if(sizeof(RMobileSmsMessaging::TMobileSmsReceiveAttributesV1) > aMsgAttributes->Size())
|
|
774 |
{
|
|
775 |
return KErrArgument;
|
|
776 |
}
|
|
777 |
|
|
778 |
iReceiveMessagePduPtr = aMsgData;
|
|
779 |
iReceiveMessageParamsPtr = aMsgAttributes;
|
|
780 |
|
|
781 |
if ( iMmPhone->IsModemStatusReady() )
|
|
782 |
{
|
|
783 |
// activate smsrouting only when modem status is ready
|
|
784 |
ActivateSmsRoutingL();
|
|
785 |
}
|
|
786 |
|
|
787 |
// Store request handle here. DeliverClass2ToSmsStack-method may complete
|
|
788 |
// ReceiveMessage request
|
|
789 |
#ifdef REQHANDLE_TIMER
|
|
790 |
SetTypeOfResponse( EMultimodeSmsReceiveMessage, aTsyReqHandle );
|
|
791 |
#else
|
|
792 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
793 |
EMultimodeSmsReceiveMessage, aTsyReqHandle );
|
|
794 |
#endif // REQHANDLE_TIMER
|
|
795 |
|
|
796 |
// Check if there is class 2 messages waiting in TSY's internal memory.
|
|
797 |
DeliverClass2ToSmsStack();
|
|
798 |
|
|
799 |
return KErrNone;
|
|
800 |
}
|
|
801 |
|
|
802 |
//----------------------------------------------------------------------------
|
|
803 |
// CMmSmsTsy::ReceiveMessageCancel
|
|
804 |
// This method cancels an MT message routing to the SMS
|
|
805 |
// stack. TSY can not stop routing from SMS server because
|
|
806 |
// otherwise SMS server routes incoming messages to SIM server.
|
|
807 |
// Negative acknowledgement is sent to the network if message
|
|
808 |
// comes when SMS stack routing is not activated
|
|
809 |
// (other items were commented in a header).
|
|
810 |
// ---------------------------------------------------------------------------
|
|
811 |
//
|
|
812 |
TInt CMmSmsTsy::ReceiveMessageCancel(
|
|
813 |
const TTsyReqHandle aTsyReqHandle )
|
|
814 |
{
|
|
815 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsReceiveMessage );
|
|
816 |
|
|
817 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
818 |
|
|
819 |
return KErrNone;
|
|
820 |
}
|
|
821 |
|
|
822 |
//----------------------------------------------------------------------------
|
|
823 |
// CMmSmsTsy::ActivateSmsRoutingL
|
|
824 |
// Activate SMS routing
|
|
825 |
// (other items were commented in a header).
|
|
826 |
// ---------------------------------------------------------------------------
|
|
827 |
//
|
|
828 |
void CMmSmsTsy::ActivateSmsRoutingL()
|
|
829 |
{
|
|
830 |
if ( ( ERoutingNotActivated == iServerRoutingActivity ) ||
|
|
831 |
( ERoutingActivating == iServerRoutingActivity ) )
|
|
832 |
{
|
|
833 |
//Send request to the Domestic OS layer..
|
|
834 |
User::LeaveIfError( iMmPhone->MessageManager()->HandleRequestL(
|
|
835 |
EMmTsyActivateSmsRouting ) );
|
|
836 |
iServerRoutingActivity = ERoutingActivating;
|
|
837 |
}
|
|
838 |
}
|
|
839 |
|
|
840 |
//----------------------------------------------------------------------------
|
|
841 |
// CMmSmsTsy::CompleteActivateSmsRouting
|
|
842 |
// This method completes Activation of SMS routing
|
|
843 |
// (other items were commented in a header).
|
|
844 |
// ---------------------------------------------------------------------------
|
|
845 |
//
|
|
846 |
void CMmSmsTsy::CompleteActivateSmsRouting(
|
|
847 |
TInt aError,
|
|
848 |
CMmDataPackage* aDataPackage )
|
|
849 |
{
|
|
850 |
TUint8 aSmsRoutingStatus ( 0 );
|
|
851 |
aDataPackage->UnPackData( aSmsRoutingStatus ) ;
|
|
852 |
|
|
853 |
if ( ( KErrNone == aError ) &&
|
|
854 |
( KSmsRoutingActivated == aSmsRoutingStatus ) )
|
|
855 |
{
|
|
856 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing activated");
|
|
857 |
iServerRoutingActivity = ERoutingActivated;
|
|
858 |
}
|
|
859 |
else if ( ( KErrNone == aError ) &&
|
|
860 |
( KSmsRoutingDeactivated == aSmsRoutingStatus ) )
|
|
861 |
{
|
|
862 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing not activated");
|
|
863 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
864 |
}
|
|
865 |
else
|
|
866 |
{
|
|
867 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing activation failed");
|
|
868 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
869 |
|
|
870 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
871 |
EMultimodeSmsReceiveMessage );
|
|
872 |
|
|
873 |
if ( reqHandle )
|
|
874 |
{
|
|
875 |
ReqCompleted( reqHandle, aError );
|
|
876 |
}
|
|
877 |
}
|
|
878 |
}
|
|
879 |
|
|
880 |
//----------------------------------------------------------------------------
|
|
881 |
// CMmSmsTsy::CompleteReceiveMessage
|
|
882 |
// This method completes reception of incoming unstored SMS
|
|
883 |
// (other items were commented in a header).
|
|
884 |
// ---------------------------------------------------------------------------
|
|
885 |
//
|
|
886 |
void CMmSmsTsy::CompleteReceiveMessage(
|
|
887 |
TInt aError,
|
|
888 |
CMmDataPackage* aDataPackage )
|
|
889 |
{
|
|
890 |
TInt ret( KErrNone );
|
|
891 |
TBool smsInd( EFalse );
|
|
892 |
TSmsMsg* smsMsg;
|
|
893 |
|
|
894 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
895 |
EMultimodeSmsReceiveMessage );
|
|
896 |
|
|
897 |
TFLOGSTRING2("TSY: CMmSmsTsy::CompleteReceiveMessage. iClientStorageFull: %d", iClientStorageFull );
|
|
898 |
|
|
899 |
// SMS successfully received
|
|
900 |
if ( KErrNone == aError )
|
|
901 |
{
|
|
902 |
//unpack received data
|
|
903 |
aDataPackage->UnPackData( smsInd, smsMsg );
|
|
904 |
|
|
905 |
// is the SMS a class2 SMS or not.
|
|
906 |
TBool smsClass2 = smsMsg->iSmsClass2;
|
|
907 |
|
|
908 |
// if store is not full, receive new class2 message and get
|
|
909 |
// notification
|
|
910 |
if ( smsClass2 && ( 0 != smsMsg->iLocation ) && iMmSmsStorageTsy )
|
|
911 |
{
|
|
912 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage. CompleteNotifyStoreEvent happens");
|
|
913 |
iMmSmsStorageTsy->CMmSmsStorageTsy::CompleteNotifyStoreEvent(
|
|
914 |
smsMsg->iLocation, RMobilePhoneStore::KStoreEntryAdded );
|
|
915 |
}
|
|
916 |
|
|
917 |
// if SMS is a Class2 and SMS Memories are full and SIM SMS Memory
|
|
918 |
// not full
|
|
919 |
if ( iClientStorageFull && smsClass2 )
|
|
920 |
{
|
|
921 |
if ( reqHandle )
|
|
922 |
{
|
|
923 |
// Store SMS in TSY's internal memory
|
|
924 |
TRAP( ret, StoreClass2MessageL( smsMsg ) );
|
|
925 |
|
|
926 |
// Message is not delivered to SMS Stack.Deliver message to
|
|
927 |
// SMS. Stack after SMS Stack has called ReceiveMessage..
|
|
928 |
smsMsg->iDeleteAfterClientAck = EFalse;
|
|
929 |
|
|
930 |
#ifdef USING_CTSY_DISPATCHER
|
|
931 |
CMmDataPackage package;
|
|
932 |
TDesC8* msgData = NULL;
|
|
933 |
package.PackData( &msgData );
|
|
934 |
|
|
935 |
// ignore if Acking fails
|
|
936 |
TRAP_IGNORE(
|
|
937 |
ret = iMmPhone->MessageManager()->HandleRequestL(EMobileSmsMessagingAckSmsStored, &package);
|
|
938 |
);
|
|
939 |
iTsyReqHandleStore->ResetTsyReqHandle(EMultimodeSmsReceiveMessage);
|
|
940 |
ReqCompleted(reqHandle, aError);
|
|
941 |
#else
|
|
942 |
// ignore if Acking fails
|
|
943 |
TRAP_IGNORE(
|
|
944 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
945 |
EMobileSmsMessagingAckSmsStored );
|
|
946 |
);
|
|
947 |
#endif //USING_CTSY_DISPATCHER
|
|
948 |
}
|
|
949 |
else
|
|
950 |
{
|
|
951 |
// Routing is activated, but SMS stack hasn't called
|
|
952 |
// ReceiveMessage. Nack received message internally with cause
|
|
953 |
// value "protocol error", otherwise SMS server releases
|
|
954 |
// routings.
|
|
955 |
CMmDataPackage package;
|
|
956 |
TSmsMsg* nullSms = NULL;
|
|
957 |
TInt rpCause( KErrGsmSMSMemoryCapacityExceeded );
|
|
958 |
package.PackData( &nullSms, &rpCause );
|
|
959 |
|
|
960 |
// ignore if Nacking fails
|
|
961 |
TRAP_IGNORE(
|
|
962 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
963 |
EMobileSmsMessagingNackSmsStored, &package );
|
|
964 |
);
|
|
965 |
}
|
|
966 |
}
|
|
967 |
else
|
|
968 |
{
|
|
969 |
// Class 0 or Class 1 or Class 2 message received.
|
|
970 |
// This message has to be acknowledged to the network
|
|
971 |
TInt rpError( KErrNone );
|
|
972 |
|
|
973 |
if ( reqHandle && !iClientStorageFull )
|
|
974 |
{
|
|
975 |
// Deliver message to SMS stack
|
|
976 |
if(smsMsg->iSmsMsg.Length() > iReceiveMessagePduPtr->MaxLength())
|
|
977 |
{
|
|
978 |
ret = KErrArgument;
|
|
979 |
}
|
|
980 |
else
|
|
981 |
{
|
|
982 |
ret = iMmSmsExtInterface->CompleteReceiveMessage( smsMsg,
|
|
983 |
iReceiveMessageParamsPtr, iReceiveMessagePduPtr );
|
|
984 |
}
|
|
985 |
|
|
986 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
987 |
EMultimodeSmsReceiveMessage );
|
|
988 |
|
|
989 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage. Deliver SMS to the SMS stack");
|
|
990 |
ReqCompleted( reqHandle, ret );
|
|
991 |
|
|
992 |
// increase the count of expected acknowledgements
|
|
993 |
if(ret == KErrNone)
|
|
994 |
{
|
|
995 |
iExpectAckOrNack++;
|
|
996 |
}
|
|
997 |
}
|
|
998 |
else
|
|
999 |
{
|
|
1000 |
// Routing is activated, but SMS stack hasn't called
|
|
1001 |
// ReceiveMessage. Nack received message internally with cause
|
|
1002 |
// value "protocol error", otherwise SMS server releases
|
|
1003 |
// routings.
|
|
1004 |
if (iClientStorageFull)
|
|
1005 |
{
|
|
1006 |
// SMS stack's memory is full. Nack message with error
|
|
1007 |
// MemoryExceeded
|
|
1008 |
rpError = KErrGsmSMSMemoryCapacityExceeded;
|
|
1009 |
}
|
|
1010 |
else
|
|
1011 |
{
|
|
1012 |
rpError = KErrGsmSMSUnspecifiedProtocolError;
|
|
1013 |
}
|
|
1014 |
}
|
|
1015 |
|
|
1016 |
if ( KErrNone != rpError )
|
|
1017 |
{
|
|
1018 |
CMmDataPackage package;
|
|
1019 |
TSmsMsg* nullSms = NULL;
|
|
1020 |
package.PackData( &nullSms, &rpError );
|
|
1021 |
|
|
1022 |
// ignore if Nacking fails
|
|
1023 |
TRAP_IGNORE(
|
|
1024 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1025 |
EMobileSmsMessagingNackSmsStored, &package );
|
|
1026 |
);
|
|
1027 |
}
|
|
1028 |
}
|
|
1029 |
|
|
1030 |
// end of successful SMS reception
|
|
1031 |
}
|
|
1032 |
// error in SMS reception
|
|
1033 |
else
|
|
1034 |
{
|
|
1035 |
//unpack received data - only one parameter information is needed
|
|
1036 |
aDataPackage->UnPackData( smsInd );
|
|
1037 |
|
|
1038 |
// if SIM SMS Memory is full
|
|
1039 |
if ( ( KErrGsmSMSUnspecifiedProtocolError == aError ) &&
|
|
1040 |
( reqHandle ) )
|
|
1041 |
{
|
|
1042 |
// SMS Memories not full
|
|
1043 |
if ( !iClientStorageFull )
|
|
1044 |
{
|
|
1045 |
CMmDataPackage package;
|
|
1046 |
TSmsMsg* nullSms = NULL;
|
|
1047 |
TInt rpCause( KErrGsmSMSUnspecifiedProtocolError );
|
|
1048 |
package.PackData( &nullSms, &rpCause );
|
|
1049 |
|
|
1050 |
// ignore if Nacking fails
|
|
1051 |
TRAPD( trapError,
|
|
1052 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1053 |
EMobileSmsMessagingNackSmsStored, &package ); );
|
|
1054 |
if ( KErrNone != trapError )
|
|
1055 |
{
|
|
1056 |
ret = trapError;
|
|
1057 |
}
|
|
1058 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage.KErrGsmSMSUnspecifiedProtocolError ");
|
|
1059 |
}
|
|
1060 |
else // SMS Memory is full
|
|
1061 |
{
|
|
1062 |
CMmDataPackage package;
|
|
1063 |
TSmsMsg* nullSms = NULL;
|
|
1064 |
TInt rpCause( KErrGsmSMSMemoryCapacityExceeded );
|
|
1065 |
package.PackData( &nullSms, &rpCause );
|
|
1066 |
|
|
1067 |
// ignore if Nacking fails
|
|
1068 |
TRAPD( trapError,
|
|
1069 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1070 |
EMobileSmsMessagingNackSmsStored, &package ); );
|
|
1071 |
if ( KErrNone != trapError )
|
|
1072 |
{
|
|
1073 |
ret = trapError;
|
|
1074 |
}
|
|
1075 |
}
|
|
1076 |
}
|
|
1077 |
else if ( ( KErrGsmSMSMemoryCapacityExceeded == aError ) &&
|
|
1078 |
( reqHandle ) )
|
|
1079 |
{
|
|
1080 |
CMmDataPackage package;
|
|
1081 |
TSmsMsg* nullSms = NULL;
|
|
1082 |
TInt rpCause( KErrGsmSMSMemoryCapacityExceeded );
|
|
1083 |
package.PackData( &nullSms, &rpCause );
|
|
1084 |
|
|
1085 |
// ignore if Nacking fails
|
|
1086 |
TRAPD( trapError,
|
|
1087 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1088 |
EMobileSmsMessagingNackSmsStored, &package );
|
|
1089 |
);
|
|
1090 |
if ( KErrNone != trapError )
|
|
1091 |
{
|
|
1092 |
ret = trapError;
|
|
1093 |
}
|
|
1094 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage.KErrGsmSMSMemoryCapacityExceeded ");
|
|
1095 |
}
|
|
1096 |
else if ( !reqHandle )
|
|
1097 |
{
|
|
1098 |
// Routing is activated, but SMS stack hasn't called
|
|
1099 |
// ReceiveMessage. Nack received message internally with cause
|
|
1100 |
// value "protocol error", otherwise SMS server releases
|
|
1101 |
// routings
|
|
1102 |
CMmDataPackage package;
|
|
1103 |
TSmsMsg* nullSms = NULL;
|
|
1104 |
TInt rpCause;
|
|
1105 |
if (iClientStorageFull)
|
|
1106 |
{
|
|
1107 |
rpCause = KErrGsmSMSMemoryCapacityExceeded;
|
|
1108 |
}
|
|
1109 |
else
|
|
1110 |
{
|
|
1111 |
rpCause = KErrGsmSMSUnspecifiedProtocolError;
|
|
1112 |
}
|
|
1113 |
package.PackData( &nullSms, &rpCause );
|
|
1114 |
|
|
1115 |
// ignore if Nacking fails
|
|
1116 |
TRAPD( trapError,
|
|
1117 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1118 |
EMobileSmsMessagingNackSmsStored, &package );
|
|
1119 |
);
|
|
1120 |
if ( KErrNone != trapError )
|
|
1121 |
{
|
|
1122 |
ret = trapError;
|
|
1123 |
}
|
|
1124 |
}
|
|
1125 |
else if ( !smsInd )
|
|
1126 |
{
|
|
1127 |
// Error occurred while handling incoming message or acknowledging
|
|
1128 |
// received message
|
|
1129 |
// Request handle exists (already checked above)
|
|
1130 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1131 |
EMultimodeSmsReceiveMessage );
|
|
1132 |
|
|
1133 |
ReqCompleted( reqHandle, aError );
|
|
1134 |
|
|
1135 |
// Incoming message handling failed. If client or TSY doesn't .
|
|
1136 |
// ack incoming message, SMS Server may release all routings.
|
|
1137 |
// Set iSmsServerRoutingActivity to FALSE so client can activate
|
|
1138 |
// routings again.
|
|
1139 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
1140 |
}
|
|
1141 |
|
|
1142 |
if ( KErrNone != ret )
|
|
1143 |
{
|
|
1144 |
// Nack of received message failed. SMS Server releases all
|
|
1145 |
// routings. Set iSmsServerRoutingActivity to FALSE so client
|
|
1146 |
// can activate routings again
|
|
1147 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
1148 |
}
|
|
1149 |
}
|
|
1150 |
}
|
|
1151 |
|
|
1152 |
//----------------------------------------------------------------------------
|
|
1153 |
// CMmSmsTsy::StoreClass2MessageL
|
|
1154 |
// This method stores received Class 2 message in TSY's internal memory
|
|
1155 |
// (other items were commented in a header).
|
|
1156 |
// ---------------------------------------------------------------------------
|
|
1157 |
//
|
|
1158 |
void CMmSmsTsy::StoreClass2MessageL(
|
|
1159 |
TSmsMsg const* aSmsMsg )
|
|
1160 |
{
|
|
1161 |
TSmsMsg* smsMsg = new ( ELeave ) TSmsMsg();
|
|
1162 |
CleanupStack::PushL( smsMsg );
|
|
1163 |
|
|
1164 |
smsMsg->iDeleteAfterClientAck = aSmsMsg->iDeleteAfterClientAck;
|
|
1165 |
smsMsg->iLocation = aSmsMsg->iLocation;
|
|
1166 |
smsMsg->iMessageStatus = aSmsMsg->iMessageStatus;
|
|
1167 |
smsMsg->iMobileScNPI = aSmsMsg->iMobileScNPI;
|
|
1168 |
smsMsg->iMobileScTON = aSmsMsg->iMobileScTON;
|
|
1169 |
smsMsg->iServiceCentre.Copy( aSmsMsg->iServiceCentre );
|
|
1170 |
smsMsg->iSmsMsg.Copy( aSmsMsg->iSmsMsg );
|
|
1171 |
|
|
1172 |
iSmsMsgArray->AppendL( smsMsg );
|
|
1173 |
|
|
1174 |
CleanupStack::Pop( smsMsg );
|
|
1175 |
// note: Lint doesn't understand the use of Pop and 'thinks'
|
|
1176 |
// that there is a memory leak for smsMsg, we disable that warning with
|
|
1177 |
// the following command
|
|
1178 |
// lint -e429
|
|
1179 |
}
|
|
1180 |
|
|
1181 |
//----------------------------------------------------------------------------
|
|
1182 |
// CMmSmsTsy::DeliverClass2ToSmsStack
|
|
1183 |
// This method delivers a received Class 2 messages that are
|
|
1184 |
// stored in TSY's internal memory to the SMS stack
|
|
1185 |
// (other items were commented in a header).
|
|
1186 |
// ---------------------------------------------------------------------------
|
|
1187 |
//
|
|
1188 |
void CMmSmsTsy::DeliverClass2ToSmsStack()
|
|
1189 |
{
|
|
1190 |
// Check if there is Class 2 messages in TSY's internal memory that can be
|
|
1191 |
// now delivered to the SMS stack
|
|
1192 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1193 |
EMultimodeSmsReceiveMessage );
|
|
1194 |
|
|
1195 |
if ( reqHandle && !iClientStorageFull )
|
|
1196 |
{
|
|
1197 |
for ( TInt i = 0; i < iSmsMsgArray->Count(); i++ )
|
|
1198 |
{
|
|
1199 |
if ( EFalse == iSmsMsgArray->At( i )->iDeleteAfterClientAck )
|
|
1200 |
{
|
|
1201 |
TFLOGSTRING2("TSY: CMmSmsTsy::DeliverClass2ToSmsStack. Deliver SMS to the SMS stack. Array count: %d", iSmsMsgArray->Count());
|
|
1202 |
// TSY can now delete the message if SMS stack ack message
|
|
1203 |
// successfully
|
|
1204 |
iSmsMsgArray->At( i )->iDeleteAfterClientAck = ETrue;
|
|
1205 |
|
|
1206 |
TInt ret = iMmSmsExtInterface->CompleteReceiveMessage(
|
|
1207 |
iSmsMsgArray->At( i ), iReceiveMessageParamsPtr,
|
|
1208 |
iReceiveMessagePduPtr );
|
|
1209 |
|
|
1210 |
// ReceiveMessage request completed Reset request handle
|
|
1211 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1212 |
EMultimodeSmsReceiveMessage );
|
|
1213 |
|
|
1214 |
// increase the count of expected acknowledgements
|
|
1215 |
if(ret == KErrNone)
|
|
1216 |
{
|
|
1217 |
iExpectAckOrNack++;
|
|
1218 |
}
|
|
1219 |
|
|
1220 |
ReqCompleted( reqHandle, ret );
|
|
1221 |
break;
|
|
1222 |
}
|
|
1223 |
}
|
|
1224 |
}
|
|
1225 |
}
|
|
1226 |
|
|
1227 |
//----------------------------------------------------------------------------
|
|
1228 |
// CMmSmsTsy::AckSmsStoredL
|
|
1229 |
// Route RP-Ack request to active messagehandler
|
|
1230 |
// (other items were commented in a header).
|
|
1231 |
// ---------------------------------------------------------------------------
|
|
1232 |
//
|
|
1233 |
TInt CMmSmsTsy::AckSmsStoredL(
|
|
1234 |
const TTsyReqHandle aTsyReqHandle,
|
|
1235 |
const TDesC8* aMsgData,
|
|
1236 |
TBool const * aMemoryFull )
|
|
1237 |
{
|
|
1238 |
TFLOGSTRING2("TSY: CMmSmsTsy::AckSmsStored. aMemoryFull: %d",*aMemoryFull);
|
|
1239 |
TTsyReqHandle getAckStoredMessageHandle =
|
|
1240 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsAckStored );
|
|
1241 |
|
|
1242 |
if ( EMultimodeSmsReqHandleUnknown < getAckStoredMessageHandle )
|
|
1243 |
{
|
|
1244 |
// Send request is already ongoing
|
|
1245 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1246 |
}
|
|
1247 |
else
|
|
1248 |
if ( iExpectAckOrNack <= 0 )
|
|
1249 |
{
|
|
1250 |
TFLOGSTRING("TSY: CMmSmsTsy::AckSmsStoredL. -> ReceiveMessage not requested - error returned ");
|
|
1251 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
1252 |
return KErrNone;
|
|
1253 |
}
|
|
1254 |
else
|
|
1255 |
{
|
|
1256 |
iClientStorageFull = *aMemoryFull;
|
|
1257 |
TBool ackMessage( ETrue );
|
|
1258 |
|
|
1259 |
// Check if TSY has stored received Class 2 message to it's internal
|
|
1260 |
// memory. TSY can now delete message from it's internal memory
|
|
1261 |
// because SMS stack received message successfully.
|
|
1262 |
for ( TInt i = 0; i < iSmsMsgArray->Count(); i++ )
|
|
1263 |
{
|
|
1264 |
if ( EFalse != iSmsMsgArray->At( i )->iDeleteAfterClientAck &&
|
|
1265 |
KErrNone == aMsgData->CompareF(
|
|
1266 |
iSmsMsgArray->At( i )->iSmsMsg ) )
|
|
1267 |
{
|
|
1268 |
TFLOGSTRING3("TSY: CMmSmsTsy::AckSmsStored. Delete SMS: %d, Array count: %d",i,iSmsMsgArray->Count());
|
|
1269 |
delete iSmsMsgArray->At( i ); // Delete object from memory
|
|
1270 |
iSmsMsgArray->Delete( i ); // Delete pointer from array
|
|
1271 |
iSmsMsgArray->Compress();
|
|
1272 |
|
|
1273 |
// Class 2 message is already acknowledged to the network
|
|
1274 |
// Complete request here and don't send ack to the .
|
|
1275 |
// network.
|
|
1276 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1277 |
ackMessage = EFalse;
|
|
1278 |
|
|
1279 |
// Check if there is more class 2 messages waiting in TSY's
|
|
1280 |
// internal memory
|
|
1281 |
DeliverClass2ToSmsStack();
|
|
1282 |
break;
|
|
1283 |
}
|
|
1284 |
}
|
|
1285 |
|
|
1286 |
if ( ackMessage )
|
|
1287 |
{
|
|
1288 |
// Pack data
|
|
1289 |
CMmDataPackage package;
|
|
1290 |
TDesC8* msgData = const_cast<TDesC8*>( aMsgData );
|
|
1291 |
package.PackData( &msgData );
|
|
1292 |
|
|
1293 |
TInt ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1294 |
EMobileSmsMessagingAckSmsStored, &package );
|
|
1295 |
|
|
1296 |
if ( KErrNone == ret )
|
|
1297 |
{
|
|
1298 |
iReqHandleType = EMultimodeSmsAckStored;
|
|
1299 |
}
|
|
1300 |
else
|
|
1301 |
{
|
|
1302 |
// Message construction failed or phonet returned error
|
|
1303 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1304 |
|
|
1305 |
// Acknowledging failed. SMS Server will now release routings.
|
|
1306 |
// Complete receive message request with KErrGeneral and
|
|
1307 |
// set routing activity to false. SMS Stack makes new
|
|
1308 |
// ReceiveMessage request.
|
|
1309 |
TBool smsInd( EFalse );
|
|
1310 |
CMmDataPackage data;
|
|
1311 |
TSmsMsg* nullSms = NULL;
|
|
1312 |
data.PackData( &smsInd, &nullSms );
|
|
1313 |
CompleteReceiveMessage( KErrGeneral, &data );
|
|
1314 |
}
|
|
1315 |
}
|
|
1316 |
}
|
|
1317 |
|
|
1318 |
// decrease the count of expeced acknowledgements
|
|
1319 |
iExpectAckOrNack--;
|
|
1320 |
|
|
1321 |
return KErrNone;
|
|
1322 |
}
|
|
1323 |
|
|
1324 |
//----------------------------------------------------------------------------
|
|
1325 |
// CMmSmsTsy::CompleteAckSmsStored
|
|
1326 |
// Complete clients AckSmsStored request
|
|
1327 |
// (other items were commented in a header).
|
|
1328 |
// ---------------------------------------------------------------------------
|
|
1329 |
//
|
|
1330 |
void CMmSmsTsy::CompleteAckSmsStored(
|
|
1331 |
TInt aError )
|
|
1332 |
{
|
|
1333 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1334 |
EMultimodeSmsAckStored );
|
|
1335 |
if ( reqHandle )
|
|
1336 |
{
|
|
1337 |
ReqCompleted( reqHandle, aError );
|
|
1338 |
}
|
|
1339 |
|
|
1340 |
if (aError != KErrNone)
|
|
1341 |
{
|
|
1342 |
// Ack error from LTSY. Need to reject receive messege request, to force the client to repost it.
|
|
1343 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(EMultimodeSmsReceiveMessage);
|
|
1344 |
if( reqHandle != 0 )
|
|
1345 |
{
|
|
1346 |
ReqCompleted(reqHandle, KErrGeneral);
|
|
1347 |
}
|
|
1348 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
1349 |
}
|
|
1350 |
}
|
|
1351 |
|
|
1352 |
//----------------------------------------------------------------------------
|
|
1353 |
// CMmSmsTsy::NackSmsStored
|
|
1354 |
// Route RP-Error request to messagehandler
|
|
1355 |
// (other items were commented in a header).
|
|
1356 |
// ---------------------------------------------------------------------------
|
|
1357 |
//
|
|
1358 |
TInt CMmSmsTsy::NackSmsStoredL(
|
|
1359 |
const TTsyReqHandle aTsyReqHandle,
|
|
1360 |
const TDesC8* aMsgData,
|
|
1361 |
TInt* aRpCause )
|
|
1362 |
{
|
|
1363 |
TFLOGSTRING2("TSY: CMmSmsTsy::NackSmsStored. aRpCause: %d",*aRpCause);
|
|
1364 |
TTsyReqHandle nackHandle =
|
|
1365 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsNackStored );
|
|
1366 |
|
|
1367 |
if ( 0 < nackHandle )
|
|
1368 |
{
|
|
1369 |
// The request is already in processing because of previous request
|
|
1370 |
// Complete request with status value informing the client about
|
|
1371 |
// the situation.
|
|
1372 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1373 |
}
|
|
1374 |
else
|
|
1375 |
if ( iExpectAckOrNack <= 0 )
|
|
1376 |
{
|
|
1377 |
TFLOGSTRING("TSY: CMmSmsTsy::AckSmsStoredL. -> ReceiveMessage not requested - error returned ");
|
|
1378 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
1379 |
return KErrNone;
|
|
1380 |
}
|
|
1381 |
else
|
|
1382 |
{
|
|
1383 |
TBool nackMessage( ETrue );
|
|
1384 |
|
|
1385 |
// Check if TSY has stored received Class 2 message to it's internal
|
|
1386 |
// memory. TSY can now delete message from it's internal memory
|
|
1387 |
// because SMS stack received message successfully
|
|
1388 |
for ( TInt i = 0; i < iSmsMsgArray->Count(); i++ )
|
|
1389 |
{
|
|
1390 |
// Check if message is waiting SMS stack's acknowledging and
|
|
1391 |
// message contents is same as aMsgData.
|
|
1392 |
if ( EFalse != iSmsMsgArray->At( i )->iDeleteAfterClientAck &&
|
|
1393 |
KErrNone == aMsgData->CompareF(
|
|
1394 |
iSmsMsgArray->At( i )->iSmsMsg ) )
|
|
1395 |
{
|
|
1396 |
switch ( *aRpCause )
|
|
1397 |
{
|
|
1398 |
// ETel specific value
|
|
1399 |
case KErrGsmSMSMemoryCapacityExceeded:
|
|
1400 |
// Defect in SMS stack. Stack sets TP cause value to the
|
|
1401 |
// RP cause value TP-FCS 0xD3, RP cause 0x16
|
|
1402 |
// 0xD3:Memory Capacity Exceeded
|
|
1403 |
iClientStorageFull = ETrue;
|
|
1404 |
// without break statement, it will run "iSmsMsgArray->At( i )->iDeleteAfterClientAck = EFalse" in next case block.
|
|
1405 |
case 0xD3:
|
|
1406 |
// Deliver this message to SMS stack when SMS stack
|
|
1407 |
// has enough memory.
|
|
1408 |
iSmsMsgArray->At( i )->iDeleteAfterClientAck = EFalse;
|
|
1409 |
break;
|
|
1410 |
default:
|
|
1411 |
// Delete message because SMS stack couldn't handle it.
|
|
1412 |
// Delete object from memory
|
|
1413 |
delete iSmsMsgArray->At( i );
|
|
1414 |
// Delete pointer from array
|
|
1415 |
iSmsMsgArray->Delete( i );
|
|
1416 |
iSmsMsgArray->Compress();
|
|
1417 |
break;
|
|
1418 |
}
|
|
1419 |
|
|
1420 |
// Class 2 message is already acknowledged to the network by
|
|
1421 |
// adaptation. Complete request here and don't send ack to the
|
|
1422 |
// network.
|
|
1423 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1424 |
nackMessage = EFalse;
|
|
1425 |
break;
|
|
1426 |
}
|
|
1427 |
}
|
|
1428 |
|
|
1429 |
if ( nackMessage )
|
|
1430 |
{
|
|
1431 |
CMmDataPackage package;
|
|
1432 |
// packed parameter: pointer to TDesC8 (TPDU data)
|
|
1433 |
// and TInt (RP cause)
|
|
1434 |
TDesC8* tempMsgDataPtr = const_cast<TDesC8*>( aMsgData );
|
|
1435 |
package.PackData( &tempMsgDataPtr, aRpCause );
|
|
1436 |
|
|
1437 |
TInt ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1438 |
EMobileSmsMessagingNackSmsStored, &package );
|
|
1439 |
|
|
1440 |
if ( KErrNone == ret )
|
|
1441 |
{
|
|
1442 |
iReqHandleType = EMultimodeSmsNackStored;
|
|
1443 |
}
|
|
1444 |
else
|
|
1445 |
{
|
|
1446 |
// Message construction failed or phonet sender returned
|
|
1447 |
// error
|
|
1448 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1449 |
|
|
1450 |
// Acknowledging failed. SMS Server will now release routings.
|
|
1451 |
// Complete receive message request with KErrGeneral and
|
|
1452 |
// set routing activity to false. SMS Stack makes new
|
|
1453 |
// ReceiveMessage request.
|
|
1454 |
TBool smsInd( EFalse );
|
|
1455 |
CMmDataPackage data;
|
|
1456 |
TSmsMsg* nullSms = NULL;
|
|
1457 |
data.PackData( &smsInd, &nullSms );
|
|
1458 |
CompleteReceiveMessage( KErrGeneral, &data );
|
|
1459 |
}
|
|
1460 |
}
|
|
1461 |
}
|
|
1462 |
|
|
1463 |
|
|
1464 |
// decrease the count of expeced acknowledgements
|
|
1465 |
iExpectAckOrNack--;
|
|
1466 |
|
|
1467 |
return KErrNone;
|
|
1468 |
}
|
|
1469 |
|
|
1470 |
//----------------------------------------------------------------------------
|
|
1471 |
// CMmSmsTsy::CompleteNackSmsStored
|
|
1472 |
// Complete clients NackSmsStored request
|
|
1473 |
// (other items were commented in a header).
|
|
1474 |
// ---------------------------------------------------------------------------
|
|
1475 |
//
|
|
1476 |
void CMmSmsTsy::CompleteNackSmsStored(
|
|
1477 |
TInt aError )
|
|
1478 |
{
|
|
1479 |
// reset req handle. Returns the deleted req handle
|
|
1480 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1481 |
EMultimodeSmsNackStored );
|
|
1482 |
if ( reqHandle )
|
|
1483 |
{
|
|
1484 |
ReqCompleted( reqHandle, aError );
|
|
1485 |
}
|
|
1486 |
|
|
1487 |
if (aError != KErrNone)
|
|
1488 |
{
|
|
1489 |
// Nack error from LTSY. Need to reject receive messege request, to force the client to repost it.
|
|
1490 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(EMultimodeSmsReceiveMessage);
|
|
1491 |
if( reqHandle != 0 )
|
|
1492 |
{
|
|
1493 |
ReqCompleted(reqHandle, KErrGeneral);
|
|
1494 |
}
|
|
1495 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
1496 |
}
|
|
1497 |
}
|
|
1498 |
|
|
1499 |
//----------------------------------------------------------------------------
|
|
1500 |
// CMmSmsTsy::ResumeSmsReception
|
|
1501 |
// Notify SMS Server, that client have again free memory for incoming SMSes
|
|
1502 |
// (other items were commented in a header).
|
|
1503 |
// ---------------------------------------------------------------------------
|
|
1504 |
//
|
|
1505 |
TInt CMmSmsTsy::ResumeSmsReceptionL(
|
|
1506 |
const TTsyReqHandle aTsyReqHandle )
|
|
1507 |
{
|
|
1508 |
TFLOGSTRING("TSY: CMmSmsTsy::ResumeSmsReceptionL");
|
|
1509 |
TTsyReqHandle resumeHandle =
|
|
1510 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsResumeReception );
|
|
1511 |
|
|
1512 |
if ( 0 < resumeHandle )
|
|
1513 |
{
|
|
1514 |
// The request is already in processing because of previous request
|
|
1515 |
// Complete request with status value informing the client about
|
|
1516 |
// the situation
|
|
1517 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1518 |
}
|
|
1519 |
else if ( iIsOffline )
|
|
1520 |
{
|
|
1521 |
// CS hardware is in off-line mode. We cannot issue this request
|
|
1522 |
// now, but we will do it as soon as we are on-line again. See
|
|
1523 |
// method SetOffline.
|
|
1524 |
iResumeSmsReceptionPending = ETrue;
|
|
1525 |
|
|
1526 |
// Complete with KErrNone. Client will never notice that the
|
|
1527 |
// request was not yet sent to DOS.
|
|
1528 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1529 |
}
|
|
1530 |
else
|
|
1531 |
{
|
|
1532 |
TInt ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1533 |
EMobileSmsMessagingResumeSmsReception );
|
|
1534 |
|
|
1535 |
if ( KErrNone == ret )
|
|
1536 |
{
|
|
1537 |
iReqHandleType = EMultimodeSmsResumeReception;
|
|
1538 |
}
|
|
1539 |
else
|
|
1540 |
{
|
|
1541 |
// Message construction failed or phonet sender returned error
|
|
1542 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1543 |
}
|
|
1544 |
}
|
|
1545 |
|
|
1546 |
return KErrNone;
|
|
1547 |
}
|
|
1548 |
|
|
1549 |
//----------------------------------------------------------------------------
|
|
1550 |
// CMmSmsTsy::CompleteResumeSmsReception
|
|
1551 |
// This method completes clients ResumeSmsReception request
|
|
1552 |
// (other items were commented in a header).
|
|
1553 |
// ---------------------------------------------------------------------------
|
|
1554 |
//
|
|
1555 |
void CMmSmsTsy::CompleteResumeSmsReception(
|
|
1556 |
TInt aError )
|
|
1557 |
{
|
|
1558 |
if ( KErrNone == aError )
|
|
1559 |
{
|
|
1560 |
iClientStorageFull = EFalse;
|
|
1561 |
}
|
|
1562 |
|
|
1563 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1564 |
EMultimodeSmsResumeReception );
|
|
1565 |
if ( reqHandle )
|
|
1566 |
{
|
|
1567 |
ReqCompleted( reqHandle, aError );
|
|
1568 |
}
|
|
1569 |
|
|
1570 |
// Suspended SMS reception resumed. Check if there is class 2 messages
|
|
1571 |
// waiting in TSY's internal memory.
|
|
1572 |
DeliverClass2ToSmsStack();
|
|
1573 |
}
|
|
1574 |
|
|
1575 |
//----------------------------------------------------------------------------
|
|
1576 |
// CMmSmsTsy::SetOffline
|
|
1577 |
// Sets information about CS hardware mode (off-line/on-line)
|
|
1578 |
// (other items were commented in a header).
|
|
1579 |
// ---------------------------------------------------------------------------
|
|
1580 |
//
|
|
1581 |
void CMmSmsTsy::SetOffline(
|
|
1582 |
TBool aIsOffline )
|
|
1583 |
{
|
|
1584 |
TFLOGSTRING2("TSY: CMmSmsTsy::SetOffline has been called with %d", aIsOffline);
|
|
1585 |
|
|
1586 |
if ( !aIsOffline && iIsOffline )
|
|
1587 |
{
|
|
1588 |
// changing from off-line to on-line
|
|
1589 |
if ( iResumeSmsReceptionPending )
|
|
1590 |
{
|
|
1591 |
// now send the pending ResumeSmsReception
|
|
1592 |
// request to DOS. We are not interested if the
|
|
1593 |
// request has failed, and it has already been completed
|
|
1594 |
// to the client (with KErrNone). See method ResumeSmsReception.
|
|
1595 |
TInt trapError = KErrNone;
|
|
1596 |
TRAP( trapError, iMmPhone->MessageManager()->HandleRequestL(
|
|
1597 |
EMobileSmsMessagingResumeSmsReception );
|
|
1598 |
);
|
|
1599 |
iResumeSmsReceptionPending = EFalse;
|
|
1600 |
}
|
|
1601 |
}
|
|
1602 |
iIsOffline = aIsOffline;
|
|
1603 |
}
|
|
1604 |
|
|
1605 |
//----------------------------------------------------------------------------
|
|
1606 |
// CMmSmsTsy::GetMoSmsBearer
|
|
1607 |
// This method is used to retrieve the current setting for the
|
|
1608 |
// bearer type used for sending SMS messages
|
|
1609 |
// (other items were commented in a header).
|
|
1610 |
// ---------------------------------------------------------------------------
|
|
1611 |
//
|
|
1612 |
TInt CMmSmsTsy::GetMoSmsBearer(
|
|
1613 |
const TTsyReqHandle /*aTsyReqHandle*/,
|
|
1614 |
RMobileSmsMessaging::TMobileSmsBearer* /*aBearer*/ )
|
|
1615 |
{
|
|
1616 |
return KErrNotSupported;
|
|
1617 |
}
|
|
1618 |
|
|
1619 |
//----------------------------------------------------------------------------
|
|
1620 |
// CMmSmsTsy::SetMoSmsBearer
|
|
1621 |
// This method sets the bearer type for sending SMS messages
|
|
1622 |
// (other items were commented in a header).
|
|
1623 |
// ---------------------------------------------------------------------------
|
|
1624 |
//
|
|
1625 |
TInt CMmSmsTsy::SetMoSmsBearer(
|
|
1626 |
const TTsyReqHandle aTsyReqHandle,
|
|
1627 |
RMobileSmsMessaging::TMobileSmsBearer* aBearer )
|
|
1628 |
{
|
|
1629 |
TFLOGSTRING("TSY: CMmSmsTsy::SetMoSmsBearer called");
|
|
1630 |
|
|
1631 |
TTsyReqHandle setMoSmsBearerHandle =
|
|
1632 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSetMoSmsBearer );
|
|
1633 |
|
|
1634 |
if ( 0 < setMoSmsBearerHandle )
|
|
1635 |
{
|
|
1636 |
// The request is already processing because of previous request.
|
|
1637 |
// Complete request with status value informing the client about
|
|
1638 |
// the situation.
|
|
1639 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1640 |
}
|
|
1641 |
else
|
|
1642 |
{
|
|
1643 |
if ( ( *aBearer == RMobileSmsMessaging::ESmsBearerPacketOnly ) ||
|
|
1644 |
( *aBearer == RMobileSmsMessaging::ESmsBearerCircuitOnly ) ||
|
|
1645 |
( *aBearer == RMobileSmsMessaging::ESmsBearerPacketPreferred ) ||
|
|
1646 |
( *aBearer == RMobileSmsMessaging::ESmsBearerCircuitPreferred ) )
|
|
1647 |
{
|
|
1648 |
TInt ret = KErrNone;
|
|
1649 |
|
|
1650 |
CMmDataPackage package;
|
|
1651 |
package.PackData( aBearer );
|
|
1652 |
|
|
1653 |
// Send request to the DOS layer.
|
|
1654 |
TRAP_IGNORE( ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1655 |
EMobileSmsMessagingSetMoSmsBearer, &package ); );
|
|
1656 |
|
|
1657 |
if ( KErrNone == ret )
|
|
1658 |
{
|
|
1659 |
#ifdef REQHANDLE_TIMER
|
|
1660 |
SetTypeOfResponse( EMultimodeSmsSetMoSmsBearer, aTsyReqHandle );
|
|
1661 |
#else
|
|
1662 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
1663 |
EMultimodeSmsSetMoSmsBearer, aTsyReqHandle );
|
|
1664 |
#endif // REQHANDLE_TIMER
|
|
1665 |
}
|
|
1666 |
else
|
|
1667 |
{
|
|
1668 |
// Call to DOS failed
|
|
1669 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1670 |
}
|
|
1671 |
}
|
|
1672 |
else
|
|
1673 |
{
|
|
1674 |
ReqCompleted( aTsyReqHandle, KErrNotSupported );
|
|
1675 |
}
|
|
1676 |
}
|
|
1677 |
return KErrNone;
|
|
1678 |
}
|
|
1679 |
|
|
1680 |
//----------------------------------------------------------------------------
|
|
1681 |
// CMmSmsTsy::CompleteSetMoSmsBearer
|
|
1682 |
// Complete clients SetMoSmsBearer request
|
|
1683 |
// (other items were commented in a header).
|
|
1684 |
// ---------------------------------------------------------------------------
|
|
1685 |
//
|
|
1686 |
void CMmSmsTsy::CompleteSetMoSmsBearer(
|
|
1687 |
TInt aResult )
|
|
1688 |
{
|
|
1689 |
// reset req handle. Returns the deleted req handle
|
|
1690 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1691 |
EMultimodeSmsSetMoSmsBearer );
|
|
1692 |
|
|
1693 |
if ( reqHandle )
|
|
1694 |
{
|
|
1695 |
ReqCompleted( reqHandle, aResult );
|
|
1696 |
}
|
|
1697 |
}
|
|
1698 |
|
|
1699 |
//----------------------------------------------------------------------------
|
|
1700 |
// CMmSmsTsy::SetMoSmsBearerCancel
|
|
1701 |
// This method is used to cancel an outstanding asynchronous
|
|
1702 |
// SetMoSmsBearer request
|
|
1703 |
// (other items were commented in a header).
|
|
1704 |
// ---------------------------------------------------------------------------
|
|
1705 |
//
|
|
1706 |
TInt CMmSmsTsy::SetMoSmsBearerCancel(
|
|
1707 |
const TTsyReqHandle aTsyReqHandle )
|
|
1708 |
{
|
|
1709 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsSetMoSmsBearer );
|
|
1710 |
|
|
1711 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
1712 |
|
|
1713 |
return KErrNone;
|
|
1714 |
}
|
|
1715 |
|
|
1716 |
//----------------------------------------------------------------------------
|
|
1717 |
// CMmSmsTsy::NotifyMoSmsBearerChange
|
|
1718 |
// This method is used to notify the client if there is a
|
|
1719 |
// change to the setting for the bearer type used for sending SMS messages
|
|
1720 |
// (other items were commented in a header).
|
|
1721 |
// ---------------------------------------------------------------------------
|
|
1722 |
//
|
|
1723 |
TInt CMmSmsTsy::NotifyMoSmsBearerChange(
|
|
1724 |
RMobileSmsMessaging::TMobileSmsBearer* /*aBearer*/ )
|
|
1725 |
{
|
|
1726 |
return KErrNotSupported;
|
|
1727 |
}
|
|
1728 |
|
|
1729 |
//----------------------------------------------------------------------------
|
|
1730 |
// CMmSmsTsy::NotifyMoSmsBearerChangeCancel
|
|
1731 |
// This method is used to cancel an outstanding asynchronous
|
|
1732 |
// NotifyMoSmsBearerChange request
|
|
1733 |
// (other items were commented in a header).
|
|
1734 |
// ---------------------------------------------------------------------------
|
|
1735 |
//
|
|
1736 |
TInt CMmSmsTsy::NotifyMoSmsBearerChangeCancel(
|
|
1737 |
const TTsyReqHandle aTsyReqHandle )
|
|
1738 |
{
|
|
1739 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1740 |
EMultimodeSmsNotifyMoSmsBearerChange );
|
|
1741 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
1742 |
iNotifySmsBearerPtr = NULL;
|
|
1743 |
|
|
1744 |
return KErrNone;
|
|
1745 |
}
|
|
1746 |
|
|
1747 |
//----------------------------------------------------------------------------
|
|
1748 |
// CMmSmsTsy::SendMessageL
|
|
1749 |
// Routes send message to network request to message handler
|
|
1750 |
// (other items were commented in a header).
|
|
1751 |
// ---------------------------------------------------------------------------
|
|
1752 |
//
|
|
1753 |
TInt CMmSmsTsy::SendMessageL(
|
|
1754 |
const TTsyReqHandle aTsyReqHandle,
|
|
1755 |
TDes8* aMsgData,
|
|
1756 |
TDes8* aMsgAttributes )
|
|
1757 |
{
|
|
1758 |
TInt ret( KErrNone );
|
|
1759 |
|
|
1760 |
TTsyReqHandle getSendMessageHandle =
|
|
1761 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSendMessage );
|
|
1762 |
TTsyReqHandle getSendSatMessageHandle =
|
|
1763 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSendSatMessage );
|
|
1764 |
|
|
1765 |
TTsyReqHandle getSendMessageNoFdnHandle =
|
|
1766 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSendMessageNoFdnCheck );
|
|
1767 |
if ( ( EMultimodeSmsReqHandleUnknown < getSendMessageHandle )
|
|
1768 |
|| ( EMultimodeSmsReqHandleUnknown < getSendSatMessageHandle )
|
|
1769 |
|| ( EMultimodeSmsReqHandleUnknown < getSendMessageNoFdnHandle ) )
|
|
1770 |
{
|
|
1771 |
// Send request is already ongoing
|
|
1772 |
// (through ETel messaging or through SAT)
|
|
1773 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1774 |
}
|
|
1775 |
else if(sizeof(RMobileSmsMessaging::TMobileSmsReceiveAttributesV1) > aMsgAttributes->Size())
|
|
1776 |
{
|
|
1777 |
ReqCompleted( aTsyReqHandle, KErrArgument );
|
|
1778 |
}
|
|
1779 |
else
|
|
1780 |
{
|
|
1781 |
iSendMessageMsgAttrPckgPtr = aMsgAttributes;
|
|
1782 |
|
|
1783 |
// Create package
|
|
1784 |
CMmDataPackage package;
|
|
1785 |
|
|
1786 |
// typecast for aMsgAttributes
|
|
1787 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* attsPckg =
|
|
1788 |
reinterpret_cast<
|
|
1789 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* >(
|
|
1790 |
aMsgAttributes );
|
|
1791 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1& msgAttr =
|
|
1792 |
( *attsPckg )();
|
|
1793 |
|
|
1794 |
// structure for all sms parameters and data
|
|
1795 |
TSendSmsDataAndAttributes sendData;
|
|
1796 |
|
|
1797 |
sendData.iAttributes = &msgAttr;
|
|
1798 |
sendData.iMsgData = aMsgData;
|
|
1799 |
|
|
1800 |
if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckUsed )
|
|
1801 |
{
|
|
1802 |
//set ipc
|
|
1803 |
sendData.iIpc = EMobileSmsMessagingSendMessageNoFdnCheck;
|
|
1804 |
}
|
|
1805 |
if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckNotUsed )
|
|
1806 |
{
|
|
1807 |
//set ipc
|
|
1808 |
sendData.iIpc = EMobileSmsMessagingSendMessage;
|
|
1809 |
}
|
|
1810 |
|
|
1811 |
// Pack parameters
|
|
1812 |
package.PackData( &sendData );
|
|
1813 |
|
|
1814 |
CSmsSendRequest* smsSendReq = new (ELeave) CSmsSendRequest();
|
|
1815 |
smsSendReq->SetSmsDataAndAttributes( sendData );
|
|
1816 |
|
|
1817 |
// save send request
|
|
1818 |
iSmsSendReq = smsSendReq;
|
|
1819 |
TFLOGSTRING("TSY: CMmSmsTsy::SendMessageL: Send request saved");
|
|
1820 |
|
|
1821 |
// send request to DOS
|
|
1822 |
// packed parameter: TSendSmsDataAndAttributes
|
|
1823 |
if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckUsed )
|
|
1824 |
{
|
|
1825 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1826 |
EMobileSmsMessagingSendMessageNoFdnCheck, &package );
|
|
1827 |
}
|
|
1828 |
if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckNotUsed )
|
|
1829 |
{
|
|
1830 |
ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
1831 |
EMobileSmsMessagingSendMessage, &package );
|
|
1832 |
}
|
|
1833 |
|
|
1834 |
if ( KErrNone == ret )
|
|
1835 |
{
|
|
1836 |
if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckUsed )
|
|
1837 |
{
|
|
1838 |
//set request type
|
|
1839 |
iReqHandleType = EMultimodeSmsSendMessageNoFdnCheck;
|
|
1840 |
}
|
|
1841 |
if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckNotUsed )
|
|
1842 |
{
|
|
1843 |
//set request type
|
|
1844 |
iReqHandleType = EMultimodeSmsSendMessage;
|
|
1845 |
}
|
|
1846 |
smsSendReq->IncreaseSendCounter();
|
|
1847 |
}
|
|
1848 |
else
|
|
1849 |
{
|
|
1850 |
// Phonet returned error
|
|
1851 |
delete smsSendReq; // Delete object
|
|
1852 |
iSmsSendReq = NULL; // Reset pointer
|
|
1853 |
// Message construction failed or phonet sender returned error
|
|
1854 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1855 |
// reset pointer to client memory
|
|
1856 |
iSendMessageMsgAttrPckgPtr = NULL;
|
|
1857 |
|
|
1858 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUnknown;
|
|
1859 |
}
|
|
1860 |
}
|
|
1861 |
|
|
1862 |
return KErrNone;
|
|
1863 |
}
|
|
1864 |
|
|
1865 |
//----------------------------------------------------------------------------
|
|
1866 |
// CMmSmsTsy::IsRPError
|
|
1867 |
// Checks if error code is a relay protocol error
|
|
1868 |
// ---------------------------------------------------------------------------
|
|
1869 |
TBool CMmSmsTsy::IsRPError(TInt aError)
|
|
1870 |
{
|
|
1871 |
TFLOGSTRING2("CMmSmsTsy::IsRPError(): %d", aError);
|
|
1872 |
|
|
1873 |
TBool isRPError = EFalse;
|
|
1874 |
switch (aError)
|
|
1875 |
{
|
|
1876 |
case KErrGsmSMSShortMessageTransferRejected:
|
|
1877 |
{
|
|
1878 |
isRPError = ETrue;
|
|
1879 |
}
|
|
1880 |
break;
|
|
1881 |
case KErrGsmSMSInvalidMandatoryInformation:
|
|
1882 |
{
|
|
1883 |
isRPError = ETrue;
|
|
1884 |
}
|
|
1885 |
break;
|
|
1886 |
case KErrGsmSMSUnidentifiedSubscriber:
|
|
1887 |
{
|
|
1888 |
isRPError = ETrue;
|
|
1889 |
}
|
|
1890 |
break;
|
|
1891 |
case KErrGsmSMSUnknownSubscriber:
|
|
1892 |
{
|
|
1893 |
isRPError = ETrue;
|
|
1894 |
}
|
|
1895 |
break;
|
|
1896 |
case KErrGsmSMSNetworkOutOfOrder:
|
|
1897 |
{
|
|
1898 |
isRPError = ETrue;
|
|
1899 |
}
|
|
1900 |
break;
|
|
1901 |
default:
|
|
1902 |
{
|
|
1903 |
// NOP
|
|
1904 |
}
|
|
1905 |
break;
|
|
1906 |
}
|
|
1907 |
|
|
1908 |
return isRPError;
|
|
1909 |
} // CMmSmsTsy::IsRPError
|
|
1910 |
|
|
1911 |
|
|
1912 |
//----------------------------------------------------------------------------
|
|
1913 |
// CMmSmsTsy::CompleteSendMessage
|
|
1914 |
// Complete SendMessage request
|
|
1915 |
// (other items were commented in a header).
|
|
1916 |
// ---------------------------------------------------------------------------
|
|
1917 |
//
|
|
1918 |
void CMmSmsTsy::CompleteSendMessage(
|
|
1919 |
TInt aError,
|
|
1920 |
CMmDataPackage* aDataPackage )
|
|
1921 |
{
|
|
1922 |
TInt extendedError = CMmCommonStaticUtility::ExtendedErrorCode(aError);
|
|
1923 |
TBool res = IsRPError(extendedError);
|
|
1924 |
if(res)
|
|
1925 |
{
|
|
1926 |
// Delete send message entry from send array
|
|
1927 |
if ( iSmsSendReq )
|
|
1928 |
{
|
|
1929 |
delete iSmsSendReq; // Delete object
|
|
1930 |
iSmsSendReq = NULL; // Reset pointer
|
|
1931 |
}
|
|
1932 |
// reset req handle and complete request
|
|
1933 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1934 |
EMultimodeSmsSendMessage );
|
|
1935 |
ReqCompleted( reqHandle, extendedError );
|
|
1936 |
// reset pointer to client memory
|
|
1937 |
iSendMessageMsgAttrPckgPtr = NULL;
|
|
1938 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUnknown;
|
|
1939 |
}
|
|
1940 |
else if ( ( KErrNone != aError ) && ( KErrTimedOut != aError )
|
|
1941 |
&& ( KErrGsmSMSOperationNotAllowed !=
|
|
1942 |
CMmCommonStaticUtility::ExtendedErrorCode ( aError ) )
|
|
1943 |
// FDB check failed
|
|
1944 |
&& ( KErrGsmSMSUnspecifiedProtocolError !=
|
|
1945 |
CMmCommonStaticUtility::ExtendedErrorCode ( aError ) )
|
|
1946 |
&& ( KErrSatControl !=
|
|
1947 |
CMmCommonStaticUtility::ExtendedErrorCode ( aError ) )
|
|
1948 |
&& ( !( iMmPhone->GetSatMessaging() &&
|
|
1949 |
iMmPhone->GetSatMessaging()->IsMoSmControlBySimActivated() ) )
|
|
1950 |
&& ( NULL != iSmsSendReq ) && ( 2 >=
|
|
1951 |
iSmsSendReq->GetSendCounter() ) )
|
|
1952 |
{
|
|
1953 |
// DOS returned error to send request. Message might be tried to be
|
|
1954 |
// resent (see method ResendSms).
|
|
1955 |
// Timeout mechanism cannot access this part of code, ever.
|
|
1956 |
TFLOGSTRING2("TSY: CMmSmsTsy::CompleteSendMessage. Resend counter: %d", iSmsSendReq->GetSendCounter());
|
|
1957 |
}
|
|
1958 |
else
|
|
1959 |
{
|
|
1960 |
// This is executed
|
|
1961 |
// - if sending was successful
|
|
1962 |
// - if there are no more resending attempts
|
|
1963 |
// - if timer expires (called from the Complete of CMmSmsTsy class)
|
|
1964 |
|
|
1965 |
// Delete send message entry from send array
|
|
1966 |
if ( iSmsSendReq )
|
|
1967 |
{
|
|
1968 |
delete iSmsSendReq; // Delete object
|
|
1969 |
iSmsSendReq = NULL; // Reset pointer
|
|
1970 |
}
|
|
1971 |
|
|
1972 |
// reset req handle and complete request
|
|
1973 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1974 |
EMultimodeSmsSendMessage );
|
|
1975 |
|
|
1976 |
if ( EMultimodeSmsReqHandleUnknown < reqHandle )
|
|
1977 |
{
|
|
1978 |
// get values only if there was no error, and if return pointer to
|
|
1979 |
// client is available
|
|
1980 |
if ( KErrNone == aError && iSendMessageMsgAttrPckgPtr )
|
|
1981 |
{
|
|
1982 |
TInt16 msgRef( 0 );
|
|
1983 |
TBuf8<RMobileSmsMessaging::KGsmTpduSize> smsMsg;
|
|
1984 |
|
|
1985 |
aDataPackage->UnPackData( msgRef, smsMsg );
|
|
1986 |
|
|
1987 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* attsPckg =
|
|
1988 |
reinterpret_cast<
|
|
1989 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* >(
|
|
1990 |
iSendMessageMsgAttrPckgPtr );
|
|
1991 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1& msgAttr =
|
|
1992 |
( *attsPckg )();
|
|
1993 |
|
|
1994 |
msgAttr.iFlags = RMobileSmsMessaging::KMessageReference;
|
|
1995 |
msgAttr.iMsgRef = static_cast< TUint16 >( msgRef );
|
|
1996 |
|
|
1997 |
if ( NULL != smsMsg.Length() )
|
|
1998 |
{
|
|
1999 |
msgAttr.iSubmitReport.Copy(smsMsg);
|
|
2000 |
msgAttr.iFlags |= RMobileSmsMessaging::KGsmSubmitReport;
|
|
2001 |
}
|
|
2002 |
}
|
|
2003 |
|
|
2004 |
ReqCompleted( reqHandle, aError );
|
|
2005 |
// reset pointer to client memory
|
|
2006 |
iSendMessageMsgAttrPckgPtr = NULL;
|
|
2007 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUnknown;
|
|
2008 |
}
|
|
2009 |
}
|
|
2010 |
|
|
2011 |
// Resend unsent message
|
|
2012 |
ResendSms();
|
|
2013 |
}
|
|
2014 |
|
|
2015 |
//----------------------------------------------------------------------------
|
|
2016 |
// CMmSmsTsy::SendSatMessage
|
|
2017 |
// SimAtkTsy can send SMS messages to the network by calling this method
|
|
2018 |
// (other items were commented in a header).
|
|
2019 |
// ---------------------------------------------------------------------------
|
|
2020 |
//
|
|
2021 |
TInt CMmSmsTsy::SendSatMessage(
|
|
2022 |
MStkTsySatService& aStkTsySatService,
|
|
2023 |
TDes8* aSmsTpdu,
|
|
2024 |
TDes16* aScAddress,
|
|
2025 |
RMobilePhone::TMobileTON* aMobileTON,
|
|
2026 |
RMobilePhone::TMobileNPI* aMobileNPI,
|
|
2027 |
TBool aMoreToSend,
|
|
2028 |
TTsyReqHandle aTsyReqHandle )
|
|
2029 |
{
|
|
2030 |
iTsySatMessaging = &aStkTsySatService;
|
|
2031 |
|
|
2032 |
TTsyReqHandle getSendMessageHandle =
|
|
2033 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSendMessage );
|
|
2034 |
TTsyReqHandle getSendSatMessageHandle =
|
|
2035 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSendSatMessage );
|
|
2036 |
|
|
2037 |
if ( ( EMultimodeSmsReqHandleUnknown < getSendMessageHandle )
|
|
2038 |
|| ( EMultimodeSmsReqHandleUnknown < getSendSatMessageHandle ) )
|
|
2039 |
{
|
|
2040 |
// Send request is already ongoing
|
|
2041 |
// (through ETel messaging or through SAT)
|
|
2042 |
iTsySatMessaging->CompleteSendSmsMessage( KErrServerBusy );
|
|
2043 |
}
|
|
2044 |
else
|
|
2045 |
{
|
|
2046 |
|
|
2047 |
TRAPD( leaveCode, DoSendSatMessageL( aSmsTpdu, aScAddress, aMobileTON,
|
|
2048 |
aMobileNPI, aMoreToSend, aTsyReqHandle ); );
|
|
2049 |
|
|
2050 |
if ( KErrNone != leaveCode )
|
|
2051 |
{
|
|
2052 |
// Call to DOS failed
|
|
2053 |
CompleteSendSatMessage( leaveCode );
|
|
2054 |
}
|
|
2055 |
}
|
|
2056 |
|
|
2057 |
return KErrNone;
|
|
2058 |
}
|
|
2059 |
|
|
2060 |
//----------------------------------------------------------------------------
|
|
2061 |
// CMmSmsTsy::DoSendSatMessageL
|
|
2062 |
// SimAtkTsy can send SMS messages to the network by calling this method.
|
|
2063 |
// This method TRAPs failures.
|
|
2064 |
// (other items were commented in a header).
|
|
2065 |
// ---------------------------------------------------------------------------
|
|
2066 |
//
|
|
2067 |
void CMmSmsTsy::DoSendSatMessageL(
|
|
2068 |
TDes8* aSmsTpdu,
|
|
2069 |
TDes16* aScAddress,
|
|
2070 |
RMobilePhone::TMobileTON* aMobileTON,
|
|
2071 |
RMobilePhone::TMobileNPI* aMobileNPI,
|
|
2072 |
TBool aMoreToSend,
|
|
2073 |
TTsyReqHandle aTsyReqHandle )
|
|
2074 |
{
|
|
2075 |
// Leave if SendSatMessageL returns an error
|
|
2076 |
User::LeaveIfError( SendSatMessageL( iMmPhone, aSmsTpdu,
|
|
2077 |
aScAddress, aMobileTON, aMobileNPI, aMoreToSend ) );
|
|
2078 |
|
|
2079 |
#ifdef REQHANDLE_TIMER
|
|
2080 |
SetTypeOfResponse( EMultimodeSmsSendSatMessage, aTsyReqHandle );
|
|
2081 |
#endif // REQHANDLE_TIMER
|
|
2082 |
}
|
|
2083 |
|
|
2084 |
//----------------------------------------------------------------------------
|
|
2085 |
// CMmSmsTsy::CompleteSendSatMessage
|
|
2086 |
// Compelete SendSatMessage request to the MMSAT
|
|
2087 |
// (other items were commented in a header).
|
|
2088 |
// ---------------------------------------------------------------------------
|
|
2089 |
//
|
|
2090 |
void CMmSmsTsy::CompleteSendSatMessage(
|
|
2091 |
TInt aError )
|
|
2092 |
{
|
|
2093 |
TFLOGSTRING2("TSY: CMmSmsTsy::CompleteSendSatMessage. Complete SAT SMS send Error: %d", aError);
|
|
2094 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsSendSatMessage );
|
|
2095 |
|
|
2096 |
if ( iTsySatMessaging )
|
|
2097 |
{
|
|
2098 |
iTsySatMessaging->CompleteSendSmsMessage( aError );
|
|
2099 |
}
|
|
2100 |
|
|
2101 |
#ifdef USING_CTSY_DISPATCHER
|
|
2102 |
|
|
2103 |
//the iTsySatMessaging is now Nulled on the complete
|
|
2104 |
//open issue that if the iTsySatMessaging pointer (to the SIM ATK) is not nulled (i.e. the callback is
|
|
2105 |
//not completed) and the CTSY is destructed after the SIM ATK then the CMmSmsTsy has a invalid pointer which
|
|
2106 |
//is used in the CMmSmsTsy destructor
|
|
2107 |
|
|
2108 |
iTsySatMessaging = NULL;
|
|
2109 |
#endif //USING_CTSY_DISPATCHER
|
|
2110 |
}
|
|
2111 |
|
|
2112 |
//----------------------------------------------------------------------------
|
|
2113 |
// CMmSmsTsy::EnumerateMessageStores
|
|
2114 |
// This methods returns the number of phone-side SMS message
|
|
2115 |
// stores supported by the phone
|
|
2116 |
// (other items were commented in a header).
|
|
2117 |
// ---------------------------------------------------------------------------
|
|
2118 |
//
|
|
2119 |
TInt CMmSmsTsy::EnumerateMessageStores(
|
|
2120 |
const TTsyReqHandle aTsyReqHandle,
|
|
2121 |
TInt* aCount )
|
|
2122 |
{
|
|
2123 |
*aCount = KSmsStoreNumber;
|
|
2124 |
ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2125 |
|
|
2126 |
return KErrNone;
|
|
2127 |
}
|
|
2128 |
|
|
2129 |
//----------------------------------------------------------------------------
|
|
2130 |
// CMmSmsTsy::GetMessageStoreInfo
|
|
2131 |
// This method gets used SMS entries and total number of SMS entries on SIM
|
|
2132 |
// (other items were commented in a header).
|
|
2133 |
// ---------------------------------------------------------------------------
|
|
2134 |
//
|
|
2135 |
TInt CMmSmsTsy::GetMessageStoreInfoL(
|
|
2136 |
const TTsyReqHandle aTsyReqHandle,
|
|
2137 |
TInt const* aIndex,
|
|
2138 |
TDes8* aInfo )
|
|
2139 |
{
|
|
2140 |
TTsyReqHandle getStoreInfoHandle =
|
|
2141 |
iTsyReqHandleStore->GetTsyReqHandle(
|
|
2142 |
EMultimodeSmsGetMessageStoreInfo );
|
|
2143 |
|
|
2144 |
if ( EMultimodeSmsReqHandleUnknown < getStoreInfoHandle )
|
|
2145 |
{
|
|
2146 |
// The request is already in processing because of previous request.
|
|
2147 |
// Complete request with status value informing the client about
|
|
2148 |
// the situation.
|
|
2149 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
2150 |
}
|
|
2151 |
else if ( (*aIndex >= KSmsStoreNumber) || (*aIndex < 0) )
|
|
2152 |
{
|
|
2153 |
// First store number is "0" and SIM is only supported store
|
|
2154 |
ReqCompleted( aTsyReqHandle, KErrArgument );
|
|
2155 |
}
|
|
2156 |
else
|
|
2157 |
{
|
|
2158 |
iGetMessageStoreInfoPtr = aInfo;
|
|
2159 |
// allow for EMobileSmsMessagingGetMessageStoreInfo immediate
|
|
2160 |
// completion
|
|
2161 |
#ifdef REQHANDLE_TIMER
|
|
2162 |
SetTypeOfResponse( EMultimodeSmsGetMessageStoreInfo, aTsyReqHandle );
|
|
2163 |
#else
|
|
2164 |
// Never comes here. See SetTypeOfResponse.
|
|
2165 |
iTsyReqHandleStore->SetTsyReqHandle( EMultimodeSmsGetMessageStoreInfo,
|
|
2166 |
aTsyReqHandle );
|
|
2167 |
#endif // REQHANDLE_TIMER
|
|
2168 |
|
|
2169 |
//Send request to the Domestic OS layer.
|
|
2170 |
TInt ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
2171 |
EMobileSmsMessagingGetMessageStoreInfo );
|
|
2172 |
|
|
2173 |
// DOS layer returned with error without completing request
|
|
2174 |
if ( KErrNone != ret && iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2175 |
EMultimodeSmsGetMessageStoreInfo) )
|
|
2176 |
{
|
|
2177 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2178 |
}
|
|
2179 |
}
|
|
2180 |
|
|
2181 |
return KErrNone;
|
|
2182 |
}
|
|
2183 |
|
|
2184 |
//----------------------------------------------------------------------------
|
|
2185 |
// CMmSmsTsy::GetMessageStoreInfoCancel
|
|
2186 |
// Cancel pending GetMessagestoreInfo request
|
|
2187 |
// (other items were commented in a header).
|
|
2188 |
// ---------------------------------------------------------------------------
|
|
2189 |
//
|
|
2190 |
TInt CMmSmsTsy::GetMessageStoreInfoCancel(
|
|
2191 |
const TTsyReqHandle aTsyReqHandle )
|
|
2192 |
{
|
|
2193 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsGetMessageStoreInfo );
|
|
2194 |
|
|
2195 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2196 |
|
|
2197 |
return KErrNone;
|
|
2198 |
}
|
|
2199 |
|
|
2200 |
//----------------------------------------------------------------------------
|
|
2201 |
// CMmSmsTsy::CompleteGetMessageStoreInfo
|
|
2202 |
// Complete GetMessageStoreInfo request to client
|
|
2203 |
// (other items were commented in a header).
|
|
2204 |
// ---------------------------------------------------------------------------
|
|
2205 |
//
|
|
2206 |
void CMmSmsTsy::CompleteGetMessageStoreInfo(
|
|
2207 |
TInt aError,
|
|
2208 |
CMmDataPackage* aDataPackage )
|
|
2209 |
{
|
|
2210 |
TUint8 totalEntries( 0 );
|
|
2211 |
TInt usedEntries( 0 );
|
|
2212 |
|
|
2213 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2214 |
EMultimodeSmsGetMessageStoreInfo );
|
|
2215 |
|
|
2216 |
if ( reqHandle )
|
|
2217 |
{
|
|
2218 |
// Request was successful
|
|
2219 |
if ( ( KErrNone == aError ) || ( KErrNotFound == aError ) )
|
|
2220 |
{
|
|
2221 |
aDataPackage->UnPackData( totalEntries, usedEntries );
|
|
2222 |
|
|
2223 |
aError = iMmSmsExtInterface->MessageStoreInfo(
|
|
2224 |
iGetMessageStoreInfoPtr, totalEntries, usedEntries );
|
|
2225 |
}
|
|
2226 |
|
|
2227 |
iSmsNumOfLoc = totalEntries;
|
|
2228 |
|
|
2229 |
ReqCompleted( reqHandle, aError );
|
|
2230 |
}
|
|
2231 |
}
|
|
2232 |
|
|
2233 |
//----------------------------------------------------------------------------
|
|
2234 |
// CMmSmsTsy::ReadSmspListPhase1L
|
|
2235 |
// This method starts first phase of SMS Parameter sets
|
|
2236 |
// retrieval On the first phase method store locations
|
|
2237 |
// temporarely to the TSY. On the second phase method copies the
|
|
2238 |
// list to the client
|
|
2239 |
// (other items were commented in a header).
|
|
2240 |
// ---------------------------------------------------------------------------
|
|
2241 |
//
|
|
2242 |
TInt CMmSmsTsy::ReadSmspListPhase1L(
|
|
2243 |
const TTsyReqHandle aTsyReqHandle,
|
|
2244 |
RMobilePhone::TClientId const* aId,
|
|
2245 |
TInt* aBufSize )
|
|
2246 |
{
|
|
2247 |
TFLOGSTRING("TSY: CMmSmsTsy::ReadSmspListPhase1L");
|
|
2248 |
|
|
2249 |
TTsyReqHandle readSmspHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
2250 |
EMultimodeSmsReadSmspListPhase1 );
|
|
2251 |
|
|
2252 |
if ( 0 < readSmspHandle )
|
|
2253 |
{
|
|
2254 |
// The request is already processing because of previous request
|
|
2255 |
// Complete request with status value informing the client about
|
|
2256 |
// the situation.
|
|
2257 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
2258 |
}
|
|
2259 |
else
|
|
2260 |
{
|
|
2261 |
// Lets check how many SMSP sets are there.
|
|
2262 |
TInt ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
2263 |
EMobileSmsMessagingGetSmspListPhase1 );
|
|
2264 |
|
|
2265 |
if ( KErrNone == ret )
|
|
2266 |
{
|
|
2267 |
iReqHandleType = EMultimodeSmsReadSmspListPhase1;
|
|
2268 |
|
|
2269 |
iRetSMSPSize = aBufSize;
|
|
2270 |
|
|
2271 |
// Copy client id (session and subsession handle). it's used for
|
|
2272 |
// matching phase 1 and 2 of a request
|
|
2273 |
|
|
2274 |
if ( iSMSPClientId )
|
|
2275 |
{
|
|
2276 |
delete iSMSPClientId;
|
|
2277 |
iSMSPClientId = NULL;
|
|
2278 |
}
|
|
2279 |
|
|
2280 |
iSMSPClientId = new ( ELeave ) RMobilePhone::TClientId( *aId );
|
|
2281 |
}
|
|
2282 |
else
|
|
2283 |
{
|
|
2284 |
// Call to DOS failed
|
|
2285 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2286 |
}
|
|
2287 |
}
|
|
2288 |
|
|
2289 |
return KErrNone;
|
|
2290 |
}
|
|
2291 |
|
|
2292 |
//----------------------------------------------------------------------------
|
|
2293 |
// CMmSmsTsy::ReadSmspListPhase2
|
|
2294 |
// This method starts second phase of SMS Parameter sets retrieval. It is
|
|
2295 |
// guaranteed that this is only called if phase 1 was completed with KErrNone.
|
|
2296 |
// (other items were commented in a header).
|
|
2297 |
// ---------------------------------------------------------------------------
|
|
2298 |
//
|
|
2299 |
TInt CMmSmsTsy::ReadSmspListPhase2(
|
|
2300 |
TTsyReqHandle aTsyReqHandle,
|
|
2301 |
RMobilePhone::TClientId const* aId,
|
|
2302 |
TDes8* aBuffer )
|
|
2303 |
{
|
|
2304 |
// Check if client id matches between phase 1 and phase 2
|
|
2305 |
if ( ( iSMSPClientId->iSessionHandle == aId->iSessionHandle ) &&
|
|
2306 |
( iSMSPClientId->iSubSessionHandle == aId->iSubSessionHandle ) )
|
|
2307 |
{
|
|
2308 |
// Copy the streamed list to the client
|
|
2309 |
aBuffer->Copy( iSMSPList->Ptr( 0 ) );
|
|
2310 |
|
|
2311 |
iMmPhone->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2312 |
}
|
|
2313 |
else
|
|
2314 |
{
|
|
2315 |
iMmPhone->ReqCompleted( aTsyReqHandle, KErrCorrupt );
|
|
2316 |
}
|
|
2317 |
|
|
2318 |
// Reset the client Id
|
|
2319 |
delete iSMSPClientId;
|
|
2320 |
iSMSPClientId = NULL;
|
|
2321 |
|
|
2322 |
// Reset the streamed list
|
|
2323 |
delete iSMSPList;
|
|
2324 |
iSMSPList = NULL;
|
|
2325 |
|
|
2326 |
return KErrNone;
|
|
2327 |
}
|
|
2328 |
|
|
2329 |
//----------------------------------------------------------------------------
|
|
2330 |
// CMmSmsTsy::ReadAllSmspCancel
|
|
2331 |
// This method cancels read all SMS Parameter sets request.
|
|
2332 |
// This method can be called between phase1 and phase2
|
|
2333 |
// (other items were commented in a header).
|
|
2334 |
// ---------------------------------------------------------------------------
|
|
2335 |
//
|
|
2336 |
TInt CMmSmsTsy::ReadAllSmspCancel(
|
|
2337 |
const TTsyReqHandle aTsyReqHandle )
|
|
2338 |
{
|
|
2339 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsReadSmspListPhase1 );
|
|
2340 |
|
|
2341 |
iRetSMSPSize = NULL;
|
|
2342 |
|
|
2343 |
if ( iSMSPClientId )
|
|
2344 |
{
|
|
2345 |
delete iSMSPClientId;
|
|
2346 |
iSMSPClientId = NULL;
|
|
2347 |
}
|
|
2348 |
|
|
2349 |
if ( iSMSPList )
|
|
2350 |
{
|
|
2351 |
delete iSMSPList;
|
|
2352 |
iSMSPList = NULL;
|
|
2353 |
}
|
|
2354 |
|
|
2355 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2356 |
|
|
2357 |
return KErrNone;
|
|
2358 |
}
|
|
2359 |
|
|
2360 |
//----------------------------------------------------------------------------
|
|
2361 |
// CMmSmsTsy::CreateSmspListL
|
|
2362 |
// This method creates SMSP list from read entries.
|
|
2363 |
// Method reads the list, and stores its content in iSMSPList.
|
|
2364 |
// (other items were commented in a header).
|
|
2365 |
// ---------------------------------------------------------------------------
|
|
2366 |
//
|
|
2367 |
void CMmSmsTsy::CreateSmspListL(
|
|
2368 |
CArrayPtrFlat<TSmsParameters>& aSmspList )
|
|
2369 |
{
|
|
2370 |
CMobilePhoneSmspList* list = CMobilePhoneSmspList::NewL();
|
|
2371 |
CleanupStack::PushL( list );
|
|
2372 |
|
|
2373 |
TUint8 amountOfSets = static_cast< TUint8 >( aSmspList.Count() );
|
|
2374 |
|
|
2375 |
RMobileSmsMessaging::TMobileSmspEntryV1 entry;
|
|
2376 |
|
|
2377 |
// Runs until TSY's internal SMSP storage is empty
|
|
2378 |
while ( 0 != aSmspList.Count() )
|
|
2379 |
{
|
|
2380 |
TSmsParameters* smsParam = aSmspList.At( 0 );
|
|
2381 |
entry.iIndex = ( smsParam->iLocationNumber );
|
|
2382 |
|
|
2383 |
if ( smsParam->iAlphaTagPresent )
|
|
2384 |
{
|
|
2385 |
entry.iText.Copy( smsParam->iAlphaTagData );
|
|
2386 |
}
|
|
2387 |
else
|
|
2388 |
{
|
|
2389 |
entry.iText.SetLength( 0 );
|
|
2390 |
}
|
|
2391 |
|
|
2392 |
entry.iValidParams = ( smsParam->iParameterIndicator );
|
|
2393 |
|
|
2394 |
TInt paramask =
|
|
2395 |
KSmsGsmParametersIndMask & ( smsParam->iParameterIndicator );
|
|
2396 |
|
|
2397 |
if ( paramask & KDestinationAddress )
|
|
2398 |
{
|
|
2399 |
entry.iDestination.iTypeOfNumber = ( smsParam->iMobileDeTON );
|
|
2400 |
entry.iDestination.iNumberPlan = ( smsParam->iMobileDeNPI );
|
|
2401 |
entry.iDestination.iTelNumber = ( smsParam->iDestinationAddress );
|
|
2402 |
}
|
|
2403 |
|
|
2404 |
if ( paramask & KServiceCentreAddress )
|
|
2405 |
{
|
|
2406 |
entry.iServiceCentre.iTypeOfNumber = ( smsParam->iMobileScTON );
|
|
2407 |
entry.iServiceCentre.iNumberPlan = ( smsParam->iMobileScNPI );
|
|
2408 |
entry.iServiceCentre.iTelNumber =
|
|
2409 |
( smsParam->iServiceCenterAddress );
|
|
2410 |
}
|
|
2411 |
|
|
2412 |
if ( paramask & KProtocolID )
|
|
2413 |
{
|
|
2414 |
entry.iProtocolId = ( smsParam->iProtocolId );
|
|
2415 |
}
|
|
2416 |
|
|
2417 |
if ( paramask & KDataCodingScheme )
|
|
2418 |
{
|
|
2419 |
entry.iDcs = ( smsParam->iDataCodingScheme );
|
|
2420 |
}
|
|
2421 |
|
|
2422 |
if ( paramask & KValidityPeriod )
|
|
2423 |
{
|
|
2424 |
entry.iValidityPeriod = ( smsParam->iValidityPeriod );
|
|
2425 |
}
|
|
2426 |
|
|
2427 |
list->AddEntryL( entry );
|
|
2428 |
|
|
2429 |
// Delete handled SMSP set
|
|
2430 |
delete smsParam; // Delete object
|
|
2431 |
aSmspList.Delete( 0 ); // Delete pointer from array
|
|
2432 |
aSmspList.Compress();
|
|
2433 |
}
|
|
2434 |
|
|
2435 |
// Set maximum amount of SMSP sets to the list.
|
|
2436 |
list->SetMaxNumberEntries( amountOfSets );
|
|
2437 |
|
|
2438 |
iSMSPList = list->StoreLC(); // creates new CBufFlat buffer and
|
|
2439 |
// pushes it on cleanup stack
|
|
2440 |
CleanupStack::Pop(); // pop the iSMSPList
|
|
2441 |
|
|
2442 |
CleanupStack::PopAndDestroy(); // pop&destroy CMobilePhoneSmspList* list
|
|
2443 |
}
|
|
2444 |
|
|
2445 |
//----------------------------------------------------------------------------
|
|
2446 |
// CMmSmsTsy::CompleteReadAllSmspPhase1
|
|
2447 |
// Complete first phase of read all SMSP sets request, i.e. returns
|
|
2448 |
// size of iSMSPList buffer to client.
|
|
2449 |
// Parameter aDataPackage contains SMSP list in CArrayPtrFlat<TSmsParameters>.
|
|
2450 |
// (other items were commented in a header).
|
|
2451 |
// ---------------------------------------------------------------------------
|
|
2452 |
//
|
|
2453 |
void CMmSmsTsy::CompleteReadAllSmspPhase1(
|
|
2454 |
TInt aError,
|
|
2455 |
CMmDataPackage* aDataPackage )
|
|
2456 |
{
|
|
2457 |
CArrayPtrFlat<TSmsParameters>* smsParams;
|
|
2458 |
|
|
2459 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2460 |
EMultimodeSmsReadSmspListPhase1 );
|
|
2461 |
|
|
2462 |
TFLOGSTRING2("TSY: CMmSmsTsy::CompleteReadAllSmspPhase1 Complete read first phase error: %d",aError);
|
|
2463 |
if ( KErrNone == aError )
|
|
2464 |
{
|
|
2465 |
aDataPackage->UnPackData( &smsParams );
|
|
2466 |
if ( reqHandle )
|
|
2467 |
{
|
|
2468 |
// Create the Smsp list
|
|
2469 |
TInt trapError;
|
|
2470 |
if( NULL == smsParams)
|
|
2471 |
{
|
|
2472 |
trapError = KErrGeneral;
|
|
2473 |
}
|
|
2474 |
else
|
|
2475 |
{
|
|
2476 |
TRAP( trapError, CreateSmspListL( *smsParams ); );
|
|
2477 |
}
|
|
2478 |
|
|
2479 |
if ( KErrNone == trapError )
|
|
2480 |
{
|
|
2481 |
*iRetSMSPSize = iSMSPList->Size();
|
|
2482 |
TFLOGSTRING("TSY: CMmSmsTsy::CompleteReadAllSmspPhase1: Phase 1 OK.");
|
|
2483 |
// Complete first phase of read all SMSP sets
|
|
2484 |
ReqCompleted( reqHandle, KErrNone );
|
|
2485 |
}
|
|
2486 |
else
|
|
2487 |
{
|
|
2488 |
TFLOGSTRING2("TSY: CMmSmsTsy::CompleteReadAllSmspPhase1: Could not create SMSP list, trapError=%d",trapError);
|
|
2489 |
// Complete with error
|
|
2490 |
ReqCompleted( reqHandle, trapError );
|
|
2491 |
}
|
|
2492 |
}
|
|
2493 |
}
|
|
2494 |
else
|
|
2495 |
{
|
|
2496 |
if ( reqHandle )
|
|
2497 |
{
|
|
2498 |
// Complete first phase of read all SMSP sets.
|
|
2499 |
ReqCompleted( reqHandle, aError );
|
|
2500 |
}
|
|
2501 |
}
|
|
2502 |
iRetSMSPSize = NULL;
|
|
2503 |
}
|
|
2504 |
|
|
2505 |
//----------------------------------------------------------------------------
|
|
2506 |
// CMmSmsTsy::StoreSmspList
|
|
2507 |
// This method start storing of new version of the entire list
|
|
2508 |
// of SMSP entries prosess
|
|
2509 |
// (other items were commented in a header).
|
|
2510 |
// ---------------------------------------------------------------------------
|
|
2511 |
//
|
|
2512 |
TInt CMmSmsTsy::StoreSmspList(
|
|
2513 |
const TTsyReqHandle aTsyReqHandle,
|
|
2514 |
TDes8* aBuffer )
|
|
2515 |
{
|
|
2516 |
TTsyReqHandle storeSmspListHandle =
|
|
2517 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsStoreSmspList );
|
|
2518 |
|
|
2519 |
if ( 0 < storeSmspListHandle )
|
|
2520 |
{
|
|
2521 |
// The request is already processing because of previous request.
|
|
2522 |
// Complete request with status value informing the client about
|
|
2523 |
// the situation.
|
|
2524 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
2525 |
}
|
|
2526 |
else
|
|
2527 |
{
|
|
2528 |
iStoreSmspBufferPtr = aBuffer;
|
|
2529 |
iStoreSmspIndex = 0;
|
|
2530 |
|
|
2531 |
// We must store request handle here and not in ExtFunc-method.
|
|
2532 |
// If SMSP list is empty we must complete store SMSP list request in
|
|
2533 |
// ProcessStoreSmspListL-method and then we need request handle.
|
|
2534 |
#ifdef REQHANDLE_TIMER
|
|
2535 |
SetTypeOfResponse( EMultimodeSmsStoreSmspList, aTsyReqHandle );
|
|
2536 |
#else
|
|
2537 |
iTsyReqHandleStore->SetTsyReqHandle( EMultimodeSmsStoreSmspList,
|
|
2538 |
aTsyReqHandle );
|
|
2539 |
#endif // REQHANDLE_TIMER
|
|
2540 |
CallProcessStoreSmspList();
|
|
2541 |
}
|
|
2542 |
|
|
2543 |
return KErrNone;
|
|
2544 |
}
|
|
2545 |
|
|
2546 |
//----------------------------------------------------------------------------
|
|
2547 |
// CMmSmsTsy::InternalStoreSmspList
|
|
2548 |
// This method check if there was error while updating last SMSP
|
|
2549 |
//set. If there was no error it calls CompleteStoreSmspListL- method
|
|
2550 |
// (other items were commented in a header).
|
|
2551 |
// ---------------------------------------------------------------------------
|
|
2552 |
//
|
|
2553 |
void CMmSmsTsy::InternalStoreSmspList(
|
|
2554 |
TInt aError )
|
|
2555 |
{
|
|
2556 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
2557 |
EMultimodeSmsStoreSmspList );
|
|
2558 |
|
|
2559 |
if ( reqHandle )
|
|
2560 |
{
|
|
2561 |
if ( KErrNone == aError )
|
|
2562 |
{
|
|
2563 |
// Lets continue storing prosess
|
|
2564 |
CallProcessStoreSmspList();
|
|
2565 |
}
|
|
2566 |
else
|
|
2567 |
{
|
|
2568 |
CompleteStoreSmspList( aError );
|
|
2569 |
}
|
|
2570 |
}
|
|
2571 |
}
|
|
2572 |
|
|
2573 |
//----------------------------------------------------------------------------
|
|
2574 |
// CMmSmsTsy::CallProcessStoreSmspList
|
|
2575 |
// This method calls ProcessStoreSmspListL-method
|
|
2576 |
// (other items were commented in a header).
|
|
2577 |
// ---------------------------------------------------------------------------
|
|
2578 |
//
|
|
2579 |
void CMmSmsTsy::CallProcessStoreSmspList()
|
|
2580 |
{
|
|
2581 |
TRAPD ( ret, ProcessStoreSmspListL(); );
|
|
2582 |
if ( ret != KErrNone )
|
|
2583 |
{
|
|
2584 |
CompleteStoreSmspList( ret );
|
|
2585 |
}
|
|
2586 |
}
|
|
2587 |
|
|
2588 |
//----------------------------------------------------------------------------
|
|
2589 |
// CMmSmsTsy::ProcessStoreSmspListL
|
|
2590 |
// This method gets one SMSP sets from clients list and calls
|
|
2591 |
// DOS OR completes client's request
|
|
2592 |
// (other items were commented in a header).
|
|
2593 |
// ---------------------------------------------------------------------------
|
|
2594 |
//
|
|
2595 |
void CMmSmsTsy::ProcessStoreSmspListL()
|
|
2596 |
{
|
|
2597 |
CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
|
|
2598 |
CleanupStack::PushL( smspList );
|
|
2599 |
|
|
2600 |
smspList->RestoreL( *iStoreSmspBufferPtr );
|
|
2601 |
|
|
2602 |
if ( smspList->Enumerate() > iStoreSmspIndex )
|
|
2603 |
{
|
|
2604 |
RMobileSmsMessaging::TMobileSmspEntryV1 smsParam;
|
|
2605 |
CMmDataPackage package;
|
|
2606 |
|
|
2607 |
// Clients SMSP lists first location is 0
|
|
2608 |
smsParam = smspList->GetEntryL( iStoreSmspIndex );
|
|
2609 |
|
|
2610 |
iStoreSmspIndex++;
|
|
2611 |
|
|
2612 |
// Pack parameters
|
|
2613 |
package.PackData( &smsParam );
|
|
2614 |
|
|
2615 |
// Lets make new routing request so new CBMI list can be delivered to
|
|
2616 |
// DOS
|
|
2617 |
TInt ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
2618 |
EMobileSmsMessagingStoreSmspList, &package );
|
|
2619 |
|
|
2620 |
if ( KErrNone != ret )
|
|
2621 |
{
|
|
2622 |
// Message construction failed or phonet sender
|
|
2623 |
// returned error. Complete request in CallProsessStoreSmspList
|
|
2624 |
// method
|
|
2625 |
CompleteStoreSmspList( ret );
|
|
2626 |
}
|
|
2627 |
}
|
|
2628 |
|
|
2629 |
// All SMSP sets have successfully been stored
|
|
2630 |
else
|
|
2631 |
{
|
|
2632 |
// Notify that SMSP set was updated in the store
|
|
2633 |
CompleteNotifySmspListChange();
|
|
2634 |
|
|
2635 |
// Complete store SMSP list request to the client
|
|
2636 |
CompleteStoreSmspList( KErrNone );
|
|
2637 |
}
|
|
2638 |
|
|
2639 |
CleanupStack::PopAndDestroy(); // aSmspList
|
|
2640 |
}
|
|
2641 |
|
|
2642 |
//----------------------------------------------------------------------------
|
|
2643 |
// CMmSmsTsy::CompleteStoreSmspList
|
|
2644 |
// Complete store SMSP list request
|
|
2645 |
// (other items were commented in a header).
|
|
2646 |
// ---------------------------------------------------------------------------
|
|
2647 |
//
|
|
2648 |
void CMmSmsTsy::CompleteStoreSmspList(
|
|
2649 |
TInt aError )
|
|
2650 |
{
|
|
2651 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2652 |
EMultimodeSmsStoreSmspList );
|
|
2653 |
if ( reqHandle )
|
|
2654 |
{
|
|
2655 |
ReqCompleted( reqHandle, aError );
|
|
2656 |
}
|
|
2657 |
}
|
|
2658 |
|
|
2659 |
//----------------------------------------------------------------------------
|
|
2660 |
// CMmSmsTsy::NotifySmspListChange
|
|
2661 |
// This method activates notifying of SMS Parameter store events
|
|
2662 |
// (other items were commented in a header).
|
|
2663 |
// ---------------------------------------------------------------------------
|
|
2664 |
//
|
|
2665 |
TInt CMmSmsTsy::NotifySmspListChange()
|
|
2666 |
{
|
|
2667 |
iReqHandleType = EMultimodeSmsNotifySmspListChange;
|
|
2668 |
|
|
2669 |
return KErrNone;
|
|
2670 |
}
|
|
2671 |
|
|
2672 |
//----------------------------------------------------------------------------
|
|
2673 |
// CMmSmsTsy::NotifySmspListChangeCancel
|
|
2674 |
// This method cancels NotifyStoreEventCancel request
|
|
2675 |
// (other items were commented in a header).
|
|
2676 |
// ---------------------------------------------------------------------------
|
|
2677 |
//
|
|
2678 |
TInt CMmSmsTsy::NotifySmspListChangeCancel(
|
|
2679 |
const TTsyReqHandle aTsyReqHandle )
|
|
2680 |
{
|
|
2681 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2682 |
EMultimodeSmsNotifySmspListChange );
|
|
2683 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2684 |
|
|
2685 |
return KErrNone;
|
|
2686 |
}
|
|
2687 |
|
|
2688 |
//----------------------------------------------------------------------------
|
|
2689 |
// CMmSmsTsy::CompleteNotifySmspListChange
|
|
2690 |
// This method is called when some of SMS parameter store events happen
|
|
2691 |
// (other items were commented in a header).
|
|
2692 |
// ---------------------------------------------------------------------------
|
|
2693 |
//
|
|
2694 |
void CMmSmsTsy::CompleteNotifySmspListChange()
|
|
2695 |
{
|
|
2696 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2697 |
EMultimodeSmsNotifySmspListChange );
|
|
2698 |
if ( reqHandle )
|
|
2699 |
{
|
|
2700 |
ReqCompleted( reqHandle, KErrNone );
|
|
2701 |
}
|
|
2702 |
}
|
|
2703 |
|
|
2704 |
//----------------------------------------------------------------------------
|
|
2705 |
// CMmSmsTsy::GetSmsNumOfLoc
|
|
2706 |
// Get SMS number of Location on SIM card
|
|
2707 |
// (other items were commented in a header).
|
|
2708 |
// ---------------------------------------------------------------------------
|
|
2709 |
//
|
|
2710 |
TInt16 CMmSmsTsy::GetSmsNumOfLoc()
|
|
2711 |
{
|
|
2712 |
return static_cast< TInt16 >( iSmsNumOfLoc );
|
|
2713 |
}
|
|
2714 |
|
|
2715 |
//----------------------------------------------------------------------------
|
|
2716 |
// CMmSmsTsy::SetSmsNumOfLoc
|
|
2717 |
// Set SMS number of Location on SIM card to member variable
|
|
2718 |
// (other items were commented in a header).
|
|
2719 |
// ---------------------------------------------------------------------------
|
|
2720 |
//
|
|
2721 |
void CMmSmsTsy::SetSmsNumOfLoc(
|
|
2722 |
TInt aSmsNumOfLoc )
|
|
2723 |
{
|
|
2724 |
iSmsNumOfLoc = static_cast< TUint8 >( aSmsNumOfLoc );
|
|
2725 |
}
|
|
2726 |
|
|
2727 |
//----------------------------------------------------------------------------
|
|
2728 |
// CMmSmsTsy::GetSmsStorageTsy
|
|
2729 |
// Returns a pointer to the SMS Storage sub-session
|
|
2730 |
// (other items were commented in a header).
|
|
2731 |
// ---------------------------------------------------------------------------
|
|
2732 |
//
|
|
2733 |
CMmSmsStorageTsy* CMmSmsTsy::GetSmsStorageTsy()
|
|
2734 |
{
|
|
2735 |
return iMmSmsStorageTsy;
|
|
2736 |
}
|
|
2737 |
|
|
2738 |
//----------------------------------------------------------------------------
|
|
2739 |
// CMmSmsTsy::SetSmsStorageTsy
|
|
2740 |
// Sets a new pointer to the SMS Storage sub-session
|
|
2741 |
// (other items were commented in a header).
|
|
2742 |
// ---------------------------------------------------------------------------
|
|
2743 |
//
|
|
2744 |
void CMmSmsTsy::SetSmsStorageTsy(
|
|
2745 |
CMmSmsStorageTsy* aNewPointer )
|
|
2746 |
{
|
|
2747 |
iMmSmsStorageTsy = aNewPointer;
|
|
2748 |
}
|
|
2749 |
|
|
2750 |
//----------------------------------------------------------------------------
|
|
2751 |
// CMmSmsTsy::ResetVariables
|
|
2752 |
// Reset used variables
|
|
2753 |
// (other items were commented in a header).
|
|
2754 |
// ---------------------------------------------------------------------------
|
|
2755 |
//
|
|
2756 |
void CMmSmsTsy::ResetVariables()
|
|
2757 |
{
|
|
2758 |
// Resets routing activity variable. If routing is active in DOS
|
|
2759 |
// this parameter is true.
|
|
2760 |
iServerRoutingActivity = ERoutingNotActivated;
|
|
2761 |
|
|
2762 |
// Resets mobile sms receive mode to EReceiveUnstoredClientAck. Mobile
|
|
2763 |
// sms receive mode includes the receive mode type.
|
|
2764 |
iMobileSmsReceiveMode = RMobileSmsMessaging::EReceiveUnstoredClientAck;
|
|
2765 |
|
|
2766 |
// Resets receive mode change notify variables.
|
|
2767 |
iNotifyReceiveModeChangePtr = NULL;
|
|
2768 |
|
|
2769 |
// Resets receive message variables.
|
|
2770 |
iReceiveMessagePduPtr = NULL;
|
|
2771 |
iReceiveMessageParamsPtr = NULL;
|
|
2772 |
|
|
2773 |
// Resets sms bearer notify variables.
|
|
2774 |
iNotifySmsBearerPtr = NULL;
|
|
2775 |
|
|
2776 |
// Resets send message variables.
|
|
2777 |
iSendMessageMsgAttrPckgPtr = NULL;
|
|
2778 |
|
|
2779 |
// Resets get message store variables.
|
|
2780 |
iGetMessageStoreInfoPtr = NULL;
|
|
2781 |
|
|
2782 |
// Resets smsp (sms parameters) variables.
|
|
2783 |
iRetSMSPSize = NULL;
|
|
2784 |
iSMSPClientId = NULL;
|
|
2785 |
iSMSPList = NULL;
|
|
2786 |
|
|
2787 |
// Resets sms storage parameter variables.
|
|
2788 |
iStoreSmspBufferPtr = NULL;
|
|
2789 |
iStoreSmspIndex = NULL;
|
|
2790 |
|
|
2791 |
// Resets sms storage tsy variable.
|
|
2792 |
iMmSmsStorageTsy = NULL;
|
|
2793 |
|
|
2794 |
// Resets SMS stack storage status variables
|
|
2795 |
iClientStorageFull = EFalse;
|
|
2796 |
|
|
2797 |
|
|
2798 |
//Set number of SMS locations on SIM card to 0
|
|
2799 |
iSmsNumOfLoc = 0;
|
|
2800 |
}
|
|
2801 |
|
|
2802 |
#ifdef REQHANDLE_TIMER
|
|
2803 |
//----------------------------------------------------------------------------
|
|
2804 |
// CMmSmsTsy::SetTypeOfResponse
|
|
2805 |
// Sets the type of response for a given Handle. Automatic
|
|
2806 |
// mode includes an automatic response in case of non response
|
|
2807 |
// from the DOS in a specified time
|
|
2808 |
// (other items were commented in a header).
|
|
2809 |
// ---------------------------------------------------------------------------
|
|
2810 |
//
|
|
2811 |
void CMmSmsTsy::SetTypeOfResponse(
|
|
2812 |
const TInt aReqHandleType,
|
|
2813 |
const TTsyReqHandle aTsyReqHandle )
|
|
2814 |
{
|
|
2815 |
TInt timeOut( 0 );
|
|
2816 |
|
|
2817 |
switch ( aReqHandleType )
|
|
2818 |
{
|
|
2819 |
// SMS specific requests
|
|
2820 |
case EMultimodeSmsAckStored:
|
|
2821 |
case EMultimodeSmsNackStored:
|
|
2822 |
timeOut = KMmSmsAckNackMessage;
|
|
2823 |
break;
|
|
2824 |
case EMultimodeSmsSendMessage:
|
|
2825 |
timeOut = KMmSmsSendMessage;
|
|
2826 |
break;
|
|
2827 |
case EMultimodeSmsSendMessageNoFdnCheck:
|
|
2828 |
timeOut = KMmSmsSendMessageNoFdnCheckTimeOut;
|
|
2829 |
break;
|
|
2830 |
case EMultimodeSmsSendSatMessage:
|
|
2831 |
timeOut = KMmSmsSendSatMessage;
|
|
2832 |
break;
|
|
2833 |
case EMultimodeSmsResumeReception:
|
|
2834 |
timeOut = KMmSmsResumeSmsReception;
|
|
2835 |
break;
|
|
2836 |
case EMultimodeSmsGetMessageStoreInfo:
|
|
2837 |
timeOut = KMmSmsGetMessageStoreInfo;
|
|
2838 |
break;
|
|
2839 |
case EMultimodeSmsReadSmspListPhase1:
|
|
2840 |
case EMultimodeSmsStoreSmspList:
|
|
2841 |
timeOut = KMmSmsReadAndStoreSmspList;
|
|
2842 |
break;
|
|
2843 |
// SMS storage specific requests
|
|
2844 |
case EMultimodeSmsGetInfo:
|
|
2845 |
timeOut = KMmSimSmsGetInfo;
|
|
2846 |
break;
|
|
2847 |
case EMultimodeSimStSmsWriteSms:
|
|
2848 |
timeOut = KMmSimSmsWriteSms;
|
|
2849 |
break;
|
|
2850 |
case EMultimodeSimStSmsReadSms:
|
|
2851 |
case EMultimodeSimStSmsEraseSms:
|
|
2852 |
timeOut = KMmSimSmsReadDeleteSms;
|
|
2853 |
break;
|
|
2854 |
case EMultimodeSimStSmsEraseAllSms:
|
|
2855 |
timeOut = KMmSimSmsDeleteAllSms;
|
|
2856 |
break;
|
|
2857 |
case EMultimodeSimStSmsReadAllSms:
|
|
2858 |
timeOut = KMmSimSmsReadAllSms;
|
|
2859 |
break;
|
|
2860 |
// Must not use timer:
|
|
2861 |
// case EMultimodeSmsReceiveMessage:
|
|
2862 |
// case EMultimodeSmsNotifyReceiveModeChange:
|
|
2863 |
// case EMultimodeSmsNotifyMoSmsBearerChange:
|
|
2864 |
// case EMultimodeSmsNotifySmspListChange:
|
|
2865 |
// case EMultimodeSmsMemoryNotifyStoreEvent:
|
|
2866 |
default:
|
|
2867 |
// does not use timer
|
|
2868 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
2869 |
aReqHandleType, aTsyReqHandle );
|
|
2870 |
break;
|
|
2871 |
}
|
|
2872 |
|
|
2873 |
if ( timeOut > 0 )
|
|
2874 |
{
|
|
2875 |
// the timeout parameter is given in seconds.
|
|
2876 |
iTsyReqHandleStore->SetTsyReqHandle( aReqHandleType, aTsyReqHandle,
|
|
2877 |
timeOut );
|
|
2878 |
}
|
|
2879 |
}
|
|
2880 |
|
|
2881 |
//----------------------------------------------------------------------------
|
|
2882 |
// CMmSmsTsy::Complete
|
|
2883 |
// Completes the request due timer expiration
|
|
2884 |
// (other items were commented in a header).
|
|
2885 |
// ---------------------------------------------------------------------------
|
|
2886 |
//
|
|
2887 |
void CMmSmsTsy::Complete(
|
|
2888 |
TInt aReqHandleType,
|
|
2889 |
TInt aError )
|
|
2890 |
{
|
|
2891 |
// All possible TSY req handle types are listed in the
|
|
2892 |
// switch case below.
|
|
2893 |
switch( aReqHandleType )
|
|
2894 |
{
|
|
2895 |
// Cases handled with automatic completion
|
|
2896 |
// SMS specific requests
|
|
2897 |
case EMultimodeSmsAckStored:
|
|
2898 |
CompleteAckSmsStored( aError );
|
|
2899 |
break;
|
|
2900 |
case EMultimodeSmsNackStored:
|
|
2901 |
CompleteNackSmsStored( aError );
|
|
2902 |
break;
|
|
2903 |
case EMultimodeSmsSendMessage:
|
|
2904 |
CompleteSendMessage( KErrTimedOut, NULL );
|
|
2905 |
break;
|
|
2906 |
case EMultimodeSmsSendMessageNoFdnCheck:
|
|
2907 |
CompleteSendMessageNoFdnCheck( KErrTimedOut, NULL );
|
|
2908 |
break;
|
|
2909 |
case EMultimodeSmsSendSatMessage:
|
|
2910 |
CompleteSendSatMessage( KErrTimedOut );
|
|
2911 |
break;
|
|
2912 |
case EMultimodeSmsResumeReception:
|
|
2913 |
CompleteResumeSmsReception( aError );
|
|
2914 |
break;
|
|
2915 |
case EMultimodeSmsGetMessageStoreInfo:
|
|
2916 |
CompleteGetMessageStoreInfo( aError, NULL );
|
|
2917 |
break;
|
|
2918 |
case EMultimodeSmsReadSmspListPhase1:
|
|
2919 |
CompleteReadAllSmspPhase1( aError, NULL );
|
|
2920 |
break;
|
|
2921 |
case EMultimodeSmsStoreSmspList:
|
|
2922 |
CompleteStoreSmspList( aError );
|
|
2923 |
break;
|
|
2924 |
// SMS storage specific requests
|
|
2925 |
case EMultimodeSmsGetInfo:
|
|
2926 |
if ( iMmSmsStorageTsy )
|
|
2927 |
{
|
|
2928 |
iMmSmsStorageTsy->CompleteGetInfo( aError, NULL );
|
|
2929 |
}
|
|
2930 |
break;
|
|
2931 |
case EMultimodeSimStSmsReadSms:
|
|
2932 |
if ( iMmSmsStorageTsy )
|
|
2933 |
{
|
|
2934 |
iMmSmsStorageTsy->CompleteReadSms( aError, NULL );
|
|
2935 |
}
|
|
2936 |
break;
|
|
2937 |
case EMultimodeSimStSmsWriteSms:
|
|
2938 |
if ( iMmSmsStorageTsy )
|
|
2939 |
{
|
|
2940 |
iMmSmsStorageTsy->CompleteWriteSms( aError, NULL );
|
|
2941 |
}
|
|
2942 |
break;
|
|
2943 |
case EMultimodeSimStSmsEraseSms:
|
|
2944 |
if ( iMmSmsStorageTsy )
|
|
2945 |
{
|
|
2946 |
iMmSmsStorageTsy->CompleteDeleteSms( aError );
|
|
2947 |
}
|
|
2948 |
break;
|
|
2949 |
case EMultimodeSimStSmsEraseAllSms:
|
|
2950 |
if ( iMmSmsStorageTsy )
|
|
2951 |
{
|
|
2952 |
iMmSmsStorageTsy->CompleteDeleteAllSms( aError );
|
|
2953 |
}
|
|
2954 |
break;
|
|
2955 |
case EMultimodeSimStSmsReadAllSms:
|
|
2956 |
if ( iMmSmsStorageTsy )
|
|
2957 |
{
|
|
2958 |
iMmSmsStorageTsy->CompleteReadAllSmsPhase1( aError, EFalse );
|
|
2959 |
}
|
|
2960 |
break;
|
|
2961 |
// Can't use timer:
|
|
2962 |
// case EMultimodeSmsReceiveMessage:
|
|
2963 |
// case EMultimodeSmsNotifyReceiveModeChange:
|
|
2964 |
// case EMultimodeSmsNotifyMoSmsBearerChange:
|
|
2965 |
// case EMultimodeSmsNotifySmspListChange:
|
|
2966 |
// case EMultimodeSmsMemoryNotifyStoreEvent:
|
|
2967 |
default:
|
|
2968 |
ReqCompleted( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2969 |
aReqHandleType ), aError );
|
|
2970 |
break;
|
|
2971 |
}
|
|
2972 |
}
|
|
2973 |
|
|
2974 |
#endif // REQHANDLE_TIMER
|
|
2975 |
|
|
2976 |
//----------------------------------------------------------------------------
|
|
2977 |
// CMmSmsTsy::SendSatMessageL
|
|
2978 |
// SimAtkTsy can send SMS messages to the network by calling this method.
|
|
2979 |
// This method can leave.
|
|
2980 |
// (other items were commented in a header).
|
|
2981 |
// ---------------------------------------------------------------------------
|
|
2982 |
//
|
|
2983 |
TInt CMmSmsTsy::SendSatMessageL(
|
|
2984 |
CMmPhoneTsy* aMmPhone,
|
|
2985 |
TDes8* aSmsTpdu,
|
|
2986 |
TDes16* aScAddress,
|
|
2987 |
RMobilePhone::TMobileTON* aMobileTON,
|
|
2988 |
RMobilePhone::TMobileNPI* aMobileNPI,
|
|
2989 |
TBool aMoreToSend )
|
|
2990 |
{
|
|
2991 |
TInt ret( KErrNone );
|
|
2992 |
// Deliver attributes to message handler by using
|
|
2993 |
// TMobileSmsSendAttributesV1 class.
|
|
2994 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1 msgAttrib;
|
|
2995 |
|
|
2996 |
msgAttrib.iFlags = ( RMobileSmsMessaging::KSmsDataFormat |
|
|
2997 |
RMobileSmsMessaging::KGsmServiceCentre |
|
|
2998 |
RMobileSmsMessaging::KMoreToSend );
|
|
2999 |
|
|
3000 |
msgAttrib.iDataFormat = RMobileSmsMessaging::EFormatGsmTpdu;
|
|
3001 |
|
|
3002 |
// if service center address length > 20 digits plus "+" sign
|
|
3003 |
if ( aScAddress->Length() > ( KMaxAmountOfDigits + 1 ) )
|
|
3004 |
{
|
|
3005 |
ret = KErrArgument;
|
|
3006 |
}
|
|
3007 |
else
|
|
3008 |
{
|
|
3009 |
msgAttrib.iGsmServiceCentre.iTelNumber.Copy( *aScAddress );
|
|
3010 |
msgAttrib.iGsmServiceCentre.iTypeOfNumber = *aMobileTON;
|
|
3011 |
msgAttrib.iGsmServiceCentre.iNumberPlan = *aMobileNPI;
|
|
3012 |
|
|
3013 |
msgAttrib.iMore = aMoreToSend;
|
|
3014 |
|
|
3015 |
// create package
|
|
3016 |
CMmDataPackage package;
|
|
3017 |
|
|
3018 |
// structure for all sms parameters and data
|
|
3019 |
TSendSmsDataAndAttributes sendData;
|
|
3020 |
|
|
3021 |
sendData.iAttributes = &msgAttrib;
|
|
3022 |
sendData.iMsgData = aSmsTpdu;
|
|
3023 |
sendData.iIpc = EMmTsySmsSendSatMessage;
|
|
3024 |
|
|
3025 |
// Pack parameters
|
|
3026 |
package.PackData( &sendData );
|
|
3027 |
|
|
3028 |
// send request to DOS
|
|
3029 |
ret = aMmPhone->MessageManager()->HandleRequestL(
|
|
3030 |
EMmTsySmsSendSatMessage, &package );
|
|
3031 |
|
|
3032 |
if ( KErrNone == ret )
|
|
3033 |
{
|
|
3034 |
iReqHandleType = EMultimodeSmsSendSatMessage;
|
|
3035 |
}
|
|
3036 |
}
|
|
3037 |
|
|
3038 |
return ret;
|
|
3039 |
}
|
|
3040 |
|
|
3041 |
//----------------------------------------------------------------------------
|
|
3042 |
// CMmSmsTsy::ResendSms
|
|
3043 |
// Resends unsent message which is stored in iSmsSendReq
|
|
3044 |
// (other items were commented in a header).
|
|
3045 |
// ---------------------------------------------------------------------------
|
|
3046 |
//
|
|
3047 |
void CMmSmsTsy::ResendSms()
|
|
3048 |
{
|
|
3049 |
if ( NULL != iSmsSendReq )
|
|
3050 |
{
|
|
3051 |
// Create package
|
|
3052 |
CMmDataPackage package;
|
|
3053 |
|
|
3054 |
// structure for all sms parameters and data
|
|
3055 |
TSendSmsDataAndAttributes sendData =
|
|
3056 |
iSmsSendReq->GetSmsDataAndAttributes();
|
|
3057 |
|
|
3058 |
// Pack parameters
|
|
3059 |
package.PackData( &sendData );
|
|
3060 |
|
|
3061 |
// send request to DOS
|
|
3062 |
TInt ret = KErrNone;
|
|
3063 |
TRAPD( trapError, ret = iMmPhone->MessageManager()->HandleRequestL(
|
|
3064 |
sendData.iIpc, &package ); );
|
|
3065 |
|
|
3066 |
if ( ( KErrNone != ret ) || ( KErrNone != trapError ) )
|
|
3067 |
{
|
|
3068 |
delete iSmsSendReq; // Delete object
|
|
3069 |
iSmsSendReq = NULL; // Reset pointer
|
|
3070 |
|
|
3071 |
// Response for send SMS request
|
|
3072 |
if ( EMobileSmsMessagingSendMessage == sendData.iIpc )
|
|
3073 |
{
|
|
3074 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckNotUsed;
|
|
3075 |
CompleteSendMessage( KErrGeneral, NULL );
|
|
3076 |
}
|
|
3077 |
// Response for send SAT SMS request
|
|
3078 |
else if ( EMmTsySmsSendSatMessage == sendData.iIpc )
|
|
3079 |
{
|
|
3080 |
CompleteSendSatMessage( KErrGeneral );
|
|
3081 |
}
|
|
3082 |
// Response for send SMS NoFdnCheck request
|
|
3083 |
else if ( EMobileSmsMessagingSendMessageNoFdnCheck ==
|
|
3084 |
sendData.iIpc )
|
|
3085 |
{
|
|
3086 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUsed;
|
|
3087 |
TFLOGSTRING2("TSY: CMmSmsTsy::ResendSms. EMobileSmsMessagingSendMessageNoFdnCheck: %d", sendData.iIpc);
|
|
3088 |
CompleteSendMessageNoFdnCheck( KErrGeneral, NULL );
|
|
3089 |
}
|
|
3090 |
}
|
|
3091 |
else
|
|
3092 |
{
|
|
3093 |
iSmsSendReq->IncreaseSendCounter();
|
|
3094 |
}
|
|
3095 |
}
|
|
3096 |
}
|
|
3097 |
|
|
3098 |
// ---------------------------------------------------------------------------
|
|
3099 |
// CMmSmsTsy::IsRequestPossibleInOffLine
|
|
3100 |
// Checks wether a ETel request can be performed or not while offline mode is
|
|
3101 |
// enabled
|
|
3102 |
// (other items were commented in a header).
|
|
3103 |
// ---------------------------------------------------------------------------
|
|
3104 |
//
|
|
3105 |
TBool CMmSmsTsy::IsRequestPossibleInOffline( TInt aIpc ) const
|
|
3106 |
{
|
|
3107 |
TBool isRequestPossible ( ETrue );
|
|
3108 |
switch ( aIpc )
|
|
3109 |
{
|
|
3110 |
case EMobileSmsMessagingSendMessage: //NO
|
|
3111 |
case EMobileSmsMessagingSendMessageNoFdnCheck: //NO
|
|
3112 |
isRequestPossible = EFalse;
|
|
3113 |
break;
|
|
3114 |
// case EMobileSmsMessagingSetReceiveMode:
|
|
3115 |
// case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
3116 |
// case EMobileSmsMessagingReceiveMessage:
|
|
3117 |
// case EMobileSmsMessagingAckSmsStored:
|
|
3118 |
// case EMobileSmsMessagingNackSmsStored:
|
|
3119 |
// case EMobileSmsMessagingResumeSmsReception: //request is possible
|
|
3120 |
//(will be delayed
|
|
3121 |
// and sent later, see
|
|
3122 |
// ResumeSmsReception)
|
|
3123 |
// case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
3124 |
// case EMobileSmsMessagingGetMessageStoreInfo:
|
|
3125 |
// case EMobileSmsMessagingGetSmspListPhase1:
|
|
3126 |
// case EMobileSmsMessagingNotifySmspListChange:
|
|
3127 |
// case EMobileSmsMessagingStoreSmspList:
|
|
3128 |
default:
|
|
3129 |
break;
|
|
3130 |
}
|
|
3131 |
|
|
3132 |
return isRequestPossible;
|
|
3133 |
}
|
|
3134 |
|
|
3135 |
// ---------------------------------------------------------------------------
|
|
3136 |
// CMmSmsTsy::SendMessageNoFdnCheckCancel
|
|
3137 |
// Cancels SendMessageNoFdnCheck request.
|
|
3138 |
// (other items were commented in a header).
|
|
3139 |
// ---------------------------------------------------------------------------
|
|
3140 |
//
|
|
3141 |
TInt CMmSmsTsy::SendMessageNoFdnCheckCancel(
|
|
3142 |
const TTsyReqHandle aTsyReqHandle )
|
|
3143 |
{
|
|
3144 |
TFLOGSTRING("TSY: CMmSmsTsy::SendMessageNoFdnCheckCancel" );
|
|
3145 |
// Reset req handle. Returns the deleted req handle
|
|
3146 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
3147 |
EMultimodeSmsSendMessageNoFdnCheck );
|
|
3148 |
|
|
3149 |
if ( EMultimodeSmsReqHandleUnknown < reqHandle )
|
|
3150 |
{
|
|
3151 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
3152 |
|
|
3153 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUnknown;
|
|
3154 |
}
|
|
3155 |
|
|
3156 |
return KErrNone;
|
|
3157 |
}
|
|
3158 |
|
|
3159 |
//----------------------------------------------------------------------------
|
|
3160 |
// CMmSmsTsy::CompleteSendMessageNoFdnCheck
|
|
3161 |
// Complete SendMessage request
|
|
3162 |
// (other items were commented in a header).
|
|
3163 |
// ---------------------------------------------------------------------------
|
|
3164 |
//
|
|
3165 |
void CMmSmsTsy::CompleteSendMessageNoFdnCheck(
|
|
3166 |
TInt aError,
|
|
3167 |
CMmDataPackage* aDataPackage )
|
|
3168 |
{
|
|
3169 |
if ( ( KErrNone != aError ) && ( KErrTimedOut != aError )
|
|
3170 |
&& ( KErrGsmSMSOperationNotAllowed !=
|
|
3171 |
CMmCommonStaticUtility::ExtendedErrorCode ( aError ) )
|
|
3172 |
// FDB check failed
|
|
3173 |
&& ( KErrGsmSMSUnspecifiedProtocolError !=
|
|
3174 |
CMmCommonStaticUtility::ExtendedErrorCode ( aError ) )
|
|
3175 |
&& ( KErrSatControl !=
|
|
3176 |
CMmCommonStaticUtility::ExtendedErrorCode ( aError ) )
|
|
3177 |
&& ( !( iMmPhone->GetSatMessaging() &&
|
|
3178 |
iMmPhone->GetSatMessaging()->IsMoSmControlBySimActivated() ) )
|
|
3179 |
&& ( NULL != iSmsSendReq ) && ( 2 >=
|
|
3180 |
iSmsSendReq->GetSendCounter() ) )
|
|
3181 |
{
|
|
3182 |
// DOS returned error to send request. Message might be tried to be
|
|
3183 |
// resent (see method ResendSms).
|
|
3184 |
// Timeout mechanism cannot access this part of code, ever.
|
|
3185 |
TFLOGSTRING2("TSY: CMmSmsTsy::CompleteSendMessageNoFdnCheck. Resend counter: %d", iSmsSendReq->GetSendCounter());
|
|
3186 |
}
|
|
3187 |
else
|
|
3188 |
{
|
|
3189 |
// This is executed
|
|
3190 |
// - if sending was successful
|
|
3191 |
// - if there are no more resending attempts
|
|
3192 |
// - if timer expires (called from the Complete of CMmSmsTsy class)
|
|
3193 |
|
|
3194 |
// Delete send message entry from send array
|
|
3195 |
if ( iSmsSendReq )
|
|
3196 |
{
|
|
3197 |
delete iSmsSendReq; // Delete object
|
|
3198 |
iSmsSendReq = NULL; // Reset pointer
|
|
3199 |
}
|
|
3200 |
|
|
3201 |
// reset req handle and complete request
|
|
3202 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
3203 |
ResetTsyReqHandle( EMultimodeSmsSendMessageNoFdnCheck );
|
|
3204 |
|
|
3205 |
if ( EMultimodeSmsReqHandleUnknown < reqHandle )
|
|
3206 |
{
|
|
3207 |
// get values only if there was no error, and if return pointer to
|
|
3208 |
// client is available
|
|
3209 |
if ( KErrNone == aError && iSendMessageMsgAttrPckgPtr )
|
|
3210 |
{
|
|
3211 |
TInt16 msgRef( 0 );
|
|
3212 |
TBuf8<RMobileSmsMessaging::KGsmTpduSize> smsMsg;
|
|
3213 |
|
|
3214 |
aDataPackage->UnPackData( msgRef, smsMsg );
|
|
3215 |
|
|
3216 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* attsPckg =
|
|
3217 |
reinterpret_cast<
|
|
3218 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* >(
|
|
3219 |
iSendMessageMsgAttrPckgPtr );
|
|
3220 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1& msgAttr =
|
|
3221 |
( *attsPckg )();
|
|
3222 |
|
|
3223 |
msgAttr.iFlags = RMobileSmsMessaging::KMessageReference;
|
|
3224 |
msgAttr.iMsgRef = static_cast< TUint16 >( msgRef );
|
|
3225 |
|
|
3226 |
if ( NULL != smsMsg.Length() )
|
|
3227 |
{
|
|
3228 |
msgAttr.iSubmitReport.Copy(smsMsg);
|
|
3229 |
msgAttr.iFlags |= RMobileSmsMessaging::KGsmSubmitReport;
|
|
3230 |
}
|
|
3231 |
}
|
|
3232 |
|
|
3233 |
ReqCompleted( reqHandle, aError );
|
|
3234 |
// reset pointer to client memory
|
|
3235 |
iSendMessageMsgAttrPckgPtr = NULL;
|
|
3236 |
|
|
3237 |
iSmsNoFdnCheckFlag = ESmsNoFdnCheckUnknown;
|
|
3238 |
}
|
|
3239 |
}
|
|
3240 |
|
|
3241 |
// Resend unsent message
|
|
3242 |
ResendSms();
|
|
3243 |
}
|
|
3244 |
|
|
3245 |
|
|
3246 |
// End of File
|