telephonyserverplugins/simatktsy/src/CSatNotifyMoSmControlRequest.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20: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 //INCLUDES
    22 //INCLUDES
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "CSatNotifyMoSmControlRequestTraces.h"
       
    27 #endif
       
    28 
       
    29 #include <satcs.h>                  // Etel SAT IPC definitions
    23 #include <satcs.h>                  // Etel SAT IPC definitions
    30 #include "CSatTsy.h"                // Tsy class header
    24 #include "CSatTsy.h"                // Tsy class header
    31 #include "CSatNotifyMoSmControlRequest.h"  // Class header
    25 #include "CSatNotifyMoSmControlRequest.h"  // Class header
    32 #include "CSatNotificationsTsy.h"   // Tsy class header
    26 #include "CSatNotificationsTsy.h"   // Tsy class header
    33 #include "CBerTlv.h"                // Ber Tlv data handling
    27 #include "CBerTlv.h"                // Ber Tlv data handling
    34 #include "BerTlv_defs.h"            // Ber Tlv specific definitions
    28 #include "BerTlv_defs.h"            // Ber Tlv specific definitions
    35 #include "TTlv.h"					// TTlv class
    29 #include "TTlv.h"					// TTlv class
    36 #include "CSatDataPackage.h"        // Parameter packing 
    30 #include "CSatDataPackage.h"        // Parameter packing 
       
    31 #include "TfLogger.h"               // For TFLOGSTRING
    37 #include "TSatUtility.h"            // Utilities
    32 #include "TSatUtility.h"            // Utilities
    38 #include "CSatTsyReqHandleStore.h"  // Request handle class
    33 #include "CSatTsyReqHandleStore.h"  // Request handle class
    39 #include "cmmmessagemanagerbase.h" 	// Message manager class for forwarding req.
    34 #include "cmmmessagemanagerbase.h" 	// Message manager class for forwarding req.
    40 #include "MSatTsy_IPCDefs.h"        // Sat Tsy internal request types
    35 #include "MSatTsy_IPCDefs.h"        // Sat Tsy internal request types
    41 
    36 
    47 CSatNotifyMoSmControlRequest* CSatNotifyMoSmControlRequest::NewL
    42 CSatNotifyMoSmControlRequest* CSatNotifyMoSmControlRequest::NewL
    48         ( 
    43         ( 
    49         CSatNotificationsTsy* aNotificationsTsy 
    44         CSatNotificationsTsy* aNotificationsTsy 
    50         )
    45         )
    51     {
    46     {
    52     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_NEWL_1, "CSAT: CSatNotifyMoSmControlRequest::NewL");
    47     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::NewL");
    53    	CSatNotifyMoSmControlRequest* const satNotifyMoSmControlRequest = 
    48    	CSatNotifyMoSmControlRequest* const satNotifyMoSmControlRequest = 
    54         new ( ELeave ) CSatNotifyMoSmControlRequest( aNotificationsTsy );
    49         new ( ELeave ) CSatNotifyMoSmControlRequest( aNotificationsTsy );
    55     CleanupStack::PushL( satNotifyMoSmControlRequest );
    50     CleanupStack::PushL( satNotifyMoSmControlRequest );
    56     satNotifyMoSmControlRequest->ConstructL();
    51     satNotifyMoSmControlRequest->ConstructL();
    57     CleanupStack::Pop( satNotifyMoSmControlRequest );
    52     CleanupStack::Pop( satNotifyMoSmControlRequest );
    58     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_NEWL_2, "CSAT: CSatNotifyMoSmControlRequest::NewL, end of method");
    53     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::NewL, end of method");
    59     return satNotifyMoSmControlRequest;
    54     return satNotifyMoSmControlRequest;
    60     }
    55     }
    61 
    56 
    62 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    63 // CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest
    58 // CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest
    67 CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest
    62 CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest
    68         ( 
    63         ( 
    69 		// None
    64 		// None
    70         )
    65         )
    71     {
    66     {
    72     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_DTOR_1, "CSAT: CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest");
    67     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::\
       
    68     	~CSatNotifyMoSmControlRequest");
    73     }
    69     }
    74     
    70     
    75 // -----------------------------------------------------------------------------
    71 // -----------------------------------------------------------------------------
    76 // CSatNotifyMoSmControlRequest::CSatNotifyMoSmControlRequest
    72 // CSatNotifyMoSmControlRequest::CSatNotifyMoSmControlRequest
    77 // Default C++ constructor
    73 // Default C++ constructor
    93 void CSatNotifyMoSmControlRequest::ConstructL
    89 void CSatNotifyMoSmControlRequest::ConstructL
    94         (
    90         (
    95         // None
    91         // None
    96         )
    92         )
    97     {
    93     {
    98     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CONSTRUCTL_1, "CSAT: CSatNotifyMoSmControlRequest::ConstructL");
    94     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ConstructL");
    99     // Checks if MO-SMS control should be activated
    95     // Checks if MO-SMS control should be activated
   100     iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( 
    96     iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( 
   101     		ESatTsyMoSmsControlActivation );	
    97     		ESatTsyMoSmsControlActivation );	
   102     // Initialize MO-SMS Control to deactivated
    98     // Initialize MO-SMS Control to deactivated
   103     iIsMoSmsCtrlActivated = EFalse; 
    99     iIsMoSmsCtrlActivated = EFalse; 
   104     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CONSTRUCTL_2, "CSAT: CSatNotifyMoSmControlRequest::ConstructL, end of method");
   100     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ConstructL, \
       
   101     	end of method"); 	
   105     }
   102     }
   106 
   103 
   107 // -----------------------------------------------------------------------------
   104 // -----------------------------------------------------------------------------
   108 // CSatNotifyMoSmControlRequest::Notify
   105 // CSatNotifyMoSmControlRequest::Notify
   109 // This request allows a client to be notified of a MO-SMS Control proactive 
   106 // This request allows a client to be notified of a MO-SMS Control proactive 
   114         (
   111         (
   115         const TTsyReqHandle aTsyReqHandle,
   112         const TTsyReqHandle aTsyReqHandle,
   116         const TDataPackage& aPackage 
   113         const TDataPackage& aPackage 
   117         )
   114         )
   118     {
   115     {
   119     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_NOTIFY_1, "CSAT: CSatNotifyMoSmControlRequest::Notify");
   116     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::Notify");
   120 
   117 
   121     // Save data pointer to client side for completion      
   118     // Save data pointer to client side for completion      
   122     iMoSmControlV1Pckg = reinterpret_cast<RSat::TMoSmControlV1Pckg*>(
   119     iMoSmControlV1Pckg = reinterpret_cast<RSat::TMoSmControlV1Pckg*>(
   123     	aPackage.Des1n() );
   120     	aPackage.Des1n() );
   124     
   121     
   138 TInt CSatNotifyMoSmControlRequest::CancelNotification
   135 TInt CSatNotifyMoSmControlRequest::CancelNotification
   139         (
   136         (
   140         const TTsyReqHandle aTsyReqHandle
   137         const TTsyReqHandle aTsyReqHandle
   141         )
   138         )
   142     {
   139     {
   143     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CANCELNOTIFICATION_1, "CSAT: CSatNotifyMoSmControlRequest::CancelNotification");
   140     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CancelNotification");
   144     
   141     
   145     // Reset the request handle
   142     // Reset the request handle
   146     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   143     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   147         ResetTsyReqHandle( CSatTsy::ESatNotifyMoSmControlRequestPCmdReqType );
   144         ResetTsyReqHandle( CSatTsy::ESatNotifyMoSmControlRequestPCmdReqType );
   148 	// Reset the data pointer
   145 	// Reset the data pointer
   163         (
   160         (
   164         CSatDataPackage* aDataPackage,   
   161         CSatDataPackage* aDataPackage,   
   165         TInt aErrorCode                
   162         TInt aErrorCode                
   166         )
   163         )
   167     {
   164     {
   168     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_1, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL" );
   165     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL" );
   169     
   166     
   170     CSatNotificationsTsy::TMoSmCtrlData moSmCtrlData;
   167     CSatNotificationsTsy::TMoSmCtrlData moSmCtrlData;
   171 
   168 
   172     // Initialize parameters
   169     // Initialize parameters
   173     moSmCtrlData.iResult = KMoSmCtrlResultAllowed;
   170     moSmCtrlData.iResult = KMoSmCtrlResultAllowed;
   187     	
   184     	
   188     	// Unpack parameters
   185     	// Unpack parameters
   189 		TDesC8* atkData = NULL;
   186 		TDesC8* atkData = NULL;
   190 		aDataPackage->UnPackData( &atkData );
   187 		aDataPackage->UnPackData( &atkData );
   191     	
   188     	
   192     	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_2, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL Data length: %d", ( *atkData ).Length() );
   189     	TFLOGSTRING2("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL\
       
   190     	    Data length: %d", ( *atkData ).Length() );
   193     	
   191     	
   194 	    if ( KTlvMaxSize < ( *atkData ).Length() )
   192 	    if ( KTlvMaxSize < ( *atkData ).Length() )
   195 	    	{
   193 	    	{
   196             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_3, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, Data length exceeded" );
   194             TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, \
       
   195                 Data length exceeded" );                
   197             // Data not consistent, reject the call
   196             // Data not consistent, reject the call
   198             moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed;
   197             moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed;
   199 	        isDataOk = EFalse;
   198 	        isDataOk = EFalse;
   200             }
   199             }
   201         else if ( ( *atkData ).Length() )
   200         else if ( ( *atkData ).Length() )
   204             // have not been modified.                
   203             // have not been modified.                
   205             ParseNotification( *atkData, addr1, addr2, alphaId  ); 
   204             ParseNotification( *atkData, addr1, addr2, alphaId  ); 
   206 
   205 
   207             if ( KMoSmCtrlResultAllowedWithModifications == ( *atkData )[0] )
   206             if ( KMoSmCtrlResultAllowedWithModifications == ( *atkData )[0] )
   208                 {
   207                 {
   209                 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_4, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL Addr1: %s, Addr2: %s", addr1, addr2 );
   208                 TFLOGSTRING3("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL\
       
   209     	            Addr1: %s, Addr2: %s", &addr1, &addr2 );
   210                 simRespDataConsistent = VerifyNotificationData( addr1, addr2 );      
   210                 simRespDataConsistent = VerifyNotificationData( addr1, addr2 );      
   211                 }
   211                 }
   212                 
   212                 
   213             if ( simRespDataConsistent )
   213             if ( simRespDataConsistent )
   214                 {
   214                 {
   215             	// atkData[0] --> result
   215             	// atkData[0] --> result
   216             	moSmCtrlData.iResult = ( *atkData )[0];            
   216             	moSmCtrlData.iResult = ( *atkData )[0];            
   217                 }
   217                 }
   218             else
   218             else
   219                 {
   219                 {
   220                 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_5, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, NAA response data not consistent" );
   220                 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, \
       
   221                 	NAA response data not consistent" );                
   221                 // Data not consistent, reject the sms
   222                 // Data not consistent, reject the sms
   222                 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed;
   223                 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed;
   223 	        	isDataOk = EFalse;
   224 	        	isDataOk = EFalse;
   224                 }
   225                 }
   225             }
   226             }
   297 	            } // If Alpha ID or request handle
   298 	            } // If Alpha ID or request handle
   298 
   299 
   299 	        } // If MO SM Ctrl Activated and data ok
   300 	        } // If MO SM Ctrl Activated and data ok
   300 	    else
   301 	    else
   301 	        {
   302 	        {
   302 	        OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_6, "LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, iIsMoSmsCtrlActivated: %d, isDataOk: %d ", iIsMoSmsCtrlActivated, isDataOk);
   303 	        TFLOGSTRING3("LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, \
       
   304     	        iIsMoSmsCtrlActivated: %d, isDataOk: %d ", 
       
   305     	        iIsMoSmsCtrlActivated, isDataOk);
   303 	        }
   306 	        }
   304     	} // if KErrNone
   307     	} // if KErrNone
   305     else
   308     else
   306         {
   309         {
   307         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_7, "LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, Error in notification ");
   310         TFLOGSTRING("LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, \
       
   311         	Error in notification ");
   308         moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed;
   312         moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed;
   309         // Pack data and send response right away to NAA
   313         // Pack data and send response right away to NAA
   310     	CSatDataPackage dataPackage;
   314     	CSatDataPackage dataPackage;
   311     	dataPackage.PackData( &moSmCtrlData );
   315     	dataPackage.PackData( &moSmCtrlData );
   312         iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( 
   316         iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( 
   326 	    (
   330 	    (
   327 	    CSatDataPackage* aDataPackage,
   331 	    CSatDataPackage* aDataPackage,
   328 	    TInt /*aResult*/
   332 	    TInt /*aResult*/
   329 	    )   
   333 	    )   
   330     {   
   334     {   
   331     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CREATEMOSMSCTRLENVELOPEL_1, "CSAT: CSatNotifyMoSmControlRequest::CreateMoSmsCtrlEnvelopeL");
   335     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::\
       
   336         CreateMoSmsCtrlEnvelopeL"); 
   332     // Check first if the MO-SMS is activated
   337     // Check first if the MO-SMS is activated
   333     if ( iIsMoSmsCtrlActivated )
   338     if ( iIsMoSmsCtrlActivated )
   334         {  
   339         {  
   335     	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CREATEMOSMSCTRLENVELOPEL_2, "CSAT: CSatNotifyMoSmControlRequest::CreateMoSmsCtrlEnvelopeL, MO SM Ctrl Activated");
   340     	TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::\
       
   341     		CreateMoSmsCtrlEnvelopeL, MO SM Ctrl Activated");
   336     	
   342     	
   337 	    CSatNotificationsTsy::TAddressData* addressData;
   343 	    CSatNotificationsTsy::TAddressData* addressData;
   338 	    
   344 	    
   339 	    // Unpack data
   345 	    // Unpack data
   340 	    aDataPackage->UnPackData( &addressData );
   346 	    aDataPackage->UnPackData( &addressData );
   382 		CSatDataPackage* aDataPackage
   388 		CSatDataPackage* aDataPackage
   383 		)
   389 		)
   384     {
   390     {
   385     // Unpack data
   391     // Unpack data
   386     aDataPackage->UnPackData( iIsMoSmsCtrlActivated );
   392     aDataPackage->UnPackData( iIsMoSmsCtrlActivated );
   387     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_SETACTIVATIONSTATUS_1, "CSAT: CSatNotifyMoSmControlRequest::SetActivationStatus, %d",iIsMoSmsCtrlActivated );
   393     TFLOGSTRING2("CSAT: CSatNotifyMoSmControlRequest::SetActivationStatus, %d",
       
   394     	iIsMoSmsCtrlActivated );
   388     }
   395     }
   389 
   396 
   390 // -----------------------------------------------------------------------------
   397 // -----------------------------------------------------------------------------
   391 // CSatNotifyMoSmControlRequest::ActivationStatus
   398 // CSatNotifyMoSmControlRequest::ActivationStatus
   392 // Returns ETrue if MO-SMS Control is activated
   399 // Returns ETrue if MO-SMS Control is activated
   395 TBool CSatNotifyMoSmControlRequest::ActivationStatus
   402 TBool CSatNotifyMoSmControlRequest::ActivationStatus
   396 		(
   403 		(
   397 		void
   404 		void
   398 		)
   405 		)
   399     {
   406     {
   400     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_ACTIVATIONSTATUS_1, "CSAT: CSatNotifyMoSmControlRequest::ActivationStatus");
   407     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ActivationStatus");
   401     return iIsMoSmsCtrlActivated;
   408     return iIsMoSmsCtrlActivated;
   402     }
   409     }
   403     
   410     
   404 // -----------------------------------------------------------------------------
   411 // -----------------------------------------------------------------------------
   405 // CSatNotifyMoSmControlRequest::CleanAddressData
   412 // CSatNotifyMoSmControlRequest::CleanAddressData
   410 void CSatNotifyMoSmControlRequest::CleanAddressData
   417 void CSatNotifyMoSmControlRequest::CleanAddressData
   411 		( 
   418 		( 
   412 		TDes8& aAddr 
   419 		TDes8& aAddr 
   413 		)
   420 		)
   414     {
   421     {
   415     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CLEANADDRESSDATA_1, "CSAT: CSatNotifyMoSmControlRequest::CleanAddressData");
   422     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CleanAddressData");
   416     // Starts from index 1, since index 0 is for TON/NPI    
   423     // Starts from index 1, since index 0 is for TON/NPI    
   417     for ( TInt i=1; i < aAddr.Length(); i++ )
   424     for ( TInt i=1; i < aAddr.Length(); i++ )
   418         {
   425         {
   419         if ( 0xF0 == ( aAddr[i] & 0xF0 ) )
   426         if ( 0xF0 == ( aAddr[i] & 0xF0 ) )
   420             {
   427             {
   443 	    TDes8& aAddr1,
   450 	    TDes8& aAddr1,
   444 	    TDes8& aAddr2,
   451 	    TDes8& aAddr2,
   445 	    RSat::TAlphaId& aAlphaId
   452 	    RSat::TAlphaId& aAlphaId
   446 	    )
   453 	    )
   447     {
   454     {
   448     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_1, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification");
   455     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification");
   449     
   456     
   450     // Input data:
   457     // Input data:
   451     // aAtkData[0] : result
   458     // aAtkData[0] : result
   452     // aAtkData[1][2] : length of BER-TLV, set n=1 if aAtkData[1]=0x81
   459     // aAtkData[1][2] : length of BER-TLV, set n=1 if aAtkData[1]=0x81
   453     // aAtkData[2+n] : tag of first TLV
   460     // aAtkData[2+n] : tag of first TLV
   487         TInt lengthTlv( aAtkData[indexInBerTlv + nn + 1] );
   494         TInt lengthTlv( aAtkData[indexInBerTlv + nn + 1] );
   488         
   495         
   489         // Check which TLV is received
   496         // Check which TLV is received
   490         if ( ( KTlvAddressTag == tag ) && ( !address1_got ) )
   497         if ( ( KTlvAddressTag == tag ) && ( !address1_got ) )
   491             {
   498             {
   492             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_2, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification Address 1");
   499             TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification\
       
   500                 Address 1");
   493             // RP address first
   501             // RP address first
   494             address1_got = ETrue;
   502             address1_got = ETrue;
   495             // Copy data to output variable
   503             // Copy data to output variable
   496             aAddr1.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) );
   504             aAddr1.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) );
   497             if ( KReservedTonNpi1 != aAddr1[0] && 
   505             if ( KReservedTonNpi1 != aAddr1[0] && 
   500                 CleanAddressData( aAddr1 );
   508                 CleanAddressData( aAddr1 );
   501                 }            
   509                 }            
   502             }
   510             }
   503         else if ( KTlvAddressTag == tag )
   511         else if ( KTlvAddressTag == tag )
   504             {
   512             {
   505             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_3, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification Address 2");
   513             TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification\
       
   514                 Address 2");
   506             // TP address. Copy data to output variable
   515             // TP address. Copy data to output variable
   507             aAddr2.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) );         
   516             aAddr2.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) );         
   508             if ( KReservedTonNpi1 != aAddr2[0] && 
   517             if ( KReservedTonNpi1 != aAddr2[0] && 
   509             	 KReservedTonNpi2 != aAddr2[0] && ( 1 < lengthTlv ) )
   518             	 KReservedTonNpi2 != aAddr2[0] && ( 1 < lengthTlv ) )
   510                 {
   519                 {
   511                 CleanAddressData( aAddr2 );
   520                 CleanAddressData( aAddr2 );
   512                 }    
   521                 }    
   513             }
   522             }
   514         else if ( KTlvAlphaIdentifierTag == tag )
   523         else if ( KTlvAlphaIdentifierTag == tag )
   515             {
   524             {
   516             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_4, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification Alpha ID");
   525             TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification\
       
   526                 Alpha ID");
   517             // Alpha id must be converted to TBuf16/unicode
   527             // Alpha id must be converted to TBuf16/unicode
   518             if ( lengthTlv )
   528             if ( lengthTlv )
   519                 {
   529                 {
   520                 // Set Alpha id status
   530                 // Set Alpha id status
   521 			        aAlphaId.iStatus = RSat::EAlphaIdProvided;
   531 			        aAlphaId.iStatus = RSat::EAlphaIdProvided;
   522                 TSatUtility::SetAlphaId( aAtkData.Mid( indexInBerTlv + nn + 2, 
   532                 TSatUtility::SetAlphaId( aAtkData.Mid( indexInBerTlv + nn + 2, 
   523                     lengthTlv ), aAlphaId.iAlphaId );                                
   533                     lengthTlv ), aAlphaId.iAlphaId );                                
   524                 }
   534                 }
   525             else
   535             else
   526                 {
   536                 {
   527                 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_5, "CSAT: CSatNotifyMoSmControlRequest:: ParseNotification. Alpha ID is NULL");
   537                 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest:: \
       
   538                 	ParseNotification. Alpha ID is NULL");
   528                 aAlphaId.iStatus = RSat::EAlphaIdNull;
   539                 aAlphaId.iStatus = RSat::EAlphaIdNull;
   529                 }  
   540                 }  
   530             }
   541             }
   531  
   542  
   532         // Update length for the while loop    
   543         // Update length for the while loop    
   546 		( 
   557 		( 
   547 		TDes8& aRPAddr, 
   558 		TDes8& aRPAddr, 
   548 		TDes8& aTPAddr 
   559 		TDes8& aTPAddr 
   549 		)
   560 		)
   550     {
   561     {
   551     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_VERIFYNOTIFICATIONDATA_1, "CSAT: CSatNotifyMoSmControlRequest::VerifyNotificationData");
   562     TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::VerifyNotificationData");
   552     TBool ret( ETrue );    
   563     TBool ret( ETrue );    
   553     if ( ( 0 == aRPAddr.Length() && 0 == aTPAddr.Length() ) || 
   564     if ( ( 0 == aRPAddr.Length() && 0 == aTPAddr.Length() ) || 
   554          ( KMoSmCtrlMaxLengthAddr1Addr2 <= ( 
   565          ( KMoSmCtrlMaxLengthAddr1Addr2 <= ( 
   555          	aRPAddr.Length() + aTPAddr.Length() ) ) ) 
   566          	aRPAddr.Length() + aTPAddr.Length() ) ) ) 
   556         {
   567         {