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