telephonyserverplugins/simatktsy/src/csattsy.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     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".
    18 //
    18 //
    19 
    19 
    20 
    20 
    21 
    21 
    22 //  INCLUDE FILES
    22 //  INCLUDE FILES
       
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "csattsyTraces.h"
       
    27 #endif
       
    28 
    23 #include <etelsat.h>                // Etel SAT API
    29 #include <etelsat.h>                // Etel SAT API
    24 #include <satcs.h>                  // Etel SAT API
    30 #include <satcs.h>                  // Etel SAT API
    25 //#include "CMmPhoneTsy.h"			// Phone Tsy class
    31 //#include "CMmPhoneTsy.h"			// Phone Tsy class
    26 #include "CSatDataPackage.h"		// For data packages
    32 #include "CSatDataPackage.h"		// For data packages
    27 //#include "MmTsy_numberOfSlots.h"    // Number of Slots
    33 //#include "MmTsy_numberOfSlots.h"    // Number of Slots
    40 #include "CSatNotifySetUpCall.h"    // CSatNotifySetUpCall    
    46 #include "CSatNotifySetUpCall.h"    // CSatNotifySetUpCall    
    41 #include "CSatEventDownloadTsy.h"   // SatEventDownload class
    47 #include "CSatEventDownloadTsy.h"   // SatEventDownload class
    42 #include "CSatDataDownloadTsy.h"    // SatDataDownload class
    48 #include "CSatDataDownloadTsy.h"    // SatDataDownload class
    43 
    49 
    44 #include "msattsy_ipcdefs.h"		// Sat Tsy specific request types
    50 #include "msattsy_ipcdefs.h"		// Sat Tsy specific request types
    45 #include "TfLogger.h"               // For TFLOGSTRING
       
    46 #include "TSatUtility.h"		    // Sat Tsy Utility class
    51 #include "TSatUtility.h"		    // Sat Tsy Utility class
    47 #include "TTlv.h"					// TTlv class
    52 #include "TTlv.h"					// TTlv class
    48 #include "CSatTsyReqHandleStore.h"  // Request handle storage
    53 #include "CSatTsyReqHandleStore.h"  // Request handle storage
    49 
    54 
    50 #include "stktsy_number_of_slots.h"
    55 #include "stktsy_number_of_slots.h"
    58 		(
    63 		(
    59 		MMessageRouter& aMmMessageRouter,
    64 		MMessageRouter& aMmMessageRouter,
    60 		MCtsySatService& aSatService
    65 		MCtsySatService& aSatService
    61 		)
    66 		)
    62     {
    67     {
    63     TFLOGSTRING("CSAT: CSatTsy::NewL");
    68     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_NEWL_1, "CSAT: CSatTsy::NewL");
    64 
    69 
    65 	// Create subsession
    70 	// Create subsession
    66     CSatTsy* subsession = new ( ELeave ) CSatTsy( aMmMessageRouter, aSatService );
    71     CSatTsy* subsession = new ( ELeave ) CSatTsy( aMmMessageRouter, aSatService );
    67 
    72 
    68     CleanupStack::PushL( subsession );
    73     CleanupStack::PushL( subsession );
    69     subsession->ConstructL();
    74     subsession->ConstructL();
    70     CleanupStack::Pop();
    75     CleanupStack::Pop();
    71 
    76 
    72 	TFLOGSTRING("CSAT: CSatTsy::NewL, end of method");
    77 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_NEWL_2, "CSAT: CSatTsy::NewL, end of method");
    73     return subsession;
    78     return subsession;
    74     }
    79     }
    75 
    80 
    76 // -----------------------------------------------------------------------------
    81 // -----------------------------------------------------------------------------
    77 // CSatTsy::~CSatTsy
    82 // CSatTsy::~CSatTsy
    81 CSatTsy::~CSatTsy
    86 CSatTsy::~CSatTsy
    82 		(
    87 		(
    83 		// None
    88 		// None
    84 		)
    89 		)
    85     {
    90     {
    86     TFLOGSTRING("CSAT: CSatTsy::~CSatTsy");
    91     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_DTOR_1, "CSAT: CSatTsy::~CSatTsy");
    87 
    92 
    88     // Unregister.
    93     // Unregister.
    89     iMessageManager->RegisterTsyObject(
    94     iMessageManager->RegisterTsyObject(
    90 		CMmMessageManagerBase::ESatTsyObjType, NULL );
    95 		CMmMessageManagerBase::ESatTsyObjType, NULL );
    91 
    96 
    97     delete iSatEventDownloadTsy;
   102     delete iSatEventDownloadTsy;
    98 	// Message router and message manager are deleted here
   103 	// Message router and message manager are deleted here
    99     delete iMessageManager;
   104     delete iMessageManager;
   100     // Request handle store
   105     // Request handle store
   101     delete iSatReqHandleStore;
   106     delete iSatReqHandleStore;
   102     TFLOGSTRING("CSAT: CSatTsy::~CSatTsy, end of method");
   107     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_DTOR_2, "CSAT: CSatTsy::~CSatTsy, end of method");
   103     }
   108     }
   104 
   109 
   105 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   106 // CSatTsy::CSatTsy
   111 // CSatTsy::CSatTsy
   107 // C++ constructor
   112 // C++ constructor
   125 //
   130 //
   126 void CSatTsy::ConstructL
   131 void CSatTsy::ConstructL
   127 		( 
   132 		( 
   128         )
   133         )
   129     { 
   134     { 
   130     TFLOGSTRING("CSAT: CSatTsy::ConstructL");
   135     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_CONSTRUCTL_1, "CSAT: CSatTsy::ConstructL");
   131     
   136     
   132     // Set pointer to the message router 
   137     // Set pointer to the message router 
   133     iMessageManager = CMmMessageManagerBase::NewL(iMessageRouter);
   138     iMessageManager = CMmMessageManagerBase::NewL(iMessageRouter);
   134    
   139    
   135     // Register
   140     // Register
   180 	// Notify Licencee SIM ATK TSY that we are ready to receive messages
   185 	// Notify Licencee SIM ATK TSY that we are ready to receive messages
   181 	iMessageManager->HandleRequestL( ESatTsyReady );
   186 	iMessageManager->HandleRequestL( ESatTsyReady );
   182 	// Get SMS Point to Point Data Download support status
   187 	// Get SMS Point to Point Data Download support status
   183     iMessageManager->HandleRequestL( ESatTsySmsPpDdlStatus );
   188     iMessageManager->HandleRequestL( ESatTsySmsPpDdlStatus );
   184 	
   189 	
   185 	TFLOGSTRING("CSAT: CSatTsy::ConstructL, end of method");
   190 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_CONSTRUCTL_2, "CSAT: CSatTsy::ConstructL, end of method");
   186     }
   191     }
   187     
   192     
   188 // -----------------------------------------------------------------------------
   193 // -----------------------------------------------------------------------------
   189 // CSatTsy::ExtFunc
   194 // CSatTsy::ExtFunc
   190 // TRAP's all CSatTsy related Etel API requests in cases that they fail.
   195 // TRAP's all CSatTsy related Etel API requests in cases that they fail.
   195 		const TTsyReqHandle aTsyReqHandle,  
   200 		const TTsyReqHandle aTsyReqHandle,  
   196 		const TInt aIpc,           
   201 		const TInt aIpc,           
   197 		const TDataPackage& aPackage        
   202 		const TDataPackage& aPackage        
   198 		)
   203 		)
   199     {
   204     {
   200     TFLOGSTRING3("CSAT: CSatTsy::ExtFunc ReqHandle=%d IPC=%d", aTsyReqHandle, 
   205     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_EXTFUNC_1, "CSAT: CSatTsy::ExtFunc ReqHandle=0x%08x IPC=%d", (TUint)aTsyReqHandle, aIpc);
   201         aIpc);
       
   202 	TInt ret( KErrNone );
   206 	TInt ret( KErrNone );
   203 
   207 
   204     // Some SAT functions need trapping so we use two level function where 
   208     // Some SAT functions need trapping so we use two level function where 
   205     // first one is just a trap harness
   209     // first one is just a trap harness
   206     
   210     
   213 
   217 
   214     TRAP( trapError, ret = DoExtFuncL( aTsyReqHandle, aIpc, aPackage ) );
   218     TRAP( trapError, ret = DoExtFuncL( aTsyReqHandle, aIpc, aPackage ) );
   215 
   219 
   216     if ( KErrNone != trapError )
   220     if ( KErrNone != trapError )
   217         {
   221         {
   218         TFLOGSTRING2("CSAT: CSatTsy::ExtFunc, trapError: %d", trapError );
   222         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_EXTFUNC_2, "CSAT: CSatTsy::ExtFunc, trapError: %d", trapError );
   219         ReqCompleted( aTsyReqHandle, trapError );
   223         ReqCompleted( aTsyReqHandle, trapError );
   220         }
   224         }
   221 	else if ( KErrNone != ret )
   225 	else if ( KErrNone != ret )
   222         {
   226         {
   223         TFLOGSTRING2("CSAT: CSatTsy::ExtFunc, ret: %d", ret);
   227         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_EXTFUNC_3, "CSAT: CSatTsy::ExtFunc, ret: %d", ret);
   224         ReqCompleted( aTsyReqHandle, ret );
   228         ReqCompleted( aTsyReqHandle, ret );
   225         }
   229         }
   226     else										
   230     else										
   227 	    {
   231 	    {
   228         // Reset last Tsy request type
   232         // Reset last Tsy request type
   241 		( 
   245 		( 
   242 		const TTsyReqHandle aTsyReqHandle,  
   246 		const TTsyReqHandle aTsyReqHandle,  
   243         const TSatRequestTypes aSatRequestType
   247         const TSatRequestTypes aSatRequestType
   244 		)
   248 		)
   245     {
   249     {
   246     TFLOGSTRING3("CSAT: CSatTsy::SaveReqHandle ReqHandle=%d ReqHandleType=%d", 
   250     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SAVEREQHANDLE_1, "CSAT: CSatTsy::SaveReqHandle ReqHandle=0x%08x ReqHandleType=%d", (TUint)aTsyReqHandle, aSatRequestType);
   247         aTsyReqHandle, aSatRequestType);
       
   248     
   251     
   249     // Don't save the request handle if the type is unknown.
   252     // Don't save the request handle if the type is unknown.
   250     if ( ESatReqHandleUnknown != aSatRequestType )
   253     if ( ESatReqHandleUnknown != aSatRequestType )
   251         {
   254         {
   252         iSatReqHandleStore->SetTsyReqHandle( aSatRequestType, aTsyReqHandle );
   255         iSatReqHandleStore->SetTsyReqHandle( aSatRequestType, aTsyReqHandle );
   263 CTelObject::TReqMode CSatTsy::ReqModeL
   266 CTelObject::TReqMode CSatTsy::ReqModeL
   264 		( 
   267 		( 
   265 		const TInt aIpc    
   268 		const TInt aIpc    
   266 		)
   269 		)
   267     {
   270     {
   268     TFLOGSTRING("CSAT: CSatTsy::ReqModeL.");
   271     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_REQMODEL_1, "CSAT: CSatTsy::ReqModeL.");
   269     CTelObject::TReqMode ret = 0;
   272     CTelObject::TReqMode ret = 0;
   270 
   273 
   271     switch ( aIpc )
   274     switch ( aIpc )
   272         {
   275         {
   273         // Multiple Completion Services
   276         // Multiple Completion Services
   317             {
   320             {
   318             break;
   321             break;
   319             }
   322             }
   320         default:
   323         default:
   321             {
   324             {
   322             TFLOGSTRING2("CSAT: CSatTsy::ReqModeL unsupported IPC %d", aIpc);
   325             OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_REQMODEL_2, "CSAT: CSatTsy::ReqModeL unsupported IPC %d", aIpc);
   323             User::Leave( KErrNotSupported );
   326             User::Leave( KErrNotSupported );
   324             break;
   327             break;
   325             }
   328             }
   326         }
   329         }
   327     return ret;
   330     return ret;
   336 		( 
   339 		( 
   337 		const TInt aIpc,           
   340 		const TInt aIpc,           
   338 		const TTsyReqHandle aTsyReqHandle   
   341 		const TTsyReqHandle aTsyReqHandle   
   339 		)
   342 		)
   340     {
   343     {
   341     TFLOGSTRING3("CSAT: CSatTsy::CancelService ReqHandle=%d IPC=%d", 
   344     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_CANCELSERVICE_1, "CSAT: CSatTsy::CancelService ReqHandle=0x%08x IPC=%d", (TUint)aTsyReqHandle, aIpc);
   342         aTsyReqHandle, aIpc);
       
   343     TInt ret( KErrNotSupported );
   345     TInt ret( KErrNotSupported );
   344 
   346 
   345 	// When the clients close their sub-sessions (eg. by calling RLine::Close), 
   347 	// When the clients close their sub-sessions (eg. by calling RLine::Close), 
   346     // they may not have cancelled all their outstanding asynchronous requests 
   348     // they may not have cancelled all their outstanding asynchronous requests 
   347     // before closing.  It is up to the ETel server to clean up in this 
   349     // before closing.  It is up to the ETel server to clean up in this 
   406         // ESatEventDownload
   408         // ESatEventDownload
   407         // ESatGetMeSideSatProfile
   409         // ESatGetMeSideSatProfile
   408 
   410 
   409         default:
   411         default:
   410             {
   412             {
   411             TFLOGSTRING2("CSAT: CSatTsy::CancelService invalid IPC %d", aIpc);
   413             OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_CANCELSERVICE_2, "CSAT: CSatTsy::CancelService invalid IPC %d", aIpc);
   412             ret = KErrGeneral; 
   414             ret = KErrGeneral; 
   413             break;           	
   415             break;           	
   414             }
   416             }
   415         }
   417         }
   416     return ret;
   418     return ret;
   428 TInt CSatTsy::RegisterNotification
   430 TInt CSatTsy::RegisterNotification
   429 		( 
   431 		( 
   430 		const TInt aIpc    // IPC number of request
   432 		const TInt aIpc    // IPC number of request
   431 		)
   433 		)
   432     {
   434     {
   433     TFLOGSTRING("CSAT: CSatTsy::RegisterNotification.");
   435     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_REGISTERNOTIFICATION_1, "CSAT: CSatTsy::RegisterNotification.");
   434     // Initialize return value
   436     // Initialize return value
   435     TInt ret( KErrNone );
   437     TInt ret( KErrNone );
   436 
   438 
   437     switch ( aIpc )
   439     switch ( aIpc )
   438         {
   440         {
   468             break;
   470             break;
   469             }
   471             }
   470         default:
   472         default:
   471             {
   473             {
   472             // Unknown or invalid IPC
   474             // Unknown or invalid IPC
   473             TFLOGSTRING2("CSAT: CSatTsy::RegisterNotification, \
   475             OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_REGISTERNOTIFICATION_2, "CSAT: CSatTsy::RegisterNotification, Unsupported IPC %d", aIpc);
   474                 Unsupported IPC %d", aIpc);
       
   475             ret = KErrNotSupported;
   476             ret = KErrNotSupported;
   476             break;
   477             break;
   477             }
   478             }
   478         }
   479         }
   479     return ret;
   480     return ret;
   491 TInt CSatTsy::DeregisterNotification
   492 TInt CSatTsy::DeregisterNotification
   492 		( 
   493 		( 
   493 		const TInt aIpc    // IPC number of request
   494 		const TInt aIpc    // IPC number of request
   494 		)
   495 		)
   495     {
   496     {
   496     TFLOGSTRING("CSAT: CSatTsy::DeregisterNotification.");
   497     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_DEREGISTERNOTIFICATION_1, "CSAT: CSatTsy::DeregisterNotification.");
   497     // Initialize return value
   498     // Initialize return value
   498     TInt ret( KErrNone );
   499     TInt ret( KErrNone );
   499 
   500 
   500     switch ( aIpc )
   501     switch ( aIpc )
   501         {
   502         {
   531             break;
   532             break;
   532             }
   533             }
   533         default:
   534         default:
   534             {
   535             {
   535             // Unknown or invalid IPC
   536             // Unknown or invalid IPC
   536             TFLOGSTRING2("CSAT: CSatTsy::DeregisterNotification, \
   537             OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_DEREGISTERNOTIFICATION_2, "CSAT: CSatTsy::DeregisterNotification, Unsupported IPC %d", aIpc);
   537                 Unsupported IPC %d", aIpc);
       
   538             ret = KErrNotSupported;
   538             ret = KErrNotSupported;
   539             break;            	
   539             break;            	
   540             }
   540             }
   541         }
   541         }
   542     return ret;
   542     return ret;
   553 TInt CSatTsy::NumberOfSlotsL
   553 TInt CSatTsy::NumberOfSlotsL
   554 		( 
   554 		( 
   555 		const TInt aIpc    // IPC number of request
   555 		const TInt aIpc    // IPC number of request
   556 		)
   556 		)
   557     {
   557     {
   558     TFLOGSTRING("CSAT: CSatTsy::NumberOfSlotsL.");
   558     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_NUMBEROFSLOTSL_1, "CSAT: CSatTsy::NumberOfSlotsL.");
   559     TInt numberOfSlots( 1 );
   559     TInt numberOfSlots( 1 );
   560 
   560 
   561     switch ( aIpc )
   561     switch ( aIpc )
   562         {
   562         {
   563         case ESatNotifyDisplayTextPCmd:
   563         case ESatNotifyDisplayTextPCmd:
   668         	break;        	
   668         	break;        	
   669         	}
   669         	}
   670         default:
   670         default:
   671             {
   671             {
   672             // Unknown or invalid IPC
   672             // Unknown or invalid IPC
   673             TFLOGSTRING2("CSAT: CSatTsy::NumberOfSlotsL, Unsupported IPC %d", 
   673             OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_NUMBEROFSLOTSL_2, "CSAT: CSatTsy::NumberOfSlotsL, Unsupported IPC %d", aIpc);
   674                 aIpc);
       
   675             User::Leave( KErrNotSupported );
   674             User::Leave( KErrNotSupported );
   676             break;
   675             break;
   677             }
   676             }
   678         }  
   677         }  
   679     return numberOfSlots;
   678     return numberOfSlots;
   688 		( 
   687 		( 
   689 		TTsyReqHandle aReqHandle,
   688 		TTsyReqHandle aReqHandle,
   690         TInt aRet 
   689         TInt aRet 
   691         )
   690         )
   692 	{
   691 	{
   693 	TFLOGSTRING2("CSAT: CSatTsy::ReqCompleted, ReqHandle=%d ", aReqHandle);
   692 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_REQCOMPLETED_1, "CSAT: CSatTsy::ReqCompleted, ReqHandle=%d ", aReqHandle);
   694 #ifdef USING_CTSY_DISPATCHER
   693 #ifdef USING_CTSY_DISPATCHER
   695 	CTelObject::ReqCompleted( aReqHandle, aRet );
   694 	CTelObject::ReqCompleted( aReqHandle, aRet );
   696 #else
   695 #else
   697 	ReqCompleted( aReqHandle, aRet );
   696 	ReqCompleted( aReqHandle, aRet );
   698 #endif //USING_CTSY_DISPATCHER
   697 #endif //USING_CTSY_DISPATCHER
   706 void CSatTsy::StoreCallConnectedEvent
   705 void CSatTsy::StoreCallConnectedEvent
   707         (
   706         (
   708         const TDesC8& aEnvelope
   707         const TDesC8& aEnvelope
   709         )
   708         )
   710     {
   709     {
   711     TFLOGSTRING("CSAT: CSatTsy::StoreCallConnectedEvent");
   710     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_STORECALLCONNECTEDEVENT_1, "CSAT: CSatTsy::StoreCallConnectedEvent");
   712     iSatNotificationsTsy->SatNotifySetUpCall()->StoreCallConnectedEvent( 
   711     iSatNotificationsTsy->SatNotifySetUpCall()->StoreCallConnectedEvent( 
   713         aEnvelope );
   712         aEnvelope );
   714     }
   713     }
   715 
   714 
   716 // -----------------------------------------------------------------------------
   715 // -----------------------------------------------------------------------------
   721 void CSatTsy::SetSetUpCallStatus
   720 void CSatTsy::SetSetUpCallStatus
   722         (
   721         (
   723         const TBool aStatus
   722         const TBool aStatus
   724         )
   723         )
   725     {
   724     {
   726     TFLOGSTRING("CSAT: CSatTsy::SetSetUpCallStatus");
   725     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SETSETUPCALLSTATUS_1, "CSAT: CSatTsy::SetSetUpCallStatus");
   727     iSatEventDownloadTsy->SetSetUpCallStatus( aStatus );
   726     iSatEventDownloadTsy->SetSetUpCallStatus( aStatus );
   728     }
   727     }
   729 
   728 
   730 // -----------------------------------------------------------------------------
   729 // -----------------------------------------------------------------------------
   731 // CSatTsy::SetUpEventList
   730 // CSatTsy::SetUpEventList
   735 void CSatTsy::SetUpEventList
   734 void CSatTsy::SetUpEventList
   736         (
   735         (
   737         TUint32 aEvents     // events to be monitored
   736         TUint32 aEvents     // events to be monitored
   738         ) 
   737         ) 
   739     {
   738     {
   740     TFLOGSTRING("CSAT: CSatTsy::SetUpEventList");
   739     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SETUPEVENTLIST_1, "CSAT: CSatTsy::SetUpEventList");
   741     iSatEventDownloadTsy->SetUpEventList( aEvents );
   740     iSatEventDownloadTsy->SetUpEventList( aEvents );
   742     }
   741     }
   743 
   742 
   744 // -----------------------------------------------------------------------------
   743 // -----------------------------------------------------------------------------
   745 // CSatTsy::MessageManager
   744 // CSatTsy::MessageManager
   749 CMmMessageManagerBase* CSatTsy::MessageManager
   748 CMmMessageManagerBase* CSatTsy::MessageManager
   750         (
   749         (
   751         // none
   750         // none
   752         )
   751         )
   753     {
   752     {
   754     TFLOGSTRING("CSAT: CSatTsy::MessageManager");
   753     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_MESSAGEMANAGER_1, "CSAT: CSatTsy::MessageManager");
   755     return iMessageManager;
   754     return iMessageManager;
   756     }
   755     }
   757 
   756 
   758 // -----------------------------------------------------------------------------
   757 // -----------------------------------------------------------------------------
   759 // CSatTsy::SatCCTsy
   758 // CSatTsy::SatCCTsy
   763 CSatCCTsy* CSatTsy::SatCCTsy
   762 CSatCCTsy* CSatTsy::SatCCTsy
   764         (
   763         (
   765         // none
   764         // none
   766         )
   765         )
   767     {
   766     {
   768     TFLOGSTRING("CSAT: CSatTsy::SatCCTsy");
   767     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SATCCTSY_1, "CSAT: CSatTsy::SatCCTsy");
   769     return iSatCCTsy;
   768     return iSatCCTsy;
   770     }  
   769     }  
   771 
   770 
   772 // -----------------------------------------------------------------------------
   771 // -----------------------------------------------------------------------------
   773 // CSatTsy::GetSatReqHandleStore
   772 // CSatTsy::GetSatReqHandleStore
   777 CSatTsyReqHandleStore* CSatTsy::GetSatReqHandleStore
   776 CSatTsyReqHandleStore* CSatTsy::GetSatReqHandleStore
   778 	    (
   777 	    (
   779 	    //none
   778 	    //none
   780 	    )
   779 	    )
   781 	{
   780 	{
   782     TFLOGSTRING("CSAT: CSatTsy::GetSatReqHandleStore");
   781     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_GETSATREQHANDLESTORE_1, "CSAT: CSatTsy::GetSatReqHandleStore");
   783 	return iSatReqHandleStore;
   782 	return iSatReqHandleStore;
   784 	}
   783 	}
   785 
   784 
   786 // -----------------------------------------------------------------------------
   785 // -----------------------------------------------------------------------------
   787 // CSatTsy::GetReqHandleType
   786 // CSatTsy::GetReqHandleType
   791 CSatTsy::TSatRequestTypes* CSatTsy::GetReqHandleType
   790 CSatTsy::TSatRequestTypes* CSatTsy::GetReqHandleType
   792 	    (
   791 	    (
   793 	    //none
   792 	    //none
   794 	    )
   793 	    )
   795 	{
   794 	{
   796     TFLOGSTRING("CSAT: CSatTsy::GetReqHandleType");
   795     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_GETREQHANDLETYPE_1, "CSAT: CSatTsy::GetReqHandleType");
   797 	return &iReqHandleType;
   796 	return &iReqHandleType;
   798 	}
   797 	}
   799 
   798 
   800 // -----------------------------------------------------------------------------
   799 // -----------------------------------------------------------------------------
   801 // CSatTsy::CompleteSendSmsMessage
   800 // CSatTsy::CompleteSendSmsMessage
   805 TInt CSatTsy::CompleteSendSmsMessage
   804 TInt CSatTsy::CompleteSendSmsMessage
   806         (
   805         (
   807         TInt aStatus 
   806         TInt aStatus 
   808         )
   807         )
   809     {
   808     {
   810     TFLOGSTRING("CSAT: CSatTsy::CompleteSendSmsMessage");
   809     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_COMPLETESENDSMSMESSAGE_1, "CSAT: CSatTsy::CompleteSendSmsMessage");
   811     
   810     
   812     // Reset req handle. Returns the deleted req handle
   811     // Reset req handle. Returns the deleted req handle
   813     TTsyReqHandle reqHandle = iSatNotificationsTsy->RequestHandleStore()->
   812     TTsyReqHandle reqHandle = iSatNotificationsTsy->RequestHandleStore()->
   814         ResetTsyReqHandle( CSatTsy::ESatSendMessageNoLoggingReqType );
   813         ResetTsyReqHandle( CSatTsy::ESatSendMessageNoLoggingReqType );
   815 		
   814 		
   830 TBool CSatTsy::IsMoSmControlBySimActivated
   829 TBool CSatTsy::IsMoSmControlBySimActivated
   831 		(
   830 		(
   832 		void
   831 		void
   833 		)
   832 		)
   834     {
   833     {
   835     TFLOGSTRING("CSAT: CSatTsy::IsMoSmControlBySimActivated");
   834     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_ISMOSMCONTROLBYSIMACTIVATED_1, "CSAT: CSatTsy::IsMoSmControlBySimActivated");
   836     return iSatNotificationsTsy->IsMoSmControlActivated();
   835     return iSatNotificationsTsy->IsMoSmControlActivated();
   837     }
   836     }
   838 
   837 
   839 #ifdef USING_CTSY_DISPATCHER
   838 #ifdef USING_CTSY_DISPATCHER
   840     /**
   839     /**
   847 TBool CSatTsy::IsSimOriginatedCall
   846 TBool CSatTsy::IsSimOriginatedCall
   848 			(
   847 			(
   849 			const TDesC8& aAddress
   848 			const TDesC8& aAddress
   850 			)
   849 			)
   851 	{
   850 	{
   852 	TFLOGSTRING("CSAT: CSatTsy::IsSimOriginatedCall");
   851 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_ISSIMORIGINATEDCALL_1, "CSAT: CSatTsy::IsSimOriginatedCall");
   853 	TBool ret = EFalse;
   852 	TBool ret = EFalse;
   854 	if (iSatCCTsy)
   853 	if (iSatCCTsy)
   855 		{
   854 		{
   856 		ret = iSatCCTsy->HasProactiveOrigin(aAddress);
   855 		ret = iSatCCTsy->HasProactiveOrigin(aAddress);
   857 		}
   856 		}
   869 void CSatTsy::StoreProactiveAddress
   868 void CSatTsy::StoreProactiveAddress
   870         ( 
   869         ( 
   871         const TDesC8* aAddress 
   870         const TDesC8* aAddress 
   872         )
   871         )
   873     {
   872     {
   874     TFLOGSTRING("CSAT: CSatTsy::StoreProactiveAddress");
   873     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_STOREPROACTIVEADDRESS_1, "CSAT: CSatTsy::StoreProactiveAddress");
   875     iSatCCTsy->StoreAddressForCC( *aAddress );
   874     iSatCCTsy->StoreAddressForCC( *aAddress );
   876     }  
   875     }  
   877     
   876     
   878 // -----------------------------------------------------------------------------
   877 // -----------------------------------------------------------------------------
   879 // CSatTsy::SetTonNpi
   878 // CSatTsy::SetTonNpi
   883 void CSatTsy::SetTonNpi
   882 void CSatTsy::SetTonNpi
   884         ( 
   883         ( 
   885         const TUint8 aTonNpi 
   884         const TUint8 aTonNpi 
   886         )
   885         )
   887     {
   886     {
   888     TFLOGSTRING("CSAT: CSatTsy::SetTonNpi");
   887     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SETTONNPI_1, "CSAT: CSatTsy::SetTonNpi");
   889     iSatCCTsy->SetTonNpiForSS( aTonNpi );
   888     iSatCCTsy->SetTonNpiForSS( aTonNpi );
   890     }  
   889     }  
   891     
   890     
   892 // -----------------------------------------------------------------------------
   891 // -----------------------------------------------------------------------------
   893 // CSatTsy::DoExtFuncL
   892 // CSatTsy::DoExtFuncL
   899 		const TTsyReqHandle aTsyReqHandle,  
   898 		const TTsyReqHandle aTsyReqHandle,  
   900 		const TInt aIpc,           
   899 		const TInt aIpc,           
   901 		const TDataPackage& aPackage	
   900 		const TDataPackage& aPackage	
   902 		)
   901 		)
   903     {
   902     {
   904     TFLOGSTRING3("CSAT: CSatTsy::DoExtFuncL\t IPC:%d,\t Handle:%d",
   903     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_DOEXTFUNCL_1, "CSAT: CSatTsy::DoExtFuncL\t IPC:%d,\t Handle:%d",aIpc, aTsyReqHandle);
   905            aIpc, aTsyReqHandle);
       
   906 	TInt ret( KErrNone );
   904 	TInt ret( KErrNone );
   907 
   905 
   908 	// Add here ALL supported Sat request types, and call either the correct 
   906 	// Add here ALL supported Sat request types, and call either the correct 
   909 	//	Sat Tsy to handle the request, or a request directly here in CSatTsy.
   907 	//	Sat Tsy to handle the request, or a request directly here in CSatTsy.
   910     switch ( aIpc )
   908     switch ( aIpc )
   998         */
   996         */
   999 
   997 
  1000 		// Complete with KErrNotSupported, function not supported
   998 		// Complete with KErrNotSupported, function not supported
  1001 		default:
   999 		default:
  1002 			{
  1000 			{
  1003 			TFLOGSTRING2("CSAT: CSatTsy::DoExtFuncL unsupported IPC %d", aIpc);
  1001 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_DOEXTFUNCL_2, "CSAT: CSatTsy::DoExtFuncL unsupported IPC %d", aIpc);
  1004 			ReqCompleted( aTsyReqHandle, KErrNotSupported );
  1002 			ReqCompleted( aTsyReqHandle, KErrNotSupported );
  1005 			break;
  1003 			break;
  1006 			}
  1004 			}
  1007         }
  1005         }
  1008 
  1006 
  1018 		(
  1016 		(
  1019 		TTsyReqHandle   aTsyReqHandle,			
  1017 		TTsyReqHandle   aTsyReqHandle,			
  1020 		RSat::TMenuSelectionV1Pckg* aSelection	
  1018 		RSat::TMenuSelectionV1Pckg* aSelection	
  1021 		) 
  1019 		) 
  1022     {
  1020     {
  1023     TFLOGSTRING("CSAT: CSatTsy::MenuSelection");
  1021     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_MENUSELECTIONL_1, "CSAT: CSatTsy::MenuSelection");
  1024     TInt ret( KErrNone );
  1022     TInt ret( KErrNone );
  1025 
  1023 
  1026 	// It should not be possible that the request is asked more than once at 
  1024 	// It should not be possible that the request is asked more than once at 
  1027 	// time, therefore we do not need to check whether it is already ongoing
  1025 	// time, therefore we do not need to check whether it is already ongoing
  1028 
  1026 
  1029 	RSat::TMenuSelectionV1& selectionV1 = ( *aSelection ) ();
  1027 	RSat::TMenuSelectionV1& selectionV1 = ( *aSelection ) ();
  1030 	TFLOGSTRING3("CSAT:MenuSelection, iItemId %x, Help: %c", 
  1028 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_MENUSELECTIONL_2, "CSAT:MenuSelection, iItemId %x, Help: %c", selectionV1.iItemId, selectionV1.iHelp );
  1031 		selectionV1.iItemId, selectionV1.iHelp );
       
  1032 
  1029 
  1033     TTlv tlvSpecificData;
  1030     TTlv tlvSpecificData;
  1034     
  1031     
  1035     tlvSpecificData.Begin( KBerTlvMenuSelectionTag );
  1032     tlvSpecificData.Begin( KBerTlvMenuSelectionTag );
  1036     tlvSpecificData.AddTag( KTlvDeviceIdentityTag );
  1033     tlvSpecificData.AddTag( KTlvDeviceIdentityTag );
  1071         (
  1068         (
  1072         TDes8* aMsg,           
  1069         TDes8* aMsg,           
  1073         TTsyReqHandle   aTsyReqHandle   
  1070         TTsyReqHandle   aTsyReqHandle   
  1074         )
  1071         )
  1075     {
  1072     {
  1076     TFLOGSTRING("CSAT: CSatTsy::SendMessageNoLogging");
  1073     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SENDMESSAGENOLOGGING_1, "CSAT: CSatTsy::SendMessageNoLogging");
  1077     TInt ret( KErrNone );
  1074     TInt ret( KErrNone );
  1078 	
  1075 	
  1079 	// Save the request handle
  1076 	// Save the request handle
  1080     SaveReqHandle( aTsyReqHandle, ESatSendMessageNoLoggingReqType );
  1077     SaveReqHandle( aTsyReqHandle, ESatSendMessageNoLoggingReqType );
  1081 	
  1078 	
  1183         pdu = &satSmsV1.iBuf;
  1180         pdu = &satSmsV1.iBuf;
  1184 
  1181 
  1185         // Call SMS sending function from MMSMS
  1182         // Call SMS sending function from MMSMS
  1186         ret = iSatService.SendSatMessage( *this, pdu, sca, &numberType, 
  1183         ret = iSatService.SendSatMessage( *this, pdu, sca, &numberType, 
  1187                 &numberPlan, EFalse, aTsyReqHandle );
  1184                 &numberPlan, EFalse, aTsyReqHandle );
  1188         TFLOGSTRING2("CSAT: CSatTsy::SendMessageNoLogging, \
  1185         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SENDMESSAGENOLOGGING_2, "CSAT: CSatTsy::SendMessageNoLogging, SendSmsMessage done, ret: %x", ret);
  1189                 SendSmsMessage done, ret: %x", ret);
       
  1190        
  1186        
  1191        
  1187        
  1192         }
  1188         }
  1193     else // SCA missing
  1189     else // SCA missing
  1194         {
  1190         {
  1195         ret = KErrGeneral;
  1191         ret = KErrGeneral;
  1196         TFLOGSTRING("CSAT: CSatTsy::SendMessageNoLogging, SCA missing");
  1192         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SENDMESSAGENOLOGGING_3, "CSAT: CSatTsy::SendMessageNoLogging, SCA missing");
  1197         }
  1193         }
  1198 
  1194 
  1199     // Failure in sending of SAT SMS, call complete method
  1195     // Failure in sending of SAT SMS, call complete method
  1200     if ( KErrNone != ret )
  1196     if ( KErrNone != ret )
  1201         {
  1197         {
  1202         CompleteSendSmsMessage( ret ); 
  1198         CompleteSendSmsMessage( ret ); 
  1203         TFLOGSTRING("CSAT: CSatTsy::SendMessageNoLogging, \
  1199         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATTSY_SENDMESSAGENOLOGGING_4, "CSAT: CSatTsy::SendMessageNoLogging, failure sending SAT SMS, complete");
  1204             failure sending SAT SMS, complete");
       
  1205         }
  1200         }
  1206     
  1201     
  1207     return KErrNone;
  1202     return KErrNone;
  1208 
  1203 
  1209     }     
  1204     }