adaptationlayer/tsy/simatktsy_dll/src/sateventdownload.cpp
changeset 9 8486d82aef45
parent 8 6295dc2169f3
equal deleted inserted replaced
8:6295dc2169f3 9:8486d82aef45
    35 
    35 
    36 // CONSTANTS
    36 // CONSTANTS
    37 const TUint8 KMaxCallModemDetailedCause = 248;
    37 const TUint8 KMaxCallModemDetailedCause = 248;
    38 const TUint8 KCallModemOriginCsAddressMaxLength = 246;
    38 const TUint8 KCallModemOriginCsAddressMaxLength = 246;
    39 const TUint8 KMSBMask = 0x80;
    39 const TUint8 KMSBMask = 0x80;
       
    40 const TUint8 KNbrIndexWithoutIndicatorInfo = 1;
       
    41 const TUint8 KNbrIndexWithIndicatorInfo = 2;
       
    42 const TUint8 KExtMask = 0x80;
    40 
    43 
    41 
    44 
    42 // ==================== MEMBER FUNCTIONS ====================================
    45 // ==================== MEMBER FUNCTIONS ====================================
    43 
    46 
    44 // -----------------------------------------------------------------------------
    47 // -----------------------------------------------------------------------------
    59         iForceLocationStatusEnvelope( EFalse ),
    62         iForceLocationStatusEnvelope( EFalse ),
    60         iCallsOngoing( EFalse ),
    63         iCallsOngoing( EFalse ),
    61         iLocationStatusEnvelopePending( EFalse ),
    64         iLocationStatusEnvelopePending( EFalse ),
    62         iNetCellInfoIndReceived( EFalse )
    65         iNetCellInfoIndReceived( EFalse )
    63     {
    66     {
    64     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CSATEVENTDOWNLOAD, "CSatEventDownload::CSatEventDownload" );
    67     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_CSATEVENTDOWNLOAD_TD, "CSatEventDownload::CSatEventDownload" );
    65     iLocInfo.iOperatorCode.FillZ( iLocInfo.iOperatorCode.MaxLength() );
    68     iLocInfo.iOperatorCode.FillZ( iLocInfo.iOperatorCode.MaxLength() );
    66     iLocInfo.iLac.FillZ( iLocInfo.iLac.MaxLength() );
    69     iLocInfo.iLac.FillZ( iLocInfo.iLac.MaxLength() );
    67     iLocInfo.iCellId.FillZ( iLocInfo.iCellId.MaxLength() );
    70     iLocInfo.iCellId.FillZ( iLocInfo.iCellId.MaxLength() );
    68     iLocInfo.iRegStatus = NET_NO_COVERAGE;
    71     iLocInfo.iRegStatus = NET_NO_COVERAGE;
    69     }
    72     }
    73 // Symbian 2nd phase constructor can leave.
    76 // Symbian 2nd phase constructor can leave.
    74 // -----------------------------------------------------------------------------
    77 // -----------------------------------------------------------------------------
    75 //
    78 //
    76 void CSatEventDownload::ConstructL()
    79 void CSatEventDownload::ConstructL()
    77     {
    80     {
    78     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CONSTRUCTL, "CSatEventDownload::ConstructL" );
    81     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_CONSTRUCTL_TD, "CSatEventDownload::ConstructL" );
    79     // None. Reserved for future use.
    82     // None. Reserved for future use.
    80     }
    83     }
    81 
    84 
    82 
    85 
    83 // -----------------------------------------------------------------------------
    86 // -----------------------------------------------------------------------------
    89         (
    92         (
    90         CSatMessHandler*    aSatMessHandler,
    93         CSatMessHandler*    aSatMessHandler,
    91         CTsySatMessaging*   aSatMessaging
    94         CTsySatMessaging*   aSatMessaging
    92         )
    95         )
    93     {
    96     {
    94     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_NEWL, "CSatEventDownload::NewL" );
    97     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_NEWL_TD, "CSatEventDownload::NewL" );
    95     TFLOGSTRING("TSY: CSatEventDownload::NewL");
    98     TFLOGSTRING("TSY: CSatEventDownload::NewL");
    96 
    99 
    97     CSatEventDownload* self =
   100     CSatEventDownload* self =
    98         new( ELeave ) CSatEventDownload( aSatMessHandler, aSatMessaging );
   101         new( ELeave ) CSatEventDownload( aSatMessHandler, aSatMessaging );
    99 
   102 
   110 // C++ destructor
   113 // C++ destructor
   111 // -----------------------------------------------------------------------------
   114 // -----------------------------------------------------------------------------
   112 //
   115 //
   113 CSatEventDownload::~CSatEventDownload()
   116 CSatEventDownload::~CSatEventDownload()
   114     {
   117     {
   115     OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_CSATEVENTDOWNLOAD, "CSatEventDownload::~CSatEventDownload" );
   118     OstTrace0( TRACE_NORMAL,  DUP1_CSATEVENTDOWNLOAD_CSATEVENTDOWNLOAD_TD, "CSatEventDownload::~CSatEventDownload" );
   116     TFLOGSTRING("TSY: CSatEventDownload::~CSatEventDownload");
   119     TFLOGSTRING("TSY: CSatEventDownload::~CSatEventDownload");
   117     }
   120     }
   118 
   121 
   119 
   122 
   120 // -----------------------------------------------------------------------------
   123 // -----------------------------------------------------------------------------
   122 // Generate transaction id for ISI message
   125 // Generate transaction id for ISI message
   123 // -----------------------------------------------------------------------------
   126 // -----------------------------------------------------------------------------
   124 //
   127 //
   125 TUint8 CSatEventDownload::GetTransactionId()
   128 TUint8 CSatEventDownload::GetTransactionId()
   126     {
   129     {
   127     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_GETTRANSACTIONID, "CSatEventDownload::GetTransactionId" );
   130     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_GETTRANSACTIONID_TD, "CSatEventDownload::GetTransactionId" );
   128     TFLOGSTRING("TSY: CSatEventDownload::GetTransactionId");
   131     TFLOGSTRING("TSY: CSatEventDownload::GetTransactionId");
   129     return iSatMessaging->GetTransactionId();
   132     return iSatMessaging->GetTransactionId();
   130     }
   133     }
   131 
   134 
   132 // -----------------------------------------------------------------------------
   135 // -----------------------------------------------------------------------------
   137 void CSatEventDownload::SetUpEventList
   140 void CSatEventDownload::SetUpEventList
   138         (
   141         (
   139         TUint32 aEvents        // bit mask of enabled events
   142         TUint32 aEvents        // bit mask of enabled events
   140         )
   143         )
   141     {
   144     {
   142     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SETUPEVENTLIST, "CSatEventDownload::SetUpEventList" );
   145     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SETUPEVENTLIST_TD, "CSatEventDownload::SetUpEventList" );
   143     TFLOGSTRING("TSY: CSatEventDownload::SetUpEventList");
   146     TFLOGSTRING("TSY: CSatEventDownload::SetUpEventList");
   144     iEventList.Set( aEvents );
   147     iEventList.Set( aEvents );
   145 
   148 
   146     // Force sending of envelope at least once, if location status event set
   149     // Force sending of envelope at least once, if location status event set
   147     if ( iEventList.IsEnabled( RSat::KLocationStatus ) )
   150     if ( iEventList.IsEnabled( RSat::KLocationStatus ) )
   165         TUint8 aTransactionId,                 // Transaction Identifier
   168         TUint8 aTransactionId,                 // Transaction Identifier
   166         const TDesC8& aDiallingNumber,         // Calling Party BCD number
   169         const TDesC8& aDiallingNumber,         // Calling Party BCD number
   167         const TDesC8& aCalledPartySubAddress   // Calling Party Subaddress
   170         const TDesC8& aCalledPartySubAddress   // Calling Party Subaddress
   168         )
   171         )
   169     {
   172     {
   170     OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDMTCALLENVELOPE, "CSatEventDownload::SendMTCallEnvelope (transactionId=%hhu)", aTransactionId );
   173     OstTraceExt1( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDMTCALLENVELOPE_TD, "CSatEventDownload::SendMTCallEnvelope (transactionId=%hhu)", aTransactionId );
   171     TFLOGSTRING2("TSY: CSatEventDownload::SendMTCallEnvelope\
   174     TFLOGSTRING2("TSY: CSatEventDownload::SendMTCallEnvelope\
   172         (transactionId=%d)", TInt( aTransactionId ) );
   175         (transactionId=%d)", TInt( aTransactionId ) );
   173 
   176 
   174     TInt ret( KErrNone );
   177     TInt ret( KErrNone );
   175 
   178 
   219         (
   222         (
   220         TUint8 aTransactionId, // Transaction Identifier in the CONNECT message.
   223         TUint8 aTransactionId, // Transaction Identifier in the CONNECT message.
   221         TBool aNearEnd
   224         TBool aNearEnd
   222         )
   225         )
   223     {
   226     {
   224     OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCALLCONNECTEDENVELOPE, "CSatEventDownload::SendCallConnectedEnvelope (transactionId=%hhu)", aTransactionId );
   227     OstTraceExt1( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDCALLCONNECTEDENVELOPE_TD, "CSatEventDownload::SendCallConnectedEnvelope (transactionId=%hhu)", aTransactionId );
   225     TFLOGSTRING2("TSY: CSatEventDownload::SendCallConnectedEnvelope\
   228     TFLOGSTRING2("TSY: CSatEventDownload::SendCallConnectedEnvelope\
   226         (transactionId=%d)", TInt( aTransactionId ) );
   229         (transactionId=%d)", TInt( aTransactionId ) );
   227 
   230 
   228     TInt ret( KErrNone );
   231     TInt ret( KErrNone );
   229 
   232 
   272         TBool aNearEnd,
   275         TBool aNearEnd,
   273         TBool aCauseGiven,
   276         TBool aCauseGiven,
   274         const TDesC8& aCause
   277         const TDesC8& aCause
   275         )
   278         )
   276     {
   279     {
   277     OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCALLDISCONNECTEDENVELOPE, "CSatEventDownload::SendCallDisconnectedEnvelope (transactionId=%hhu)", aTransactionId );
   280     OstTraceExt1( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDCALLDISCONNECTEDENVELOPE_TD, "CSatEventDownload::SendCallDisconnectedEnvelope (transactionId=%hhu)", aTransactionId );
   278     TFLOGSTRING2("TSY: CSatEventDownload::SendCallDisconnectedEnvelope\
   281     TFLOGSTRING2("TSY: CSatEventDownload::SendCallDisconnectedEnvelope\
   279         (transactionId=%d)", TInt( aTransactionId ) );
   282         (transactionId=%d)", TInt( aTransactionId ) );
   280 
   283 
   281     TInt ret( KErrNone );
   284     TInt ret( KErrNone );
   282 
   285 
   319 TInt CSatEventDownload::SendLocationStatusEnvelope
   322 TInt CSatEventDownload::SendLocationStatusEnvelope
   320         (
   323         (
   321         const CSatMessHandler::TLocationInfo& aNewLocInfo
   324         const CSatMessHandler::TLocationInfo& aNewLocInfo
   322         )
   325         )
   323     {
   326     {
   324     OstTrace1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE, "CSatEventDownload::SendLocationStatusEnvelope locationStatus = %d", aNewLocInfo.iRegStatus );
   327     OstTrace1( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE_TD, "CSatEventDownload::SendLocationStatusEnvelope locationStatus = %d", aNewLocInfo.iRegStatus );
   325     TFLOGSTRING2("TSY: CSatEventDownload::SendLocationStatusEnvelope \
   328     TFLOGSTRING2("TSY: CSatEventDownload::SendLocationStatusEnvelope \
   326         locationStatus = %d", TInt( aNewLocInfo.iRegStatus ) );
   329         locationStatus = %d", TInt( aNewLocInfo.iRegStatus ) );
   327 
   330 
   328     TInt ret( KErrNone );
   331     TInt ret( KErrNone );
   329 
   332 
   335       || ( iLocInfo.iCellId       != aNewLocInfo.iCellId )
   338       || ( iLocInfo.iCellId       != aNewLocInfo.iCellId )
   336       || iForceLocationStatusEnvelope )
   339       || iForceLocationStatusEnvelope )
   337         {
   340         {
   338         TFLOGSTRING("TSY: CSatEventDownload::SendLocationStatusEnvelope \
   341         TFLOGSTRING("TSY: CSatEventDownload::SendLocationStatusEnvelope \
   339             Saving and sending");
   342             Saving and sending");
   340         OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE, "CSatEventDownload::SendLocationStatusEnvelope Saving and sending" );
   343         OstTrace0( TRACE_NORMAL,  DUP1_CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE_TD, "CSatEventDownload::SendLocationStatusEnvelope Saving and sending" );
   341 
   344 
   342         // Cache values
   345         // Cache values
   343         iLocInfo = aNewLocInfo;
   346         iLocInfo = aNewLocInfo;
   344 
   347 
   345         // Create envelope
   348         // Create envelope
   395         }
   398         }
   396     else
   399     else
   397         {
   400         {
   398         TFLOGSTRING("TSY: CSatEventDownload::SendLocationStatusEnvelope \
   401         TFLOGSTRING("TSY: CSatEventDownload::SendLocationStatusEnvelope \
   399             Location Info already received, envelope sending omitted.");
   402             Location Info already received, envelope sending omitted.");
   400         OstTrace0( TRACE_NORMAL, DUP2_CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE, "CSatEventDownload::SendLocationStatusEnvelope Location Info already received, envelope sending omitted." );
   403         OstTrace0( TRACE_NORMAL,  DUP2_CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE_TD, "CSatEventDownload::SendLocationStatusEnvelope Location Info already received, envelope sending omitted." );
   401 
   404 
   402         }
   405         }
   403 
   406 
   404     iLocationStatusEnvelopePending = EFalse;
   407     iLocationStatusEnvelopePending = EFalse;
   405 
   408 
   411 // Send user activity envelope to USIM
   414 // Send user activity envelope to USIM
   412 // -----------------------------------------------------------------------------
   415 // -----------------------------------------------------------------------------
   413 //
   416 //
   414 TInt CSatEventDownload::SendUserActivityEnvelope()
   417 TInt CSatEventDownload::SendUserActivityEnvelope()
   415     {
   418     {
   416     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDUSERACTIVITYENVELOPE, "CSatEventDownload::SendUserActivityEnvelope" );
   419     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDUSERACTIVITYENVELOPE_TD, "CSatEventDownload::SendUserActivityEnvelope" );
   417     TFLOGSTRING("TSY: CSatEventDownload::SendUserActivityEnvelope");
   420     TFLOGSTRING("TSY: CSatEventDownload::SendUserActivityEnvelope");
   418 
   421 
   419     TInt ret = KErrNone;
   422     TInt ret = KErrNone;
   420 
   423 
   421     if ( iEventList.IsEnabled(RSat::KUserActivity) )
   424     if ( iEventList.IsEnabled(RSat::KUserActivity) )
   449 // Send idle screeen available event to USIM
   452 // Send idle screeen available event to USIM
   450 // -----------------------------------------------------------------------------
   453 // -----------------------------------------------------------------------------
   451 //
   454 //
   452 TInt CSatEventDownload::SendIdleScreenAvailableEnvelope()
   455 TInt CSatEventDownload::SendIdleScreenAvailableEnvelope()
   453     {
   456     {
   454     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDIDLESCREENAVAILABLEENVELOPE, "CSatEventDownload::SendIdleScreenAvailableEnvelope" );
   457     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDIDLESCREENAVAILABLEENVELOPE_TD, "CSatEventDownload::SendIdleScreenAvailableEnvelope" );
   455     TFLOGSTRING("TSY: CSatEventDownload::SendIdleScreenAvailableEnvelope");
   458     TFLOGSTRING("TSY: CSatEventDownload::SendIdleScreenAvailableEnvelope");
   456 
   459 
   457     TInt ret = KErrNone;
   460     TInt ret = KErrNone;
   458 
   461 
   459     if ( iEventList.IsEnabled( RSat::KIdleScreenAvailable ) )
   462     if ( iEventList.IsEnabled( RSat::KIdleScreenAvailable ) )
   493 TInt CSatEventDownload::SendBrowserTerminationEnvelope
   496 TInt CSatEventDownload::SendBrowserTerminationEnvelope
   494         (
   497         (
   495         RSat::TBrowserTerminationCause aCause
   498         RSat::TBrowserTerminationCause aCause
   496         )
   499         )
   497     {
   500     {
   498     OstTrace1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDBROWSERTERMINATIONENVELOPE, "CSatEventDownload::SendBrowserTerminationEnvelope (cause=%d)", TInt(aCause) );
   501     OstTrace1( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDBROWSERTERMINATIONENVELOPE_TD, "CSatEventDownload::SendBrowserTerminationEnvelope (cause=%d)", TInt(aCause) );
   499     TFLOGSTRING2("TSY: CSatEventDownload::SendBrowserTerminationEnvelope\
   502     TFLOGSTRING2("TSY: CSatEventDownload::SendBrowserTerminationEnvelope\
   500         (cause=%d)", TInt( aCause ) );
   503         (cause=%d)", TInt( aCause ) );
   501 
   504 
   502     TInt ret = KErrNone;
   505     TInt ret = KErrNone;
   503 
   506 
   538 TInt CSatEventDownload::SendLanguageSelectionEnvelope
   541 TInt CSatEventDownload::SendLanguageSelectionEnvelope
   539         (
   542         (
   540         TUint16 aLanguage
   543         TUint16 aLanguage
   541         )
   544         )
   542     {
   545     {
   543     OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDLANGUAGESELECTIONENVELOPE, "CSatEventDownload::SendLanguageSelectionEnvelope (language=%hu)", aLanguage );
   546     OstTraceExt1( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDLANGUAGESELECTIONENVELOPE_TD, "CSatEventDownload::SendLanguageSelectionEnvelope (language=%hu)", aLanguage );
   544     TFLOGSTRING2("TSY: CSatEventDownload::SendLanguageSelectionEnvelope\
   547     TFLOGSTRING2("TSY: CSatEventDownload::SendLanguageSelectionEnvelope\
   545         (language=%d)", TInt ( aLanguage ) );
   548         (language=%d)", TInt ( aLanguage ) );
   546 
   549 
   547     TInt ret = KErrNone;
   550     TInt ret = KErrNone;
   548 
   551 
   583         (
   586         (
   584         const TTsyReqHandle aTsyReqHandle,
   587         const TTsyReqHandle aTsyReqHandle,
   585         const TDataPackage& aPackage
   588         const TDataPackage& aPackage
   586         )
   589         )
   587     {
   590     {
   588     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_EXTFUNC, "CSatEventDownload::ExtFunc" );
   591     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_EXTFUNC_TD, "CSatEventDownload::ExtFunc" );
   589     TFLOGSTRING("TSY: CSatEventDownload::ExtFunc");
   592     TFLOGSTRING("TSY: CSatEventDownload::ExtFunc");
   590 
   593 
   591     TInt ret ( KErrNotSupported );
   594     TInt ret ( KErrNotSupported );
   592 
   595 
   593     // get parameters (eventList, eventInfo) from package
   596     // get parameters (eventList, eventInfo) from package
   679 TInt CSatEventDownload::Cancel
   682 TInt CSatEventDownload::Cancel
   680         (
   683         (
   681         const TTsyReqHandle /*aTsyReqHandle*/
   684         const TTsyReqHandle /*aTsyReqHandle*/
   682         )
   685         )
   683     {
   686     {
   684     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CANCEL, "CSatEventDownload::Cancel" );
   687     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_CANCEL_TD, "CSatEventDownload::Cancel" );
   685     TFLOGSTRING("TSY: CSatEventDownload::Cancel");
   688     TFLOGSTRING("TSY: CSatEventDownload::Cancel");
   686     // since event download is served at once.
   689     // since event download is served at once.
   687     // we don't have anything to do here
   690     // we don't have anything to do here
   688     return KErrNone;
   691     return KErrNone;
   689     }
   692     }
   697         (
   700         (
   698         const TIsiReceiveC& aIsiMessage  // incoming ISI message
   701         const TIsiReceiveC& aIsiMessage  // incoming ISI message
   699         )
   702         )
   700     {
   703     {
   701 TFLOGSTRING("TSY: CSatEventDownload::CallModemMessageIndReceived");
   704 TFLOGSTRING("TSY: CSatEventDownload::CallModemMessageIndReceived");
   702 OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived" );
   705 OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived" );
   703 
   706 
   704     // CALL_MODEM_SB_DETAILED_CAUSE length max value is 248
   707     // CALL_MODEM_SB_DETAILED_CAUSE length max value is 248
   705     TBuf8<KMaxCallModemDetailedCause> cause;
   708     TBuf8<KMaxCallModemDetailedCause> cause;
   706     TBool causeGiven( EFalse );
   709     TBool causeGiven( EFalse );
   707 
   710 
   751                             {
   754                             {
   752                             TInt addressLength( aIsiMessage.Get8bit(
   755                             TInt addressLength( aIsiMessage.Get8bit(
   753                                 sbStartOffset +
   756                                 sbStartOffset +
   754                                 CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDRLEN ) );
   757                                 CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDRLEN ) );
   755 
   758 
       
   759                             // According to 24.008, chapter 10.5.4.9, octet containing
       
   760                             // TON/NPI info contains also ext bit (bit8). If ext bit
       
   761                             // is 0, next octet after TON/NPI contains different
       
   762                             // kind of indicator info and it must be skipped when address
       
   763                             // data is copied. If ext is 1, address data starts right
       
   764                             // after TON/NPI octet.
       
   765                             TUint8 tonNpi( aIsiMessage.Get8bit( 
       
   766                                 sbStartOffset +
       
   767                                 CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR ) );
       
   768                             TUint8 addrIndex( KNbrIndexWithIndicatorInfo );
       
   769 
       
   770                             if( KExtMask == ( tonNpi & KExtMask ) )
       
   771                                 {
       
   772                                 // ext bit is 1, so address data starts rigth after
       
   773                                 // TON/NPI
       
   774                                 addrIndex = KNbrIndexWithoutIndicatorInfo;
       
   775                                 }
       
   776 
   756                             // Set address type (TON/NPI) in correct form
   777                             // Set address type (TON/NPI) in correct form
   757                             BCDAddress.Append( aIsiMessage.Get8bit( 
   778                             BCDAddress.Append( tonNpi | KMSBMask );
   758                                 sbStartOffset +
   779 
   759                                 CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR )
   780                             // Append BCD address. Skip TON/NPI and possible
   760                                 | KMSBMask );
   781                             // indicator information
   761                             // Append BCD address. Skip TON/NPI
       
   762                             BCDAddress.Append( aIsiMessage.GetData(
   782                             BCDAddress.Append( aIsiMessage.GetData(
   763                                 sbStartOffset +
   783                                 sbStartOffset +
   764                                 CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR + 1,
   784                                 CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR + addrIndex,
   765                                 addressLength - 1 ) );
   785                                 addressLength - addrIndex ) );
   766                             }
   786                             }
   767                         // Extract subaddress
   787                         // Extract subaddress
   768                         retValue = aIsiMessage.FindSubBlockOffsetById(
   788                         retValue = aIsiMessage.FindSubBlockOffsetById(
   769                             ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND,
   789                             ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND,
   770                             CALL_MODEM_SB_ORIGIN_SUBADDRESS,
   790                             CALL_MODEM_SB_ORIGIN_SUBADDRESS,
   780                             subAddress.Set( aIsiMessage.GetData(
   800                             subAddress.Set( aIsiMessage.GetData(
   781                                 sbStartOffset + CALL_MODEM_SB_ORIGIN_SUBADDRESS_OFFSET_ADDR,
   801                                 sbStartOffset + CALL_MODEM_SB_ORIGIN_SUBADDRESS_OFFSET_ADDR,
   782                                 subAddressLength ) );
   802                                 subAddressLength ) );
   783                             }
   803                             }
   784 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived Send MT call event" );
   804 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived Send MT call event" );
   785 OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Send MT call event" );
   805 OstTrace0( TRACE_NORMAL,  DUP1_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived Send MT call event" );
   786 
   806 
   787                         SendMTCallEnvelope( 
   807                         SendMTCallEnvelope( 
   788                             transactionId,
   808                             transactionId,
   789                             BCDAddress,
   809                             BCDAddress,
   790                             subAddress );
   810                             subAddress );
   797                 if ( iEventList.IsEnabled( RSat::KCallConnected ) )
   817                 if ( iEventList.IsEnabled( RSat::KCallConnected ) )
   798                     {
   818                     {
   799                     if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection )
   819                     if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection )
   800                         {
   820                         {
   801 TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Creating a call");
   821 TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Creating a call");
   802 OstTrace0( TRACE_NORMAL, DUP2_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Creating a call" );
   822 OstTrace0( TRACE_NORMAL,  DUP2_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived Creating a call" );
   803 
   823 
   804                         SendCallConnectedEnvelope(
   824                         SendCallConnectedEnvelope(
   805                             transactionId,
   825                             transactionId,
   806                             EFalse/*mobile originated*/ );
   826                             EFalse/*mobile originated*/ );
   807                         }
   827                         }
   808                     else if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection )
   828                     else if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection )
   809                         {
   829                         {
   810 TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Incoming call arrives");
   830 TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Incoming call arrives");
   811 OstTrace0( TRACE_NORMAL, DUP3_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Incoming call arrives" );
   831 OstTrace0( TRACE_NORMAL,  DUP3_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived Incoming call arrives" );
   812 
   832 
   813                         SendCallConnectedEnvelope(
   833                         SendCallConnectedEnvelope(
   814                             transactionId,
   834                             transactionId,
   815                             ETrue/*mobile terminated*/);
   835                             ETrue/*mobile terminated*/);
   816                         }
   836                         }
   841                     if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection )
   861                     if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection )
   842                         {
   862                         {
   843                         // 2.33.11 Event Indications on Mobile Originated Call
   863                         // 2.33.11 Event Indications on Mobile Originated Call
   844                         // Clearing (GSM)
   864                         // Clearing (GSM)
   845 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MO call clearing ");
   865 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MO call clearing ");
   846 OstTrace0( TRACE_NORMAL, DUP4_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived MO call clearing" );
   866 OstTrace0( TRACE_NORMAL,  DUP4_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived MO call clearing" );
   847 
   867 
   848                         SendCallDisconnectedEnvelope(
   868                         SendCallDisconnectedEnvelope(
   849                             transactionId,
   869                             transactionId,
   850                             ETrue/*near end*/,
   870                             ETrue/*near end*/,
   851                             causeGiven,
   871                             causeGiven,
   854                     else if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection )
   874                     else if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection )
   855                         {
   875                         {
   856                         // 2.33.12 Event indications on Mobile Terminated Call
   876                         // 2.33.12 Event indications on Mobile Terminated Call
   857                         // Clearing (GSM)
   877                         // Clearing (GSM)
   858 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MT call clearing");
   878 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MT call clearing");
   859 OstTrace0( TRACE_NORMAL, DUP7_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived MT call clearing" );
   879 OstTrace0( TRACE_NORMAL,  DUP7_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived MT call clearing" );
   860 
   880 
   861                         SendCallDisconnectedEnvelope(
   881                         SendCallDisconnectedEnvelope(
   862                             transactionId,
   882                             transactionId,
   863                             EFalse/*far end*/,
   883                             EFalse/*far end*/,
   864                             causeGiven,
   884                             causeGiven,
   866                         }
   886                         }
   867                     else if ( CALL_MODEM_MSG_DIRECT_INTERNAL == messageDirection )
   887                     else if ( CALL_MODEM_MSG_DIRECT_INTERNAL == messageDirection )
   868                         {
   888                         {
   869                         // 2.33.13 Event indications on radio link failure
   889                         // 2.33.13 Event indications on radio link failure
   870 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived radiolink failure");
   890 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived radiolink failure");
   871 OstTrace0( TRACE_NORMAL, DUP5_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Radiolink failure" );
   891 OstTrace0( TRACE_NORMAL,  DUP5_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived Radiolink failure" );
   872                         // In the case of a radio link timeout, the Cause data
   892                         // In the case of a radio link timeout, the Cause data
   873                         // object shall be included, with a value part of zero
   893                         // object shall be included, with a value part of zero
   874                         // length.
   894                         // length.
   875                         causeGiven = ETrue;
   895                         causeGiven = ETrue;
   876                         cause.Zero();
   896                         cause.Zero();
   884                 break;
   904                 break;
   885                 }
   905                 }
   886             default:
   906             default:
   887                 {
   907                 {
   888 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" );
   908 TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" );
   889 OstTrace0( TRACE_NORMAL, DUP6_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" );
   909 OstTrace0( TRACE_NORMAL,  DUP6_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED_TD, "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" );
   890                 // do nothing
   910                 // do nothing
   891                 break;
   911                 break;
   892                 }
   912                 }
   893             }
   913             }
   894         }
   914         }
   903         (
   923         (
   904         RSat::TChannelStatus aStatus,    // Status of the channel
   924         RSat::TChannelStatus aStatus,    // Status of the channel
   905         TInt8                 aLength     // Channel data length
   925         TInt8                 aLength     // Channel data length
   906         )
   926         )
   907     {
   927     {
   908     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDDATAAVAILABLEENVELOPE, "CSatEventDownload::SendDataAvailableEnvelope" );
   928     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDDATAAVAILABLEENVELOPE_TD, "CSatEventDownload::SendDataAvailableEnvelope" );
   909     TFLOGSTRING( "TSY: CSatEventDownload::SendDataAvailableEnvelope" );
   929     TFLOGSTRING( "TSY: CSatEventDownload::SendDataAvailableEnvelope" );
   910 
   930 
   911     TInt ret = KErrNone;
   931     TInt ret = KErrNone;
   912 
   932 
   913     if ( iEventList.IsEnabled( RSat::KDataAvailable ) )
   933     if ( iEventList.IsEnabled( RSat::KDataAvailable ) )
   949 TInt CSatEventDownload::SendChannelStatusEnvelope
   969 TInt CSatEventDownload::SendChannelStatusEnvelope
   950         (
   970         (
   951         RSat::TChannelStatus aStatus    // Status of the channel
   971         RSat::TChannelStatus aStatus    // Status of the channel
   952         )
   972         )
   953     {
   973     {
   954     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCHANNELSTATUSENVELOPE, "CSatEventDownload::SendChannelStatusEnvelope" );
   974     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDCHANNELSTATUSENVELOPE_TD, "CSatEventDownload::SendChannelStatusEnvelope" );
   955     TFLOGSTRING("TSY: CSatEventDownload::SendChannelStatusEnvelope");
   975     TFLOGSTRING("TSY: CSatEventDownload::SendChannelStatusEnvelope");
   956 
   976 
   957     TInt ret = KErrNone;
   977     TInt ret = KErrNone;
   958 
   978 
   959     if ( iEventList.IsEnabled( RSat::KChannelStatus ) )
   979     if ( iEventList.IsEnabled( RSat::KChannelStatus ) )
   994 TInt CSatEventDownload::MessageReceived
  1014 TInt CSatEventDownload::MessageReceived
   995         (
  1015         (
   996         const TIsiReceiveC& aIsiMessage
  1016         const TIsiReceiveC& aIsiMessage
   997         )
  1017         )
   998     {
  1018     {
   999     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_MESSAGERECEIVED, "CSatEventDownload::MessageReceived" );
  1019     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_MESSAGERECEIVED_TD, "CSatEventDownload::MessageReceived" );
  1000     TFLOGSTRING("TSY: CSatEventDownload::MessageReceived");
  1020     TFLOGSTRING("TSY: CSatEventDownload::MessageReceived");
  1001     // Get resource and message id's
  1021     // Get resource and message id's
  1002     TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) );
  1022     TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) );
  1003     TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) );
  1023     TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) );
  1004 
  1024 
  1097 void CSatEventDownload::SetSetUpCallStatus
  1117 void CSatEventDownload::SetSetUpCallStatus
  1098         (
  1118         (
  1099         const TBool aStatus // SetUpCall status
  1119         const TBool aStatus // SetUpCall status
  1100         )
  1120         )
  1101     {
  1121     {
  1102     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SETSETUPCALLSTATUS, "CSatEventDownload::SetSetUpCallStatus" );
  1122     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SETSETUPCALLSTATUS_TD, "CSatEventDownload::SetSetUpCallStatus" );
  1103     TFLOGSTRING("TSY: CSatEventDownload::SetSetUpCallStatus");
  1123     TFLOGSTRING("TSY: CSatEventDownload::SetSetUpCallStatus");
  1104     iSetUpCallOngoing = aStatus;
  1124     iSetUpCallOngoing = aStatus;
  1105     }
  1125     }
  1106 
  1126 
  1107 // -----------------------------------------------------------------------------
  1127 // -----------------------------------------------------------------------------
  1112 TInt CSatEventDownload::SendAccessTechnologyChangeEnvelope
  1132 TInt CSatEventDownload::SendAccessTechnologyChangeEnvelope
  1113         (
  1133         (
  1114         TUint8  accTechChange //Acc Tech
  1134         TUint8  accTechChange //Acc Tech
  1115         )
  1135         )
  1116     {
  1136     {
  1117     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE, "CSatEventDownload::SendAccessTechnologyChangeEnvelope" );
  1137     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE_TD, "CSatEventDownload::SendAccessTechnologyChangeEnvelope" );
  1118     TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope");
  1138     TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope");
  1119 
  1139 
  1120     TInt ret = KErrNone;
  1140     TInt ret = KErrNone;
  1121 
  1141 
  1122     if ( iEventList.IsEnabled( RSat::KAccessTechnologyChange ) )
  1142     if ( iEventList.IsEnabled( RSat::KAccessTechnologyChange ) )
  1123         {
  1143         {
  1124         TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope\
  1144         TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope\
  1125         - Event enabled: sending envelope");
  1145         - Event enabled: sending envelope");
  1126         OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE, "CSatEventDownload::SendAccessTechnologyChangeEnvelope - Event enabled: sending envelope" );
  1146         OstTrace0( TRACE_NORMAL,  DUP1_CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE_TD, "CSatEventDownload::SendAccessTechnologyChangeEnvelope - Event enabled: sending envelope" );
  1127         // create envelope
  1147         // create envelope
  1128         TTlv envelope;
  1148         TTlv envelope;
  1129         envelope.Begin  ( KBerTlvEventDownloadTag );
  1149         envelope.Begin  ( KBerTlvEventDownloadTag );
  1130 
  1150 
  1131         // event list
  1151         // event list
  1157 //
  1177 //
  1158 #ifdef INFO_PP_ENHANCED_NETWORK_SELECTION
  1178 #ifdef INFO_PP_ENHANCED_NETWORK_SELECTION
  1159 TInt CSatEventDownload::ForceLocationStatusEnvelope()
  1179 TInt CSatEventDownload::ForceLocationStatusEnvelope()
  1160     {
  1180     {
  1161     TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope");
  1181     TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope");
  1162     OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE, "CSatEventDownload::ForceLocationStatusEnvelope" );
  1182     OstTrace0( TRACE_NORMAL,  CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE_TD, "CSatEventDownload::ForceLocationStatusEnvelope" );
  1163 
  1183 
  1164     TInt ret( KErrNone );
  1184     TInt ret( KErrNone );
  1165     if ( iEventList.IsEnabled( RSat::KLocationStatus )
  1185     if ( iEventList.IsEnabled( RSat::KLocationStatus )
  1166         && iSatMessHandler->EnsSupported()
  1186         && iSatMessHandler->EnsSupported()
  1167         && iNetCellInfoIndReceived )
  1187         && iNetCellInfoIndReceived )
  1168         {
  1188         {
  1169         TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP");
  1189         TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP");
  1170         OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE, "CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP" );
  1190         OstTrace0( TRACE_NORMAL,  DUP1_CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE_TD, "CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP" );
  1171         ret = SendLocationStatusEnvelope( 
  1191         ret = SendLocationStatusEnvelope( 
  1172             iSatMessHandler->LocationInfo() );
  1192             iSatMessHandler->LocationInfo() );
  1173         }
  1193         }
  1174     return ret;
  1194     return ret;
  1175     }
  1195     }