telephonyserverplugins/simatktsy/src/csatdatadownloadtsy.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".
    16 // DataDownload-related functionality of Sat Tsy
    16 // DataDownload-related functionality of Sat Tsy
    17 // Version     : 1.0
    17 // Version     : 1.0
    18 //
    18 //
    19 
    19 
    20 
    20 
    21 
       
    22 
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "csatdatadownloadtsyTraces.h"
       
    26 #endif
       
    27 
    21 
    28 #include <satcs.h>                  // Etel SAT IPC definitions
    22 #include <satcs.h>                  // Etel SAT IPC definitions
    29 #include <etelmm.h> 				// Etel MM Definitions
    23 #include <etelmm.h> 				// Etel MM Definitions
    30 #include "CSatDataPackage.h"        // Parameter packing 
    24 #include "CSatDataPackage.h"        // Parameter packing 
    31 #include "CSatDataDownloadTsy.h"    // Class header
    25 #include "CSatDataDownloadTsy.h"    // Class header
    32 #include "CSatTsy.h"                // Sat Tsy class
    26 #include "CSatTsy.h"                // Sat Tsy class
    33 #include "TSatUtility.h"            // Utilities
    27 #include "TSatUtility.h"            // Utilities
    34 #include "cmmmessagemanagerbase.h"  // Message manager class for forwarding req.
    28 #include "cmmmessagemanagerbase.h"  // Message manager class for forwarding req.
       
    29 #include "TfLogger.h"               // For TFLOGSTRING
    35 #include "CBerTlv.h"                // Ber Tlv
    30 #include "CBerTlv.h"                // Ber Tlv
    36 #include "TTlv.h"					// TTlv class
    31 #include "TTlv.h"					// TTlv class
    37 #include "MSatTsy_IPCDefs.h"        // Sat Tsy internal request types
    32 #include "MSatTsy_IPCDefs.h"        // Sat Tsy internal request types
    38 
    33 
    39 // -----------------------------------------------------------------------------
    34 // -----------------------------------------------------------------------------
    44 CSatDataDownloadTsy* CSatDataDownloadTsy::NewL
    39 CSatDataDownloadTsy* CSatDataDownloadTsy::NewL
    45         (    
    40         (    
    46         CSatTsy* aSatTsy  
    41         CSatTsy* aSatTsy  
    47         )
    42         )
    48     {
    43     {
    49     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_NEWL_1,  "CSAT: CSatDataDownloadTsy::NewL" );
    44     TFLOGSTRING( "CSAT: CSatDataDownloadTsy::NewL" );
    50     CSatDataDownloadTsy* const satDataDownloadTsy = 
    45     CSatDataDownloadTsy* const satDataDownloadTsy = 
    51         new ( ELeave ) CSatDataDownloadTsy();
    46         new ( ELeave ) CSatDataDownloadTsy();
    52     CleanupStack::PushL( satDataDownloadTsy );
    47     CleanupStack::PushL( satDataDownloadTsy );
    53     satDataDownloadTsy->iSatTsy = aSatTsy;
    48     satDataDownloadTsy->iSatTsy = aSatTsy;
    54     satDataDownloadTsy->ConstructL();
    49     satDataDownloadTsy->ConstructL();
    55     CleanupStack::Pop( satDataDownloadTsy );
    50     CleanupStack::Pop( satDataDownloadTsy );
    56     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_NEWL_2,  "CSAT: CSatDataDownloadTsy::NewL, end of method" );
    51     TFLOGSTRING( "CSAT: CSatDataDownloadTsy::NewL, end of method" );
    57     return satDataDownloadTsy; 
    52     return satDataDownloadTsy; 
    58     }
    53     }
    59 
    54 
    60 // -----------------------------------------------------------------------------
    55 // -----------------------------------------------------------------------------
    61 // CSatDataDownloadTsy::~CSatDataDownloadTsy
    56 // CSatDataDownloadTsy::~CSatDataDownloadTsy
    65 CSatDataDownloadTsy::~CSatDataDownloadTsy
    60 CSatDataDownloadTsy::~CSatDataDownloadTsy
    66         (    
    61         (    
    67         void   
    62         void   
    68         )
    63         )
    69     {
    64     {
    70     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_DTOR_1,  "CSAT: CSatDataDownloadTsy::~CSatDataDownloadTsy" );
    65     TFLOGSTRING( "CSAT: CSatDataDownloadTsy::~CSatDataDownloadTsy" );
    71     // Unregister
    66     // Unregister
    72     iSatTsy->MessageManager()->RegisterTsyObject(
    67     iSatTsy->MessageManager()->RegisterTsyObject(
    73 		CMmMessageManagerBase::ESatDataDownloadTsyObjType, NULL );
    68 		CMmMessageManagerBase::ESatDataDownloadTsyObjType, NULL );
    74     }
    69     }
    75 
    70 
    94 void CSatDataDownloadTsy::ConstructL
    89 void CSatDataDownloadTsy::ConstructL
    95         (    
    90         (    
    96         void
    91         void
    97         )
    92         )
    98     {
    93     {
    99     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CONSTRUCTL_1,  "CSAT: CSatDataDownloadTsy::ConstructL" );
    94     TFLOGSTRING( "CSAT: CSatDataDownloadTsy::ConstructL" );
   100     // Register
    95     // Register
   101     iSatTsy->MessageManager()->RegisterTsyObject(
    96     iSatTsy->MessageManager()->RegisterTsyObject(
   102 		CMmMessageManagerBase::ESatDataDownloadTsyObjType, this );
    97 		CMmMessageManagerBase::ESatDataDownloadTsyObjType, this );
   103 	// Initialize as not supported
    98 	// Initialize as not supported
   104 	iIsSmsPpDdlSupported = EFalse;
    99 	iIsSmsPpDdlSupported = EFalse;
   113 void CSatDataDownloadTsy::CompleteCellBroadcastDdlL
   108 void CSatDataDownloadTsy::CompleteCellBroadcastDdlL
   114          (
   109          (
   115          const CSatDataPackage* aDataPackage
   110          const CSatDataPackage* aDataPackage
   116          )
   111          )
   117     {
   112     {
   118     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_COMPLETECELLBROADCASTDDLL_1,  "CSAT:CSatDataDownloadTsy::CompleteCellBroadcastDdlL" );
   113     TFLOGSTRING( "CSAT:CSatDataDownloadTsy::CompleteCellBroadcastDdlL" );
   119 
   114 
   120     TBuf8<KCbsMsgMaxLength> aPdu;
   115     TBuf8<KCbsMsgMaxLength> aPdu;
   121     aDataPackage->UnPackData( aPdu );     
   116     aDataPackage->UnPackData( aPdu );     
   122     TTlv envelope;
   117     TTlv envelope;
   123     // Tag
   118     // Tag
   155 void CSatDataDownloadTsy::CompleteSmsPpDdlL
   150 void CSatDataDownloadTsy::CompleteSmsPpDdlL
   156         (
   151         (
   157         const CSatDataPackage* aDataPackage
   152         const CSatDataPackage* aDataPackage
   158         )
   153         )
   159     {  
   154     {  
   160     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_COMPLETESMSPPDDLL_1,  "CSAT:CSatDataDownloadTsy::CompleteSmsPpDdlL" );
   155     TFLOGSTRING( "CSAT:CSatDataDownloadTsy::CompleteSmsPpDdlL" );
   161     TBuf8<KAddrMaxLength> smsScAddress;
   156     TBuf8<KAddrMaxLength> smsScAddress;
   162     TBuf8<RMobileSmsMessaging::KGsmTpduSize> smsTpdu;
   157     TBuf8<RMobileSmsMessaging::KGsmTpduSize> smsTpdu;
   163     
   158     
   164     // Unpack data
   159     // Unpack data
   165     aDataPackage->UnPackData( smsScAddress, smsTpdu );
   160     aDataPackage->UnPackData( smsScAddress, smsTpdu );
   175         // Check if the SMS should be saved to EFsms (see method descr.)
   170         // Check if the SMS should be saved to EFsms (see method descr.)
   176         if ( KErrNone == ParseSmsTpdu( smsTpdu ) &&
   171         if ( KErrNone == ParseSmsTpdu( smsTpdu ) &&
   177              KSmsTpduProtcolIdUSimDdl == iSmsTpdu.iProtocolId && 
   172              KSmsTpduProtcolIdUSimDdl == iSmsTpdu.iProtocolId && 
   178             ( !( iSmsTpdu.iDcs & 0x01 ) ) && ( iSmsTpdu.iDcs & 0x02 ) )
   173             ( !( iSmsTpdu.iDcs & 0x01 ) ) && ( iSmsTpdu.iDcs & 0x02 ) )
   179             {
   174             {
   180             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_COMPLETESMSPPDDLL_2,  "CSAT:CSatDataDownloadTsy::CompleteSmsPpDdlL, SMS PP DDL is not supported, Store SMS to EFsms" );
   175             TFLOGSTRING( "CSAT:CSatDataDownloadTsy::CompleteSmsPpDdlL,\
       
   176                 SMS PP DDL is not supported, Store SMS to EFsms" ); 
   181             CreateEntryForSavingSmsL( smsScAddress, smsTpdu );
   177             CreateEntryForSavingSmsL( smsScAddress, smsTpdu );
   182             }
   178             }
   183         }
   179         }
   184     }
   180     }
   185     
   181     
   193         (
   189         (
   194         const TDesC8& aSmsScAddress,
   190         const TDesC8& aSmsScAddress,
   195         const TDesC8& aSmsTpdu
   191         const TDesC8& aSmsTpdu
   196         )
   192         )
   197     {  
   193     {  
   198     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATEENTRYFORSAVINGSMSL_1,  "CSAT:CSatDataDownloadTsy::CreateEntryForSavingSms SC Addr. length: %d", aSmsScAddress.Length() );
   194     TFLOGSTRING2( "CSAT:CSatDataDownloadTsy::CreateEntryForSavingSms\
       
   195         SC Addr. length: %d", aSmsScAddress.Length() );
   199     TInt offset = 0;
   196     TInt offset = 0;
   200     
   197     
   201     // Check that the SC address length contains the length in
   198     // Check that the SC address length contains the length in
   202     // addition to the address.
   199     // addition to the address.
   203     if ( ( aSmsScAddress[offset] + 1 ) == aSmsScAddress.Length() )
   200     if ( ( aSmsScAddress[offset] + 1 ) == aSmsScAddress.Length() )
   229             }
   226             }
   230 
   227 
   231         // Copy the Service Centre address and TPDU data
   228         // Copy the Service Centre address and TPDU data
   232         smsEntry.iServiceCentre.iTelNumber.Copy( scAddress16 );
   229         smsEntry.iServiceCentre.iTelNumber.Copy( scAddress16 );
   233                 
   230                 
   234         OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATEENTRYFORSAVINGSMSL_2, "CSAT:CSatDataDownloadTsy::CreateEntryForSavingSms, iTelNumber: %S", smsEntry.iServiceCentre.iTelNumber );
   231         TFLOGSTRING2("CSAT:CSatDataDownloadTsy::CreateEntryForSavingSms,\
       
   232             iTelNumber: %S", &smsEntry.iServiceCentre.iTelNumber );
   235             
   233             
   236         smsEntry.iMsgData.Copy( aSmsTpdu ); 
   234         smsEntry.iMsgData.Copy( aSmsTpdu ); 
   237         
   235         
   238         // We set the index to point -1, since it means we use the 1st free 
   236         // We set the index to point -1, since it means we use the 1st free 
   239         // slot. See Etel MM API Specification, 8.1.4 Write Entry. 
   237         // slot. See Etel MM API Specification, 8.1.4 Write Entry. 
   260 void CSatDataDownloadTsy::CreateSmsDeliverReportL
   258 void CSatDataDownloadTsy::CreateSmsDeliverReportL
   261         (
   259         (
   262         TInt aResult
   260         TInt aResult
   263         )  
   261         )  
   264     {
   262     {
   265     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATESMSDELIVERREPORTL_1, "CSAT: CSatDataDownloadTsy::CreateSmsDeliverReportL");
   263     TFLOGSTRING("CSAT: CSatDataDownloadTsy::CreateSmsDeliverReportL");
   266     TBuf8<KTpduMaxSize> reportData;
   264     TBuf8<KTpduMaxSize> reportData;
   267        
   265        
   268     // Get User Data length
   266     // Get User Data length
   269     TUint8 userDataLength = iSmsTpdu.iUserData.Length();
   267     TUint8 userDataLength = iSmsTpdu.iUserData.Length();
   270     
   268     
   271     // Check that SMS TPDU data exists by checking the last mandatory item
   269     // Check that SMS TPDU data exists by checking the last mandatory item
   272     if ( KSmsTpduByteUnknownOrReserved != iSmsTpdu.iDcs )
   270     if ( KSmsTpduByteUnknownOrReserved != iSmsTpdu.iDcs )
   273         {
   271         {
   274         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATESMSDELIVERREPORTL_2, "CSAT: CSatDataDownloadTsy::CreateSmsDeliverReportL, SMS TPDU OK");
   272         TFLOGSTRING("CSAT: CSatDataDownloadTsy::CreateSmsDeliverReportL,\
       
   273             SMS TPDU OK");
   275         reportData.Zero();
   274         reportData.Zero();
   276         reportData.Append( iSmsTpdu.iParameters );   // 1st byte -> parameters
   275         reportData.Append( iSmsTpdu.iParameters );   // 1st byte -> parameters
   277         reportData.Append( KAllOptParamsPresent );   // TP-Parameter-Indicator
   276         reportData.Append( KAllOptParamsPresent );   // TP-Parameter-Indicator
   278         reportData.Append( iSmsTpdu.iProtocolId );   // TP-Protocol-Identifier
   277         reportData.Append( iSmsTpdu.iProtocolId );   // TP-Protocol-Identifier
   279         reportData.Append( iSmsTpdu.iDcs );          // TP-Data-Coding-Scheme
   278         reportData.Append( iSmsTpdu.iDcs );          // TP-Data-Coding-Scheme
   288         // If saving went OK it means that RP-ACK must to be sent and data is
   287         // If saving went OK it means that RP-ACK must to be sent and data is
   289         // ready, otherwise RP-ERROR must to be sent, which means that TP Failure 
   288         // ready, otherwise RP-ERROR must to be sent, which means that TP Failure 
   290         // Cause must be inserted after the parameters
   289         // Cause must be inserted after the parameters
   291         if ( KErrNone != aResult )
   290         if ( KErrNone != aResult )
   292             {
   291             {
   293             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATESMSDELIVERREPORTL_3, "CSAT: CSatDataDownloadTsy::CreateSmsDeliverReportL, Add TP Failure Cause: KDataDownloadError");
   292             TFLOGSTRING("CSAT: CSatDataDownloadTsy::CreateSmsDeliverReportL,\
       
   293                 Add TP Failure Cause: KDataDownloadError");
   294             TBuf8<1> failureCause;
   294             TBuf8<1> failureCause;
   295             failureCause.Zero();
   295             failureCause.Zero();
   296             failureCause.Append( KDataDownloadError );
   296             failureCause.Append( KDataDownloadError );
   297             reportData.Insert( 1, failureCause );
   297             reportData.Insert( 1, failureCause );
   298             }
   298             }
   317         (
   317         (
   318         const TDesC8& aSmsScAddress,
   318         const TDesC8& aSmsScAddress,
   319         const TDesC8& aSmsTpdu
   319         const TDesC8& aSmsTpdu
   320         )
   320         )
   321     {  
   321     {  
   322     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATESMSPPDDLENVELOPEL_1,  "CSAT:CSatDataDownloadTsy::CreateSmsPpDdlEnvelopeL" );
   322     TFLOGSTRING( "CSAT:CSatDataDownloadTsy::CreateSmsPpDdlEnvelopeL" );
   323     // Check that the data exists
   323     // Check that the data exists
   324     if ( aSmsScAddress.Length() && aSmsTpdu.Length() )
   324     if ( aSmsScAddress.Length() && aSmsTpdu.Length() )
   325         {
   325         {
   326         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_CREATESMSPPDDLENVELOPEL_2,  "CSAT:CSatDataDownloadTsy::CreateSmsPpDdlEnvelopeL, Data Ok" );
   326         TFLOGSTRING( "CSAT:CSatDataDownloadTsy::CreateSmsPpDdlEnvelopeL,\
       
   327             Data Ok" );
   327         TTlv envelope;
   328         TTlv envelope;
   328  
   329  
   329         envelope.Begin( KBerTlvSmsPpDownloadTag );
   330         envelope.Begin( KBerTlvSmsPpDownloadTag );
   330         envelope.AddTag( KTlvDeviceIdentityTag );
   331         envelope.AddTag( KTlvDeviceIdentityTag );
   331         envelope.AddByte( KNetwork );
   332         envelope.AddByte( KNetwork );
   354 void CSatDataDownloadTsy::CompleteReadCbmidsL
   355 void CSatDataDownloadTsy::CompleteReadCbmidsL
   355         (
   356         (
   356         void 
   357         void 
   357         )
   358         )
   358     {
   359     {
   359     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_COMPLETEREADCBMIDSL_1,  "CSAT: CSatDataDownloadTsy::CompleteReadCbmids" );
   360     TFLOGSTRING( "CSAT: CSatDataDownloadTsy::CompleteReadCbmids" );
   360     // Convert constants and append to simFilePath
   361     // Convert constants and append to simFilePath
   361     TBuf8<KMaxFilePath> simFilePath;
   362     TBuf8<KMaxFilePath> simFilePath;
   362     // Append data
   363     // Append data
   363     simFilePath.Append( TUint8( KMasterFileCbmids >> 8 ) );
   364     simFilePath.Append( TUint8( KMasterFileCbmids >> 8 ) );
   364     //lint -e{778} Constant expression evaluates to 0 in operation 
   365     //lint -e{778} Constant expression evaluates to 0 in operation 
   387         (
   388         (
   388         const CSatDataPackage* aDataPackage 
   389         const CSatDataPackage* aDataPackage 
   389         )
   390         )
   390     {
   391     {
   391     aDataPackage->UnPackData( iIsSmsPpDdlSupported );   
   392     aDataPackage->UnPackData( iIsSmsPpDdlSupported );   
   392     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_SETSMSPPDDLSTATUS_1, "CSAT: CSatNotifyMoSmControlRequest::SetActivationStatus, %d",iIsSmsPpDdlSupported );
   393     TFLOGSTRING2("CSAT: CSatNotifyMoSmControlRequest::SetActivationStatus, %d",
       
   394     	iIsSmsPpDdlSupported );     
   393     }  
   395     }  
   394     
   396     
   395 // -----------------------------------------------------------------------------
   397 // -----------------------------------------------------------------------------
   396 // CSatDataDownloadTsy::ParseSmsTpdu
   398 // CSatDataDownloadTsy::ParseSmsTpdu
   397 // Interprets the given TPDU data and sets the results to internal data member
   399 // Interprets the given TPDU data and sets the results to internal data member
   400 TInt CSatDataDownloadTsy::ParseSmsTpdu
   402 TInt CSatDataDownloadTsy::ParseSmsTpdu
   401         (
   403         (
   402         const TDesC8& aSmsTpdu
   404         const TDesC8& aSmsTpdu
   403         )
   405         )
   404     {
   406     {
   405     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_PARSESMSTPDU_1, "CSAT: CSatDataDownloadTsy::ParseSmsTpdu");
   407     TFLOGSTRING("CSAT: CSatDataDownloadTsy::ParseSmsTpdu");
   406     TInt ret( KErrCorrupt );
   408     TInt ret( KErrCorrupt );
   407     
   409     
   408     // Initialize values
   410     // Initialize values
   409     iSmsTpdu.iParameters = KSmsTpduByteUnknownOrReserved;
   411     iSmsTpdu.iParameters = KSmsTpduByteUnknownOrReserved;
   410     iSmsTpdu.iProtocolId = KSmsTpduByteUnknownOrReserved;
   412     iSmsTpdu.iProtocolId = KSmsTpduByteUnknownOrReserved;
   435         TUint8 offset = KSmsTpduAddrOffset + 2 + addrLengthInBytes;
   437         TUint8 offset = KSmsTpduAddrOffset + 2 + addrLengthInBytes;
   436 
   438 
   437         // Just to be on the safe side, check that the offset is not too big
   439         // Just to be on the safe side, check that the offset is not too big
   438         if ( aSmsTpdu.Length() > ( offset + 1 + KSmsTpduSctsLength ) )
   440         if ( aSmsTpdu.Length() > ( offset + 1 + KSmsTpduSctsLength ) )
   439             {
   441             {
   440             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_PARSESMSTPDU_2,  "CSAT:CSatDataDownloadTsy::ParseSmsTpdu, SmsTpdu length Ok" );
   442             TFLOGSTRING( "CSAT:CSatDataDownloadTsy::ParseSmsTpdu,\
       
   443                 SmsTpdu length Ok" );
   441             // Set protocol id and data coding shceme
   444             // Set protocol id and data coding shceme
   442             iSmsTpdu.iProtocolId = aSmsTpdu[offset];
   445             iSmsTpdu.iProtocolId = aSmsTpdu[offset];
   443             iSmsTpdu.iDcs = aSmsTpdu[++offset] ;
   446             iSmsTpdu.iDcs = aSmsTpdu[++offset] ;
   444             
   447             
   445             // Update offset to point the TP-UDL (skip TP-SCTS, not needed)
   448             // Update offset to point the TP-UDL (skip TP-SCTS, not needed)
   448                 
   451                 
   449             // If user data exists, add it to the end of buffer
   452             // If user data exists, add it to the end of buffer
   450             if ( tpduUserDataLength )
   453             if ( tpduUserDataLength )
   451                 {
   454                 {
   452                 iSmsTpdu.iUserData.Copy( aSmsTpdu.Mid( ++offset ) );
   455                 iSmsTpdu.iUserData.Copy( aSmsTpdu.Mid( ++offset ) );
   453                 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATDATADOWNLOADTSY_PARSESMSTPDU_3,  "CSAT:CSatDataDownloadTsy::ParseSmsTpdu, iUserData length: %d", iSmsTpdu.iUserData.Length() );
   456                 TFLOGSTRING2( "CSAT:CSatDataDownloadTsy::ParseSmsTpdu,\
       
   457                     iUserData length: %d", iSmsTpdu.iUserData.Length() );
   454                 }
   458                 }
   455 
   459 
   456             ret = KErrNone;
   460             ret = KErrNone;
   457             } 
   461             } 
   458         } // TPDU reaches the minimum length  
   462         } // TPDU reaches the minimum length