1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 // |
14 // |
15 |
15 |
16 |
16 |
17 |
17 |
18 // INCLUDE FILES |
18 // INCLUDE FILES |
|
19 |
|
20 #include "OstTraceDefinitions.h" |
|
21 #ifdef OST_TRACE_COMPILER_IN_USE |
|
22 #include "cmmsmstsyTraces.h" |
|
23 #endif |
|
24 |
19 #include "cmmsmstsy.h" |
25 #include "cmmsmstsy.h" |
20 #include "cmmphonetsy.h" |
26 #include "cmmphonetsy.h" |
21 #include "cmmsmsstoragetsy.h" |
27 #include "cmmsmsstoragetsy.h" |
22 #include "cmmsmsgsmext.h" |
28 #include "cmmsmsgsmext.h" |
23 #include "cmmtsyreqhandlestore.h" |
29 #include "cmmtsyreqhandlestore.h" |
35 // ======== MEMBER FUNCTIONS ======== |
41 // ======== MEMBER FUNCTIONS ======== |
36 |
42 |
37 CMmSmsTsy::CMmSmsTsy(): |
43 CMmSmsTsy::CMmSmsTsy(): |
38 iReqHandleType(EMultimodeSmsReqHandleUnknown) |
44 iReqHandleType(EMultimodeSmsReqHandleUnknown) |
39 { |
45 { |
40 TFLOGSTRING("TSY: CMmSmsTsy::CMmSmsTsy: constructor"); |
46 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_CTOR_1, "TSY: CMmSmsTsy::CMmSmsTsy: constructor"); |
41 } |
47 } |
42 |
48 |
43 void CMmSmsTsy::ConstructL() |
49 void CMmSmsTsy::ConstructL() |
44 { |
50 { |
45 TFLOGSTRING("TSY: CMmSmsTsy::ConstructL"); |
51 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_CONSTRUCTL_1, "TSY: CMmSmsTsy::ConstructL"); |
46 #ifdef REQHANDLE_TIMER |
52 #ifdef REQHANDLE_TIMER |
47 //create req handle store |
53 //create req handle store |
48 iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone, |
54 iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone, |
49 EMultimodeSmsMaxNumOfRequests, iSmsReqHandles ); |
55 EMultimodeSmsMaxNumOfRequests, iSmsReqHandles ); |
50 #else |
56 #else |
80 } |
86 } |
81 else |
87 else |
82 { |
88 { |
83 iIsOffline = EFalse; |
89 iIsOffline = EFalse; |
84 } |
90 } |
85 TFLOGSTRING2("TSY: CMmSmsTsy::ConstructL: iIsOffline has been initialised to %d", iIsOffline); |
91 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_CONSTRUCTL_2, "TSY: CMmSmsTsy::ConstructL: iIsOffline has been initialised to %d", iIsOffline); |
86 |
92 |
87 // there's no pending ResumeSmsReception request at startup |
93 // there's no pending ResumeSmsReception request at startup |
88 iResumeSmsReceptionPending = EFalse; |
94 iResumeSmsReceptionPending = EFalse; |
89 |
95 |
90 // Initialization for sms NoFdnCheck |
96 // Initialization for sms NoFdnCheck |
106 return aMmSmsTsy; |
112 return aMmSmsTsy; |
107 } |
113 } |
108 |
114 |
109 CMmSmsTsy::~CMmSmsTsy() |
115 CMmSmsTsy::~CMmSmsTsy() |
110 { |
116 { |
111 TFLOGSTRING("TSY: CMmSmsTsy::~CMmSmsTsy"); |
117 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_DTOR_1, "TSY: CMmSmsTsy::~CMmSmsTsy"); |
112 if ( iMmPhone ) |
118 if ( iMmPhone ) |
113 { |
119 { |
114 // deregister tsy object from message manager |
120 // deregister tsy object from message manager |
115 iMmPhone->MessageManager()->DeregisterTsyObject(this); |
121 iMmPhone->MessageManager()->DeregisterTsyObject(this); |
116 |
122 |
247 // before processing further the request, check if offline mode status |
253 // before processing further the request, check if offline mode status |
248 // is enabled and if the given request can be perfomed in that case. |
254 // is enabled and if the given request can be perfomed in that case. |
249 if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() && |
255 if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() && |
250 !IsRequestPossibleInOffline( aIpc ) ) |
256 !IsRequestPossibleInOffline( aIpc ) ) |
251 { |
257 { |
252 TFLOGSTRING2 ("TSY: Offline mode ON, request is not allowed: %d", aIpc ); |
258 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_EXTFUNC_1, "TSY: Offline mode ON, request is not allowed: %d", aIpc ); |
253 TInt error = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral, |
259 TInt error = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral, |
254 KErrGsmOfflineOpNotAllowed ); |
260 KErrGsmOfflineOpNotAllowed ); |
255 |
261 |
256 // Complete the request with appropiate error |
262 // Complete the request with appropiate error |
257 ReqCompleted ( aTsyReqHandle, error ); |
263 ReqCompleted ( aTsyReqHandle, error ); |
298 TRAP( leaveCode, ret = DoExtFuncL( aTsyReqHandle, aIpc, |
304 TRAP( leaveCode, ret = DoExtFuncL( aTsyReqHandle, aIpc, |
299 aPackage ); ); |
305 aPackage ); ); |
300 |
306 |
301 if ( KErrNone != leaveCode ) |
307 if ( KErrNone != leaveCode ) |
302 { |
308 { |
303 TFLOGSTRING3("CMmSmsTsy: Leave trapped!, IPC=%d, error value:%d", aIpc, leaveCode ); |
309 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_EXTFUNC_2, "CMmSmsTsy: Leave trapped!, IPC=%d, error value:%d", aIpc, leaveCode ); |
304 ReqCompleted( aTsyReqHandle, leaveCode ); |
310 ReqCompleted( aTsyReqHandle, leaveCode ); |
305 } |
311 } |
306 |
312 |
307 //save request handle |
313 //save request handle |
308 if ( EMultimodeSmsReqHandleUnknown != iReqHandleType ) |
314 if ( EMultimodeSmsReqHandleUnknown != iReqHandleType ) |
766 TInt CMmSmsTsy::ReceiveMessageL( |
772 TInt CMmSmsTsy::ReceiveMessageL( |
767 const TTsyReqHandle aTsyReqHandle, |
773 const TTsyReqHandle aTsyReqHandle, |
768 TDes8* aMsgData, |
774 TDes8* aMsgData, |
769 TDes8* aMsgAttributes ) |
775 TDes8* aMsgAttributes ) |
770 { |
776 { |
771 TFLOGSTRING("TSY: CMmSmsTsy::ReceiveMessageL\n"); |
777 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_RECEIVEMESSAGEL_1, "TSY: CMmSmsTsy::ReceiveMessageL\n"); |
772 |
778 |
773 if(sizeof(RMobileSmsMessaging::TMobileSmsReceiveAttributesV1) > aMsgAttributes->Size()) |
779 if(sizeof(RMobileSmsMessaging::TMobileSmsReceiveAttributesV1) > aMsgAttributes->Size()) |
774 { |
780 { |
775 return KErrArgument; |
781 return KErrArgument; |
776 } |
782 } |
851 aDataPackage->UnPackData( aSmsRoutingStatus ) ; |
857 aDataPackage->UnPackData( aSmsRoutingStatus ) ; |
852 |
858 |
853 if ( ( KErrNone == aError ) && |
859 if ( ( KErrNone == aError ) && |
854 ( KSmsRoutingActivated == aSmsRoutingStatus ) ) |
860 ( KSmsRoutingActivated == aSmsRoutingStatus ) ) |
855 { |
861 { |
856 TFLOGSTRING("TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing activated"); |
862 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETEACTIVATESMSROUTING_1, "TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing activated"); |
857 iServerRoutingActivity = ERoutingActivated; |
863 iServerRoutingActivity = ERoutingActivated; |
858 } |
864 } |
859 else if ( ( KErrNone == aError ) && |
865 else if ( ( KErrNone == aError ) && |
860 ( KSmsRoutingDeactivated == aSmsRoutingStatus ) ) |
866 ( KSmsRoutingDeactivated == aSmsRoutingStatus ) ) |
861 { |
867 { |
862 TFLOGSTRING("TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing not activated"); |
868 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETEACTIVATESMSROUTING_2, "TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing not activated"); |
863 iServerRoutingActivity = ERoutingNotActivated; |
869 iServerRoutingActivity = ERoutingNotActivated; |
864 } |
870 } |
865 else |
871 else |
866 { |
872 { |
867 TFLOGSTRING("TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing activation failed"); |
873 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETEACTIVATESMSROUTING_3, "TSY: CMmSmsTsy::CompleteActivateSmsRouting SMS routing activation failed"); |
868 iServerRoutingActivity = ERoutingNotActivated; |
874 iServerRoutingActivity = ERoutingNotActivated; |
869 |
875 |
870 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
876 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
871 EMultimodeSmsReceiveMessage ); |
877 EMultimodeSmsReceiveMessage ); |
872 |
878 |
892 TSmsMsg* smsMsg; |
898 TSmsMsg* smsMsg; |
893 |
899 |
894 TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( |
900 TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( |
895 EMultimodeSmsReceiveMessage ); |
901 EMultimodeSmsReceiveMessage ); |
896 |
902 |
897 TFLOGSTRING2("TSY: CMmSmsTsy::CompleteReceiveMessage. iClientStorageFull: %d", iClientStorageFull ); |
903 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETERECEIVEMESSAGE_1, "TSY: CMmSmsTsy::CompleteReceiveMessage. iClientStorageFull: %d", iClientStorageFull ); |
898 |
904 |
899 // SMS successfully received |
905 // SMS successfully received |
900 if ( KErrNone == aError ) |
906 if ( KErrNone == aError ) |
901 { |
907 { |
902 //unpack received data |
908 //unpack received data |
907 |
913 |
908 // if store is not full, receive new class2 message and get |
914 // if store is not full, receive new class2 message and get |
909 // notification |
915 // notification |
910 if ( smsClass2 && ( 0 != smsMsg->iLocation ) && iMmSmsStorageTsy ) |
916 if ( smsClass2 && ( 0 != smsMsg->iLocation ) && iMmSmsStorageTsy ) |
911 { |
917 { |
912 TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage. CompleteNotifyStoreEvent happens"); |
918 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETERECEIVEMESSAGE_2, "TSY: CMmSmsTsy::CompleteReceiveMessage. CompleteNotifyStoreEvent happens"); |
913 iMmSmsStorageTsy->CMmSmsStorageTsy::CompleteNotifyStoreEvent( |
919 iMmSmsStorageTsy->CMmSmsStorageTsy::CompleteNotifyStoreEvent( |
914 smsMsg->iLocation, RMobilePhoneStore::KStoreEntryAdded ); |
920 smsMsg->iLocation, RMobilePhoneStore::KStoreEntryAdded ); |
915 } |
921 } |
916 |
922 |
917 // if SMS is a Class2 and SMS Memories are full and SIM SMS Memory |
923 // if SMS is a Class2 and SMS Memories are full and SIM SMS Memory |
984 } |
990 } |
985 |
991 |
986 iTsyReqHandleStore->ResetTsyReqHandle( |
992 iTsyReqHandleStore->ResetTsyReqHandle( |
987 EMultimodeSmsReceiveMessage ); |
993 EMultimodeSmsReceiveMessage ); |
988 |
994 |
989 TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage. Deliver SMS to the SMS stack"); |
995 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETERECEIVEMESSAGE_3, "TSY: CMmSmsTsy::CompleteReceiveMessage. Deliver SMS to the SMS stack"); |
990 ReqCompleted( reqHandle, ret ); |
996 ReqCompleted( reqHandle, ret ); |
991 |
997 |
992 // increase the count of expected acknowledgements |
998 // increase the count of expected acknowledgements |
993 if(ret == KErrNone) |
999 if(ret == KErrNone) |
994 { |
1000 { |
1053 EMobileSmsMessagingNackSmsStored, &package ); ); |
1059 EMobileSmsMessagingNackSmsStored, &package ); ); |
1054 if ( KErrNone != trapError ) |
1060 if ( KErrNone != trapError ) |
1055 { |
1061 { |
1056 ret = trapError; |
1062 ret = trapError; |
1057 } |
1063 } |
1058 TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage.KErrGsmSMSUnspecifiedProtocolError "); |
1064 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETERECEIVEMESSAGE_4, "TSY: CMmSmsTsy::CompleteReceiveMessage.KErrGsmSMSUnspecifiedProtocolError "); |
1059 } |
1065 } |
1060 else // SMS Memory is full |
1066 else // SMS Memory is full |
1061 { |
1067 { |
1062 CMmDataPackage package; |
1068 CMmDataPackage package; |
1063 TSmsMsg* nullSms = NULL; |
1069 TSmsMsg* nullSms = NULL; |
1089 ); |
1095 ); |
1090 if ( KErrNone != trapError ) |
1096 if ( KErrNone != trapError ) |
1091 { |
1097 { |
1092 ret = trapError; |
1098 ret = trapError; |
1093 } |
1099 } |
1094 TFLOGSTRING("TSY: CMmSmsTsy::CompleteReceiveMessage.KErrGsmSMSMemoryCapacityExceeded "); |
1100 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETERECEIVEMESSAGE_5, "TSY: CMmSmsTsy::CompleteReceiveMessage.KErrGsmSMSMemoryCapacityExceeded "); |
1095 } |
1101 } |
1096 else if ( !reqHandle ) |
1102 else if ( !reqHandle ) |
1097 { |
1103 { |
1098 // Routing is activated, but SMS stack hasn't called |
1104 // Routing is activated, but SMS stack hasn't called |
1099 // ReceiveMessage. Nack received message internally with cause |
1105 // ReceiveMessage. Nack received message internally with cause |
1196 { |
1202 { |
1197 for ( TInt i = 0; i < iSmsMsgArray->Count(); i++ ) |
1203 for ( TInt i = 0; i < iSmsMsgArray->Count(); i++ ) |
1198 { |
1204 { |
1199 if ( EFalse == iSmsMsgArray->At( i )->iDeleteAfterClientAck ) |
1205 if ( EFalse == iSmsMsgArray->At( i )->iDeleteAfterClientAck ) |
1200 { |
1206 { |
1201 TFLOGSTRING2("TSY: CMmSmsTsy::DeliverClass2ToSmsStack. Deliver SMS to the SMS stack. Array count: %d", iSmsMsgArray->Count()); |
1207 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_DELIVERCLASS2TOSMSSTACK_1, "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 |
1208 // TSY can now delete the message if SMS stack ack message |
1203 // successfully |
1209 // successfully |
1204 iSmsMsgArray->At( i )->iDeleteAfterClientAck = ETrue; |
1210 iSmsMsgArray->At( i )->iDeleteAfterClientAck = ETrue; |
1205 |
1211 |
1206 TInt ret = iMmSmsExtInterface->CompleteReceiveMessage( |
1212 TInt ret = iMmSmsExtInterface->CompleteReceiveMessage( |
1233 TInt CMmSmsTsy::AckSmsStoredL( |
1239 TInt CMmSmsTsy::AckSmsStoredL( |
1234 const TTsyReqHandle aTsyReqHandle, |
1240 const TTsyReqHandle aTsyReqHandle, |
1235 const TDesC8* aMsgData, |
1241 const TDesC8* aMsgData, |
1236 TBool const * aMemoryFull ) |
1242 TBool const * aMemoryFull ) |
1237 { |
1243 { |
1238 TFLOGSTRING2("TSY: CMmSmsTsy::AckSmsStored. aMemoryFull: %d",*aMemoryFull); |
1244 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_ACKSMSSTOREDL_1, "TSY: CMmSmsTsy::AckSmsStored. aMemoryFull: %d",*aMemoryFull); |
1239 TTsyReqHandle getAckStoredMessageHandle = |
1245 TTsyReqHandle getAckStoredMessageHandle = |
1240 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsAckStored ); |
1246 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsAckStored ); |
1241 |
1247 |
1242 if ( EMultimodeSmsReqHandleUnknown < getAckStoredMessageHandle ) |
1248 if ( EMultimodeSmsReqHandleUnknown < getAckStoredMessageHandle ) |
1243 { |
1249 { |
1245 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
1251 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
1246 } |
1252 } |
1247 else |
1253 else |
1248 if ( iExpectAckOrNack <= 0 ) |
1254 if ( iExpectAckOrNack <= 0 ) |
1249 { |
1255 { |
1250 TFLOGSTRING("TSY: CMmSmsTsy::AckSmsStoredL. -> ReceiveMessage not requested - error returned "); |
1256 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_ACKSMSSTOREDL_2, "TSY: CMmSmsTsy::AckSmsStoredL. -> ReceiveMessage not requested - error returned "); |
1251 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1257 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1252 return KErrNone; |
1258 return KErrNone; |
1253 } |
1259 } |
1254 else |
1260 else |
1255 { |
1261 { |
1263 { |
1269 { |
1264 if ( EFalse != iSmsMsgArray->At( i )->iDeleteAfterClientAck && |
1270 if ( EFalse != iSmsMsgArray->At( i )->iDeleteAfterClientAck && |
1265 KErrNone == aMsgData->CompareF( |
1271 KErrNone == aMsgData->CompareF( |
1266 iSmsMsgArray->At( i )->iSmsMsg ) ) |
1272 iSmsMsgArray->At( i )->iSmsMsg ) ) |
1267 { |
1273 { |
1268 TFLOGSTRING3("TSY: CMmSmsTsy::AckSmsStored. Delete SMS: %d, Array count: %d",i,iSmsMsgArray->Count()); |
1274 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_ACKSMSSTOREDL_3, "TSY: CMmSmsTsy::AckSmsStored. Delete SMS: %d, Array count: %d",i,iSmsMsgArray->Count()); |
1269 delete iSmsMsgArray->At( i ); // Delete object from memory |
1275 delete iSmsMsgArray->At( i ); // Delete object from memory |
1270 iSmsMsgArray->Delete( i ); // Delete pointer from array |
1276 iSmsMsgArray->Delete( i ); // Delete pointer from array |
1271 iSmsMsgArray->Compress(); |
1277 iSmsMsgArray->Compress(); |
1272 |
1278 |
1273 // Class 2 message is already acknowledged to the network |
1279 // Class 2 message is already acknowledged to the network |
1358 TInt CMmSmsTsy::NackSmsStoredL( |
1364 TInt CMmSmsTsy::NackSmsStoredL( |
1359 const TTsyReqHandle aTsyReqHandle, |
1365 const TTsyReqHandle aTsyReqHandle, |
1360 const TDesC8* aMsgData, |
1366 const TDesC8* aMsgData, |
1361 TInt* aRpCause ) |
1367 TInt* aRpCause ) |
1362 { |
1368 { |
1363 TFLOGSTRING2("TSY: CMmSmsTsy::NackSmsStored. aRpCause: %d",*aRpCause); |
1369 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_NACKSMSSTOREDL_1, "TSY: CMmSmsTsy::NackSmsStored. aRpCause: %d",*aRpCause); |
1364 TTsyReqHandle nackHandle = |
1370 TTsyReqHandle nackHandle = |
1365 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsNackStored ); |
1371 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsNackStored ); |
1366 |
1372 |
1367 if ( 0 < nackHandle ) |
1373 if ( 0 < nackHandle ) |
1368 { |
1374 { |
1372 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
1378 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
1373 } |
1379 } |
1374 else |
1380 else |
1375 if ( iExpectAckOrNack <= 0 ) |
1381 if ( iExpectAckOrNack <= 0 ) |
1376 { |
1382 { |
1377 TFLOGSTRING("TSY: CMmSmsTsy::AckSmsStoredL. -> ReceiveMessage not requested - error returned "); |
1383 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_NACKSMSSTOREDL_2, "TSY: CMmSmsTsy::AckSmsStoredL. -> ReceiveMessage not requested - error returned "); |
1378 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1384 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1379 return KErrNone; |
1385 return KErrNone; |
1380 } |
1386 } |
1381 else |
1387 else |
1382 { |
1388 { |
1503 // --------------------------------------------------------------------------- |
1509 // --------------------------------------------------------------------------- |
1504 // |
1510 // |
1505 TInt CMmSmsTsy::ResumeSmsReceptionL( |
1511 TInt CMmSmsTsy::ResumeSmsReceptionL( |
1506 const TTsyReqHandle aTsyReqHandle ) |
1512 const TTsyReqHandle aTsyReqHandle ) |
1507 { |
1513 { |
1508 TFLOGSTRING("TSY: CMmSmsTsy::ResumeSmsReceptionL"); |
1514 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_RESUMESMSRECEPTIONL_1, "TSY: CMmSmsTsy::ResumeSmsReceptionL"); |
1509 TTsyReqHandle resumeHandle = |
1515 TTsyReqHandle resumeHandle = |
1510 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsResumeReception ); |
1516 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsResumeReception ); |
1511 |
1517 |
1512 if ( 0 < resumeHandle ) |
1518 if ( 0 < resumeHandle ) |
1513 { |
1519 { |
1579 // --------------------------------------------------------------------------- |
1585 // --------------------------------------------------------------------------- |
1580 // |
1586 // |
1581 void CMmSmsTsy::SetOffline( |
1587 void CMmSmsTsy::SetOffline( |
1582 TBool aIsOffline ) |
1588 TBool aIsOffline ) |
1583 { |
1589 { |
1584 TFLOGSTRING2("TSY: CMmSmsTsy::SetOffline has been called with %d", aIsOffline); |
1590 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_SETOFFLINE_1, "TSY: CMmSmsTsy::SetOffline has been called with %d", aIsOffline); |
1585 |
1591 |
1586 if ( !aIsOffline && iIsOffline ) |
1592 if ( !aIsOffline && iIsOffline ) |
1587 { |
1593 { |
1588 // changing from off-line to on-line |
1594 // changing from off-line to on-line |
1589 if ( iResumeSmsReceptionPending ) |
1595 if ( iResumeSmsReceptionPending ) |
1624 // |
1630 // |
1625 TInt CMmSmsTsy::SetMoSmsBearer( |
1631 TInt CMmSmsTsy::SetMoSmsBearer( |
1626 const TTsyReqHandle aTsyReqHandle, |
1632 const TTsyReqHandle aTsyReqHandle, |
1627 RMobileSmsMessaging::TMobileSmsBearer* aBearer ) |
1633 RMobileSmsMessaging::TMobileSmsBearer* aBearer ) |
1628 { |
1634 { |
1629 TFLOGSTRING("TSY: CMmSmsTsy::SetMoSmsBearer called"); |
1635 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_SETMOSMSBEARER_1, "TSY: CMmSmsTsy::SetMoSmsBearer called"); |
1630 |
1636 |
1631 TTsyReqHandle setMoSmsBearerHandle = |
1637 TTsyReqHandle setMoSmsBearerHandle = |
1632 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSetMoSmsBearer ); |
1638 iTsyReqHandleStore->GetTsyReqHandle( EMultimodeSmsSetMoSmsBearer ); |
1633 |
1639 |
1634 if ( 0 < setMoSmsBearerHandle ) |
1640 if ( 0 < setMoSmsBearerHandle ) |
1814 CSmsSendRequest* smsSendReq = new (ELeave) CSmsSendRequest(); |
1820 CSmsSendRequest* smsSendReq = new (ELeave) CSmsSendRequest(); |
1815 smsSendReq->SetSmsDataAndAttributes( sendData ); |
1821 smsSendReq->SetSmsDataAndAttributes( sendData ); |
1816 |
1822 |
1817 // save send request |
1823 // save send request |
1818 iSmsSendReq = smsSendReq; |
1824 iSmsSendReq = smsSendReq; |
1819 TFLOGSTRING("TSY: CMmSmsTsy::SendMessageL: Send request saved"); |
1825 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_SENDMESSAGEL_1, "TSY: CMmSmsTsy::SendMessageL: Send request saved"); |
1820 |
1826 |
1821 // send request to DOS |
1827 // send request to DOS |
1822 // packed parameter: TSendSmsDataAndAttributes |
1828 // packed parameter: TSendSmsDataAndAttributes |
1823 if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckUsed ) |
1829 if ( iSmsNoFdnCheckFlag == ESmsNoFdnCheckUsed ) |
1824 { |
1830 { |
1866 // CMmSmsTsy::IsRPError |
1872 // CMmSmsTsy::IsRPError |
1867 // Checks if error code is a relay protocol error |
1873 // Checks if error code is a relay protocol error |
1868 // --------------------------------------------------------------------------- |
1874 // --------------------------------------------------------------------------- |
1869 TBool CMmSmsTsy::IsRPError(TInt aError) |
1875 TBool CMmSmsTsy::IsRPError(TInt aError) |
1870 { |
1876 { |
1871 TFLOGSTRING2("CMmSmsTsy::IsRPError(): %d", aError); |
1877 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_ISRPERROR_1, "CMmSmsTsy::IsRPError(): %d", aError); |
1872 |
1878 |
1873 TBool isRPError = EFalse; |
1879 TBool isRPError = EFalse; |
1874 switch (aError) |
1880 switch (aError) |
1875 { |
1881 { |
1876 case KErrGsmSMSShortMessageTransferRejected: |
1882 case KErrGsmSMSShortMessageTransferRejected: |
1951 iSmsSendReq->GetSendCounter() ) ) |
1957 iSmsSendReq->GetSendCounter() ) ) |
1952 { |
1958 { |
1953 // DOS returned error to send request. Message might be tried to be |
1959 // DOS returned error to send request. Message might be tried to be |
1954 // resent (see method ResendSms). |
1960 // resent (see method ResendSms). |
1955 // Timeout mechanism cannot access this part of code, ever. |
1961 // Timeout mechanism cannot access this part of code, ever. |
1956 TFLOGSTRING2("TSY: CMmSmsTsy::CompleteSendMessage. Resend counter: %d", iSmsSendReq->GetSendCounter()); |
1962 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETESENDMESSAGE_1, "TSY: CMmSmsTsy::CompleteSendMessage. Resend counter: %d", iSmsSendReq->GetSendCounter()); |
1957 } |
1963 } |
1958 else |
1964 else |
1959 { |
1965 { |
1960 // This is executed |
1966 // This is executed |
1961 // - if sending was successful |
1967 // - if sending was successful |
2088 // --------------------------------------------------------------------------- |
2094 // --------------------------------------------------------------------------- |
2089 // |
2095 // |
2090 void CMmSmsTsy::CompleteSendSatMessage( |
2096 void CMmSmsTsy::CompleteSendSatMessage( |
2091 TInt aError ) |
2097 TInt aError ) |
2092 { |
2098 { |
2093 TFLOGSTRING2("TSY: CMmSmsTsy::CompleteSendSatMessage. Complete SAT SMS send Error: %d", aError); |
2099 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETESENDSATMESSAGE_1, "TSY: CMmSmsTsy::CompleteSendSatMessage. Complete SAT SMS send Error: %d", aError); |
2094 iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsSendSatMessage ); |
2100 iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeSmsSendSatMessage ); |
2095 |
2101 |
2096 if ( iTsySatMessaging ) |
2102 if ( iTsySatMessaging ) |
2097 { |
2103 { |
2098 iTsySatMessaging->CompleteSendSmsMessage( aError ); |
2104 iTsySatMessaging->CompleteSendSmsMessage( aError ); |
2242 TInt CMmSmsTsy::ReadSmspListPhase1L( |
2248 TInt CMmSmsTsy::ReadSmspListPhase1L( |
2243 const TTsyReqHandle aTsyReqHandle, |
2249 const TTsyReqHandle aTsyReqHandle, |
2244 RMobilePhone::TClientId const* aId, |
2250 RMobilePhone::TClientId const* aId, |
2245 TInt* aBufSize ) |
2251 TInt* aBufSize ) |
2246 { |
2252 { |
2247 TFLOGSTRING("TSY: CMmSmsTsy::ReadSmspListPhase1L"); |
2253 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_READSMSPLISTPHASE1L_1, "TSY: CMmSmsTsy::ReadSmspListPhase1L"); |
2248 |
2254 |
2249 TTsyReqHandle readSmspHandle = iTsyReqHandleStore->GetTsyReqHandle( |
2255 TTsyReqHandle readSmspHandle = iTsyReqHandleStore->GetTsyReqHandle( |
2250 EMultimodeSmsReadSmspListPhase1 ); |
2256 EMultimodeSmsReadSmspListPhase1 ); |
2251 |
2257 |
2252 if ( 0 < readSmspHandle ) |
2258 if ( 0 < readSmspHandle ) |
2457 CArrayPtrFlat<TSmsParameters>* smsParams; |
2463 CArrayPtrFlat<TSmsParameters>* smsParams; |
2458 |
2464 |
2459 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
2465 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
2460 EMultimodeSmsReadSmspListPhase1 ); |
2466 EMultimodeSmsReadSmspListPhase1 ); |
2461 |
2467 |
2462 TFLOGSTRING2("TSY: CMmSmsTsy::CompleteReadAllSmspPhase1 Complete read first phase error: %d",aError); |
2468 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETEREADALLSMSPPHASE1_1, "TSY: CMmSmsTsy::CompleteReadAllSmspPhase1 Complete read first phase error: %d",aError); |
2463 if ( KErrNone == aError ) |
2469 if ( KErrNone == aError ) |
2464 { |
2470 { |
2465 aDataPackage->UnPackData( &smsParams ); |
2471 aDataPackage->UnPackData( &smsParams ); |
2466 if ( reqHandle ) |
2472 if ( reqHandle ) |
2467 { |
2473 { |
2477 } |
2483 } |
2478 |
2484 |
2479 if ( KErrNone == trapError ) |
2485 if ( KErrNone == trapError ) |
2480 { |
2486 { |
2481 *iRetSMSPSize = iSMSPList->Size(); |
2487 *iRetSMSPSize = iSMSPList->Size(); |
2482 TFLOGSTRING("TSY: CMmSmsTsy::CompleteReadAllSmspPhase1: Phase 1 OK."); |
2488 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETEREADALLSMSPPHASE1_2, "TSY: CMmSmsTsy::CompleteReadAllSmspPhase1: Phase 1 OK."); |
2483 // Complete first phase of read all SMSP sets |
2489 // Complete first phase of read all SMSP sets |
2484 ReqCompleted( reqHandle, KErrNone ); |
2490 ReqCompleted( reqHandle, KErrNone ); |
2485 } |
2491 } |
2486 else |
2492 else |
2487 { |
2493 { |
2488 TFLOGSTRING2("TSY: CMmSmsTsy::CompleteReadAllSmspPhase1: Could not create SMSP list, trapError=%d",trapError); |
2494 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETEREADALLSMSPPHASE1_3, "TSY: CMmSmsTsy::CompleteReadAllSmspPhase1: Could not create SMSP list, trapError=%d",trapError); |
2489 // Complete with error |
2495 // Complete with error |
2490 ReqCompleted( reqHandle, trapError ); |
2496 ReqCompleted( reqHandle, trapError ); |
2491 } |
2497 } |
2492 } |
2498 } |
2493 } |
2499 } |
3082 // Response for send SMS NoFdnCheck request |
3088 // Response for send SMS NoFdnCheck request |
3083 else if ( EMobileSmsMessagingSendMessageNoFdnCheck == |
3089 else if ( EMobileSmsMessagingSendMessageNoFdnCheck == |
3084 sendData.iIpc ) |
3090 sendData.iIpc ) |
3085 { |
3091 { |
3086 iSmsNoFdnCheckFlag = ESmsNoFdnCheckUsed; |
3092 iSmsNoFdnCheckFlag = ESmsNoFdnCheckUsed; |
3087 TFLOGSTRING2("TSY: CMmSmsTsy::ResendSms. EMobileSmsMessagingSendMessageNoFdnCheck: %d", sendData.iIpc); |
3093 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_RESENDSMS_1, "TSY: CMmSmsTsy::ResendSms. EMobileSmsMessagingSendMessageNoFdnCheck: %d", sendData.iIpc); |
3088 CompleteSendMessageNoFdnCheck( KErrGeneral, NULL ); |
3094 CompleteSendMessageNoFdnCheck( KErrGeneral, NULL ); |
3089 } |
3095 } |
3090 } |
3096 } |
3091 else |
3097 else |
3092 { |
3098 { |
3139 // --------------------------------------------------------------------------- |
3145 // --------------------------------------------------------------------------- |
3140 // |
3146 // |
3141 TInt CMmSmsTsy::SendMessageNoFdnCheckCancel( |
3147 TInt CMmSmsTsy::SendMessageNoFdnCheckCancel( |
3142 const TTsyReqHandle aTsyReqHandle ) |
3148 const TTsyReqHandle aTsyReqHandle ) |
3143 { |
3149 { |
3144 TFLOGSTRING("TSY: CMmSmsTsy::SendMessageNoFdnCheckCancel" ); |
3150 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_SENDMESSAGENOFDNCHECKCANCEL_1, "TSY: CMmSmsTsy::SendMessageNoFdnCheckCancel" ); |
3145 // Reset req handle. Returns the deleted req handle |
3151 // Reset req handle. Returns the deleted req handle |
3146 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
3152 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
3147 EMultimodeSmsSendMessageNoFdnCheck ); |
3153 EMultimodeSmsSendMessageNoFdnCheck ); |
3148 |
3154 |
3149 if ( EMultimodeSmsReqHandleUnknown < reqHandle ) |
3155 if ( EMultimodeSmsReqHandleUnknown < reqHandle ) |
3180 iSmsSendReq->GetSendCounter() ) ) |
3186 iSmsSendReq->GetSendCounter() ) ) |
3181 { |
3187 { |
3182 // DOS returned error to send request. Message might be tried to be |
3188 // DOS returned error to send request. Message might be tried to be |
3183 // resent (see method ResendSms). |
3189 // resent (see method ResendSms). |
3184 // Timeout mechanism cannot access this part of code, ever. |
3190 // Timeout mechanism cannot access this part of code, ever. |
3185 TFLOGSTRING2("TSY: CMmSmsTsy::CompleteSendMessageNoFdnCheck. Resend counter: %d", iSmsSendReq->GetSendCounter()); |
3191 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSMSTSY_COMPLETESENDMESSAGENOFDNCHECK_1, "TSY: CMmSmsTsy::CompleteSendMessageNoFdnCheck. Resend counter: %d", iSmsSendReq->GetSendCounter()); |
3186 } |
3192 } |
3187 else |
3193 else |
3188 { |
3194 { |
3189 // This is executed |
3195 // This is executed |
3190 // - if sending was successful |
3196 // - if sending was successful |