adaptationlayer/tsy/simatktsy_dll/src/satmesshandler.cpp
changeset 8 6295dc2169f3
parent 5 8ccc39f9d787
child 9 8486d82aef45
equal deleted inserted replaced
7:fa67e03b87df 8:6295dc2169f3
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   266 
   266 
   267     // handle Data Download and related messages
   267     // handle Data Download and related messages
   268     iTsySatMessaging->DataDownloadReceivedL( aIsiMessage );
   268     iTsySatMessaging->DataDownloadReceivedL( aIsiMessage );
   269 
   269 
   270     // handle MO-SMS Control related messages
   270     // handle MO-SMS Control related messages
   271     iTsySatMessaging->MoSmsControlReceived( aIsiMessage );
   271     iTsySatMessaging->MoSmsControlReceivedL( aIsiMessage );
   272     }
   272     }
   273 
   273 
   274 // -----------------------------------------------------------------------------
   274 // -----------------------------------------------------------------------------
   275 // CSatMessHandler::NetServerMessageReceived
   275 // CSatMessHandler::NetServerMessageReceived
   276 // Called from SatMessHandler::ReceivedL, handles Net Server related messages
   276 // Called from SatMessHandler::ReceivedL, handles Net Server related messages
   315             break;
   315             break;
   316             }
   316             }
   317         case NET_TIME_IND:
   317         case NET_TIME_IND:
   318             {
   318             {
   319             NetTimeInd( aIsiMessage );
   319             NetTimeInd( aIsiMessage );
   320             break;
       
   321             }
       
   322         case NET_RAT_RESP:
       
   323             {
       
   324             NetRatResp( aIsiMessage );
       
   325             break;
   320             break;
   326             }
   321             }
   327         case NET_RAT_IND:
   322         case NET_RAT_IND:
   328             {
   323             {
   329             NetRatInd( aIsiMessage );
   324             NetRatInd( aIsiMessage );
  1539 // -----------------------------------------------------------------------------
  1534 // -----------------------------------------------------------------------------
  1540 // CSatMessHandler::StoreNetServiceStatus
  1535 // CSatMessHandler::StoreNetServiceStatus
  1541 // Stores location information and network service status
  1536 // Stores location information and network service status
  1542 // -----------------------------------------------------------------------------
  1537 // -----------------------------------------------------------------------------
  1543 //
  1538 //
  1544 void CSatMessHandler::StoreNetServiceStatus
  1539 TInt CSatMessHandler::StoreNetServiceStatus
  1545         (
  1540         (
  1546         const TIsiReceiveC& aIsiMessage
  1541         const TIsiReceiveC& aIsiMessage
  1547         )
  1542         )
  1548     {
  1543     {
  1549     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus" );
  1544 OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus" );
  1550     TFLOGSTRING("TSY: CSatMessHandler::StoreNetServiceStatus");
  1545 TFLOGSTRING("TSY: CSatMessHandler::StoreNetServiceStatus");
  1551 
  1546 
  1552     // SubBlock offset
  1547     // SubBlock offset
  1553     TUint sbOffset( 0 );
  1548     TUint sbOffset( 0 );
  1554 
  1549 
  1555     TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) );
  1550     TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) );
  1556 
  1551 
  1557     TInt headerSize( KErrNotFound );
  1552     TInt headerSize( KErrNotFound );
       
  1553 
       
  1554     TInt retValue( KErrNone );
  1558 
  1555 
  1559     if ( NET_CELL_INFO_IND == messageId )
  1556     if ( NET_CELL_INFO_IND == messageId )
  1560         {
  1557         {
  1561         headerSize = SIZE_NET_CELL_INFO_IND;
  1558         headerSize = SIZE_NET_CELL_INFO_IND;
  1562         }
  1559         }
  1593 
  1590 
  1594             // Get registration status value
  1591             // Get registration status value
  1595             iLocInfo.iRegStatus = aIsiMessage.Get8bit(
  1592             iLocInfo.iRegStatus = aIsiMessage.Get8bit(
  1596                 sbOffset + NET_GSM_CELL_INFO_OFFSET_SERVICESTATUS );
  1593                 sbOffset + NET_GSM_CELL_INFO_OFFSET_SERVICESTATUS );
  1597 
  1594 
  1598             TFLOGSTRING2("TSY: CSatMessHandler::StoreNetServiceStatus: \
  1595 TFLOGSTRING2("TSY: CSatMessHandler::StoreNetServiceStatus: NET_REGISTRATION_STATUS = %d", iLocInfo.iRegStatus );
  1599                 NET_REGISTRATION_STATUS = %d", iLocInfo.iRegStatus );
  1596 OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus NET_REGISTRATION_STATUS = %d", iLocInfo.iRegStatus );
  1600             OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus NET_REGISTRATION_STATUS = %d", iLocInfo.iRegStatus );
       
  1601 
  1597 
  1602             if ( NET_SERVICE == iLocInfo.iRegStatus ||
  1598             if ( NET_SERVICE == iLocInfo.iRegStatus ||
  1603                 NET_LIMITED_SERVICE == iLocInfo.iRegStatus )
  1599                 NET_LIMITED_SERVICE == iLocInfo.iRegStatus )
  1604                 {
  1600                 {
  1605                 // Get country code
  1601                 // Get country code
  1637                     }
  1633                     }
  1638                 }
  1634                 }
  1639             }
  1635             }
  1640         else
  1636         else
  1641             {
  1637             {
  1642             TFLOGSTRING("TSY: CSatMessHandler::StoreNetServiceStatus \
  1638 TFLOGSTRING("TSY: CSatMessHandler::StoreNetServiceStatus - NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO not found!");
  1643                 NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO not found!");
  1639 OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO not found!" );
  1644             OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO not found!" );
  1640 
       
  1641             retValue = KErrNotFound;
  1645             }
  1642             }
  1646         }
  1643         }
  1647     else
  1644     else
  1648         {
  1645         {
  1649         TFLOGSTRING2("TSY: CSatMessHandler::StoreNetServiceStatus \
  1646 TFLOGSTRING2("TSY: CSatMessHandler::StoreNetServiceStatus - Unexpected message id: %d", messageId );
  1650             Unexpected message id: %d", messageId );
  1647 OstTrace1( TRACE_NORMAL, DUP3_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus Unexpected message id: %d", messageId );
  1651         OstTrace1( TRACE_NORMAL, DUP3_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus Unexpected message id: %d", messageId );
  1648 
  1652         }
  1649         retValue = KErrNotFound;
       
  1650         }
       
  1651 
       
  1652     return retValue;
  1653     }
  1653     }
  1654 
  1654 
  1655 // -----------------------------------------------------------------------------
  1655 // -----------------------------------------------------------------------------
  1656 // CSatMessHandler::SetUpEventListTerminalResp
  1656 // CSatMessHandler::SetUpEventListTerminalResp
  1657 // Constructs Setup EventList and calls
  1657 // Constructs Setup EventList and calls
  2076     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETNEIGHBOURCELLRESP, "CSatMessHandler::NetNeighbourCellResp" );
  2076     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETNEIGHBOURCELLRESP, "CSatMessHandler::NetNeighbourCellResp" );
  2077     TFLOGSTRING("TSY:CSatMessHandler::NetNeighbourCellResp");
  2077     TFLOGSTRING("TSY:CSatMessHandler::NetNeighbourCellResp");
  2078 
  2078 
  2079     TUint8 result( RSat::KSuccess );
  2079     TUint8 result( RSat::KSuccess );
  2080 
  2080 
  2081     if ( iTsySatMessaging->GetNotifyLocalInfo()->Status() )
  2081     if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() )
  2082         {
  2082         {
  2083         // Provide local info proactive command is ongoing
  2083         // Provide local info proactive command is ongoing
  2084 
  2084 
  2085         // Subblock offset
  2085         // Subblock offset
  2086         TUint sbOffset( 0 );
  2086         TUint sbOffset( 0 );
  2190                 commandDetails,
  2190                 commandDetails,
  2191                 RSat::KMeUnableToProcessCmd,
  2191                 RSat::KMeUnableToProcessCmd,
  2192                 additionalInfo );
  2192                 additionalInfo );
  2193             }
  2193             }
  2194         // Clear local info flag
  2194         // Clear local info flag
  2195         iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
  2195         iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue );
  2196         }
  2196         }
  2197     }
  2197     }
  2198 
  2198 
  2199 
  2199 
  2200 // -----------------------------------------------------------------------------
  2200 // -----------------------------------------------------------------------------
  3053 void CSatMessHandler::NetCellInfoGetResp
  3053 void CSatMessHandler::NetCellInfoGetResp
  3054         (
  3054         (
  3055         const TIsiReceiveC& aIsiMessage
  3055         const TIsiReceiveC& aIsiMessage
  3056         )
  3056         )
  3057     {
  3057     {
  3058     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETCELLINFOGETRESP, "CSatMessHandler::NetCellInfoGetResp" );
  3058 OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETCELLINFOGETRESP, "CSatMessHandler::NetCellInfoGetResp" );
  3059     TFLOGSTRING("TSY: CSatMessHandler::NetCellInfoGetResp");
  3059 TFLOGSTRING("TSY: CSatMessHandler::NetCellInfoGetResp");
       
  3060 
       
  3061     TUint8 successCode( aIsiMessage.Get8bit(
       
  3062         ISI_HEADER_SIZE + NET_CELL_INFO_GET_RESP_OFFSET_SUCCESSCODE ) );
  3060 
  3063 
  3061     TBuf<1> additionalInfo;
  3064     TBuf<1> additionalInfo;
       
  3065     additionalInfo.Zero();
  3062 
  3066 
  3063     // Default result
  3067     // Default result
  3064     TUint8 result( RSat::KMeUnableToProcessCmd );
  3068     TUint8 result( RSat::KMeUnableToProcessCmd );
  3065 
  3069 
  3066     // Store recieved network parameters
  3070     // Store recieved network parameters
  3067     StoreNetServiceStatus( aIsiMessage );
  3071     TInt retValue( StoreNetServiceStatus( aIsiMessage ) );
  3068 
  3072 
  3069     switch ( iLocInfo.iRegStatus )
  3073     if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoAccTechStatus() )
  3070         {
  3074         {
  3071         case NET_SERVICE:
  3075         if ( NET_CAUSE_OK == successCode )
  3072             {
  3076             {
  3073             result = RSat::KSuccess;
  3077             if ( KErrNone == retValue )
  3074             break;
  3078                 {
  3075             }
  3079                 if ( NET_SERVICE == iLocInfo.iRegStatus
  3076         case NET_LIMITED_SERVICE:
  3080                     || NET_LIMITED_SERVICE == iLocInfo.iRegStatus )
  3077             {
  3081                     {
  3078             result = RSat::KSuccessLimitedService;
  3082                     result = RSat::KSuccess;
  3079             break;
  3083                     }
  3080             }
  3084                 else
  3081         case NET_NO_COVERAGE:
  3085                     {
  3082             {
  3086                     // No service.
  3083             // Default result value already set
  3087                     additionalInfo.Append( RSat::KNoService );
  3084             additionalInfo.Append( RSat::KNoService );
  3088                     }
  3085             break;
  3089                 }
  3086             }
  3090                 // No else, result already set.
  3087         default:
  3091             }
  3088             {
  3092             // No else, result already set.
  3089             // Default result value already set
  3093 
  3090             TFLOGSTRING2("TSY: CSatMessHandler::NetCellInfoGetResp, Unexpected iRegStatus: %d", iLocInfo.iRegStatus );
  3094         // Clear local info access technology flag
  3091             OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETCELLINFOGETRESP, "CSatMessHandler::NetCellInfoGetResp Unexpected iRegStatus: %d", iLocInfo.iRegStatus );
  3095         iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoAccTechStatus( ETrue );
  3092             additionalInfo.Append( RSat::KNoSpecificMeProblem );
  3096         }
  3093             break;
  3097     else
       
  3098         {
       
  3099         switch ( iLocInfo.iRegStatus )
       
  3100             {
       
  3101             case NET_SERVICE:
       
  3102                 {
       
  3103                 result = RSat::KSuccess;
       
  3104                 break;
       
  3105                 }
       
  3106             case NET_LIMITED_SERVICE:
       
  3107                 {
       
  3108                 result = RSat::KSuccessLimitedService;
       
  3109                 break;
       
  3110                 }
       
  3111             case NET_NO_COVERAGE:
       
  3112                 {
       
  3113                 // Default result value already set
       
  3114                 additionalInfo.Append( RSat::KNoService );
       
  3115                 break;
       
  3116                 }
       
  3117             default:
       
  3118                 {
       
  3119                 // Default result value already set
       
  3120 TFLOGSTRING2("TSY: CSatMessHandler::NetCellInfoGetResp - Unexpected iRegStatus: %d", iLocInfo.iRegStatus );
       
  3121 OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETCELLINFOGETRESP, "CSatMessHandler::NetCellInfoGetResp Unexpected iRegStatus: %d", iLocInfo.iRegStatus );
       
  3122 
       
  3123                 additionalInfo.Append( RSat::KNoSpecificMeProblem );
       
  3124                 break;
       
  3125                 }
  3094             }
  3126             }
  3095         }
  3127         }
  3096 
  3128 
  3097     TInt trId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) );
  3129     TInt trId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) );
  3098 
  3130 
  3099     // Check if this response is for provide local info proactive command.
  3131     // Check if this response is for provide local info proactive command.
  3100     if ( iTsySatMessaging->GetNotifyLocalInfo()->Status()
  3132     if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus()
  3101         && iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId()
  3133         && iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId()
  3102             == trId )
  3134             == trId )
  3103         {
  3135         {
  3104         // Send terminal response
  3136         // Send terminal response
  3105         LocalInfoTerminalResp( iTsySatMessaging->GetNotifyLocalInfo()
  3137         LocalInfoTerminalResp(
  3106                                     ->GetTransactionId(),
  3138             iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId(),
  3107                                 iTsySatMessaging->GetNotifyLocalInfo()
  3139             iTsySatMessaging->GetNotifyLocalInfo()->GetCmdDetails(),
  3108                                     ->GetCmdDetails(),
  3140             result,
  3109                                 result,
  3141             additionalInfo );
  3110                                 additionalInfo );
  3142 
  3111         // Clear local info flag
  3143         // Clear local info flag
  3112         iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
  3144         iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue );
  3113         }
  3145         }
  3114     }
  3146     }
  3115 
  3147 
  3116 
  3148 
  3117 // -----------------------------------------------------------------------------
  3149 // -----------------------------------------------------------------------------
  3145         )
  3177         )
  3146     {
  3178     {
  3147     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICERESP, "CSatMessHandler::GssCsServiceResp" );
  3179     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICERESP, "CSatMessHandler::GssCsServiceResp" );
  3148     TFLOGSTRING("CSatMessHandler::GssCsServiceResp ");
  3180     TFLOGSTRING("CSatMessHandler::GssCsServiceResp ");
  3149 
  3181 
  3150     if ( iTsySatMessaging->GetNotifyLocalInfo()->Status() )
  3182     if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() )
  3151         {
  3183         {
  3152         TUint8 generalResult ( RSat::KSuccess );
  3184         TUint8 generalResult ( RSat::KSuccess );
  3153 
  3185 
  3154         // Provide local info proactive command is ongoing
  3186         // Provide local info proactive command is ongoing
  3155 
  3187 
  3213                                     commandDetails,
  3245                                     commandDetails,
  3214                                     generalResult,
  3246                                     generalResult,
  3215                                     additionalInfo );
  3247                                     additionalInfo );
  3216 
  3248 
  3217             // Clear local info flag
  3249             // Clear local info flag
  3218             iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
  3250             iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue );
  3219             }
  3251             }
  3220         else
  3252         else
  3221             {
  3253             {
  3222             // No service
  3254             // No service
  3223             additionalInfo.Append( RSat::KNoService );
  3255             additionalInfo.Append( RSat::KNoService );
  3224 
  3256 
  3225             // Clear local info flag
  3257             // Clear local info flag
  3226             iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
  3258             iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue );
  3227 
  3259 
  3228             // Call local info terminal response method to send
  3260             // Call local info terminal response method to send
  3229             // terminal response to the sim card.
  3261             // terminal response to the sim card.
  3230             LocalInfoTerminalResp( transId,
  3262             LocalInfoTerminalResp( transId,
  3231                                     commandDetails,
  3263                                     commandDetails,
  3246         )
  3278         )
  3247     {
  3279     {
  3248     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICEFAILRESP, "CSatMessHandler::GssCsServiceFailResp" );
  3280     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICEFAILRESP, "CSatMessHandler::GssCsServiceFailResp" );
  3249     TFLOGSTRING("CSatMessHandler::GssCsServiceFailResp ");
  3281     TFLOGSTRING("CSatMessHandler::GssCsServiceFailResp ");
  3250 
  3282 
  3251     if ( iTsySatMessaging->GetNotifyLocalInfo()->Status() )
  3283     if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() )
  3252         {
  3284         {
  3253         if ( GSS_ATK_TIMING_ADVANCE_GET == aIsiMessage.Get8bit(
  3285         if ( GSS_ATK_TIMING_ADVANCE_GET == aIsiMessage.Get8bit(
  3254              ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_OPERATION ) )
  3286              ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_OPERATION ) )
  3255             {
  3287             {
  3256             TBuf<1> additionalInfo;
  3288             TBuf<1> additionalInfo;
  3270                                     commandDetails,
  3302                                     commandDetails,
  3271                                     RSat::KMeUnableToProcessCmd,
  3303                                     RSat::KMeUnableToProcessCmd,
  3272                                     additionalInfo );
  3304                                     additionalInfo );
  3273 
  3305 
  3274             // Clear local info flag
  3306             // Clear local info flag
  3275             iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
  3307             iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue );
  3276             }
  3308             }
  3277         }
  3309         }
  3278     }
  3310     }
  3279 
  3311 
  3280 // -----------------------------------------------------------------------------
  3312 // -----------------------------------------------------------------------------
  3344         // If the time zone is invalid or time zone is unknown, all bits are
  3376         // If the time zone is invalid or time zone is unknown, all bits are
  3345         // set to 1 (including B6).
  3377         // set to 1 (including B6).
  3346         iTimeZone = aIsiMessage.Get8bit( sbOffset + NET_TIME_INFO_OFFSET_TIMEZONE );
  3378         iTimeZone = aIsiMessage.Get8bit( sbOffset + NET_TIME_INFO_OFFSET_TIMEZONE );
  3347         TFLOGSTRING2("TSY: CSatMessHandler::NetTimeInd, Time zone: 0x%x", iTimeZone );
  3379         TFLOGSTRING2("TSY: CSatMessHandler::NetTimeInd, Time zone: 0x%x", iTimeZone );
  3348         OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETTIMEIND, "CSatMessHandler::NetTimeInd Time zone: %hhu", iTimeZone );
  3380         OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETTIMEIND, "CSatMessHandler::NetTimeInd Time zone: %hhu", iTimeZone );
  3349         }
       
  3350     }
       
  3351 
       
  3352 // -----------------------------------------------------------------------------
       
  3353 // CSatMessHandler::NetRatReq
       
  3354 // Constructs NET_RAT_REQ ISI message.
       
  3355 // -----------------------------------------------------------------------------
       
  3356 //
       
  3357 TInt CSatMessHandler::NetRatReq
       
  3358         (
       
  3359         TUint8 aTransId         // Transaction Id
       
  3360         )
       
  3361     {
       
  3362     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETRATREQ, "CSatMessHandler::NetRatReq" );
       
  3363     TFLOGSTRING("TSY: CSatMessHandler::NetRatReq ");
       
  3364 
       
  3365     TBuf8<1> data;
       
  3366     //we need to know the current RAT
       
  3367     data.Append( NET_CURRENT_RAT );
       
  3368 
       
  3369     return iPnSend->Send( PN_MODEM_NETWORK, aTransId, NET_RAT_REQ, data );
       
  3370     }
       
  3371 
       
  3372 // -----------------------------------------------------------------------------
       
  3373 // CSatMessHandler::NetRatResp
       
  3374 // Constructs NET_RAT_RESP ISI message.
       
  3375 // -----------------------------------------------------------------------------
       
  3376 //
       
  3377 void CSatMessHandler::NetRatResp
       
  3378         (
       
  3379         const TIsiReceiveC& aIsiMessage //received ISI message
       
  3380         )
       
  3381     {
       
  3382     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETRATRESP, "CSatMessHandler::NetRatResp" );
       
  3383     TFLOGSTRING("TSY:CSatMessHandler::NetRatResp");
       
  3384 
       
  3385     if ( iTsySatMessaging->GetNotifyLocalInfo()->Status() )
       
  3386         {
       
  3387         TBuf<1> additionalInfo;
       
  3388         additionalInfo.Zero();
       
  3389 
       
  3390         // Get transaction id
       
  3391         TUint8 transId(
       
  3392             iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId() );
       
  3393 
       
  3394         // Get command details tlv
       
  3395         TBuf8<5> commandDetails;
       
  3396         commandDetails =
       
  3397             iTsySatMessaging->GetNotifyLocalInfo()->GetCmdDetails();
       
  3398 
       
  3399         if ( NET_CAUSE_OK == aIsiMessage.Get8bit(
       
  3400             ISI_HEADER_SIZE + NET_RAT_RESP_OFFSET_SUCCESSCODE ) )
       
  3401             {
       
  3402             TUint8 generalResult ( RSat::KSuccess );
       
  3403 
       
  3404             // Subblock offset
       
  3405             TUint sbOffset( 0 );
       
  3406 
       
  3407             // Check if NET_RAT_INFO sub block is present
       
  3408             TInt ret( aIsiMessage.FindSubBlockOffsetById(
       
  3409                 ISI_HEADER_SIZE + SIZE_NET_RAT_RESP,
       
  3410                 NET_RAT_INFO,
       
  3411                 EIsiSubBlockTypeId8Len8,
       
  3412                 sbOffset ) );
       
  3413 
       
  3414             if ( KErrNone == ret )
       
  3415                 {
       
  3416                 // Get ratName
       
  3417                 TUint8 ratName( aIsiMessage.Get8bit(
       
  3418                     sbOffset + NET_RAT_INFO_OFFSET_RATNAME ) );
       
  3419 
       
  3420                 switch ( ratName )
       
  3421                     {
       
  3422                     case NET_GSM_RAT:
       
  3423                         {
       
  3424                         iCurrentAccTech = KNetworkModeGsm;
       
  3425                         break;
       
  3426                         }
       
  3427                     case NET_UMTS_RAT:
       
  3428                         {
       
  3429                         iCurrentAccTech = KNetworkModeUtran;
       
  3430                         break;
       
  3431                         }
       
  3432                     default:
       
  3433                         {
       
  3434                         generalResult= RSat::KMeUnableToProcessCmd;
       
  3435                         break;
       
  3436                         }
       
  3437                     }
       
  3438                 }
       
  3439             else
       
  3440                 {
       
  3441                 generalResult = RSat::KMeUnableToProcessCmd;
       
  3442                 }
       
  3443 
       
  3444             // Call local info terminal response method to send
       
  3445             // terminal response to the sim card.
       
  3446             LocalInfoTerminalResp( transId,
       
  3447                                 commandDetails,
       
  3448                                 generalResult,
       
  3449                                 additionalInfo );
       
  3450 
       
  3451             // Clear local info flag
       
  3452             iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
       
  3453 
       
  3454             }
       
  3455          else
       
  3456             {
       
  3457             // No service
       
  3458             additionalInfo.Append( RSat::KNoService );
       
  3459 
       
  3460             // Clear local info flag
       
  3461             iTsySatMessaging->GetNotifyLocalInfo()->Status( ETrue );
       
  3462 
       
  3463             // Call local info terminal response method to send
       
  3464             // terminal response to the sim card.
       
  3465             LocalInfoTerminalResp( transId,
       
  3466                                     commandDetails,
       
  3467                                     RSat::KMeUnableToProcessCmd,
       
  3468                                     additionalInfo );
       
  3469             }
       
  3470         }
  3381         }
  3471     }
  3382     }
  3472 
  3383 
  3473 // -----------------------------------------------------------------------------
  3384 // -----------------------------------------------------------------------------
  3474 // CSatMessHandler::OpenChannelTerminalResp
  3385 // CSatMessHandler::OpenChannelTerminalResp
  4660 void CSatMessHandler::SimMoSmsControlAvail( TUint8 aStatus )
  4571 void CSatMessHandler::SimMoSmsControlAvail( TUint8 aStatus )
  4661     {
  4572     {
  4662     TFLOGSTRING("TSY: CSatMessHandler::SimMoSmsControlAvail" );
  4573     TFLOGSTRING("TSY: CSatMessHandler::SimMoSmsControlAvail" );
  4663     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SIMMOSMSCONTROLAVAIL, "CSatMessHandler::SimMoSmsControlAvail" );
  4574     OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SIMMOSMSCONTROLAVAIL, "CSatMessHandler::SimMoSmsControlAvail" );
  4664 
  4575 
  4665     // Activate the MO-SMS Control in SMS server. This is done by
  4576     if( SIM_SERV_OK == aStatus )
  4666     // sending a request SMS_RESOURCE_CONF_REQ to SMS server
       
  4667     TBuf8<SIZE_SMS_RESOURCE_CONF_REQ + SIZE_SMS_SB_RESOURCE_CONF> data;
       
  4668     // Append Confoguration operation
       
  4669     data.Append( SMS_RES_CONF_SET );
       
  4670     // Number of Subblocks
       
  4671     data.Append( 1 );
       
  4672     // Add Subblock
       
  4673     TIsiSubBlock ResourceConfReqSb(
       
  4674         data,
       
  4675         SMS_SB_RESOURCE_CONF,
       
  4676         EIsiSubBlockTypeId16Len16 );
       
  4677 
       
  4678     TSatUtility::AppendWord( SMS_RES_ID_MO_SM_INIT, data );
       
  4679 
       
  4680     if( aStatus )
       
  4681         {
  4577         {
  4682         // Set MoSmsCtrl object´s member iIsMoSmsCtrlActivated to ETrue
  4578         // Set MoSmsCtrl object´s member iIsMoSmsCtrlActivated to ETrue
  4683         iTsySatMessaging->GetMoSmsCtrl()->Activate();
  4579         iTsySatMessaging->GetMoSmsCtrl()->Activate();
       
  4580         // Activate the MO-SMS Control in SMS server. This is done by
       
  4581         // sending a request SMS_RESOURCE_CONF_REQ to SMS server
       
  4582         TBuf8<SIZE_SMS_RESOURCE_CONF_REQ + SIZE_SMS_SB_RESOURCE_CONF> data;
       
  4583         // Append Configuration operation
       
  4584         data.Append( SMS_RES_CONF_SET );
       
  4585         // Number of Subblocks
       
  4586         data.Append( 1 );
       
  4587         // Add Subblock
       
  4588         //SMS_RESOURCE_IDS to zero SMS_RES_ID_MASK_MO_SM_INIT 
       
  4589         TIsiSubBlock ResourceConfReqSb(
       
  4590             data,
       
  4591             SMS_SB_RESOURCE_CONF,
       
  4592             EIsiSubBlockTypeId16Len16 );
       
  4593     
       
  4594         TSatUtility::AppendWord( SMS_RES_ID_MO_SM_INIT, data );
  4684         TSatUtility::AppendWord( SMS_RES_ID_MASK_MO_SM_INIT, data);
  4595         TSatUtility::AppendWord( SMS_RES_ID_MASK_MO_SM_INIT, data);
  4685         }
  4596 
       
  4597         ResourceConfReqSb.CompleteSubBlock();
       
  4598         SmsResoureConfReq(
       
  4599             iTsySatMessaging->GetTransactionId(),
       
  4600             SMS_RESOURCE_CONF_REQ,
       
  4601             data );
       
  4602       }
       
  4603     // should not send SMS_RESOURCE_CONF_REQ if there is no MO SMS control enabled in SIM card
  4686     else
  4604     else
  4687         {
  4605       {
  4688         // Set MoSmsCtrl object´s member IsMoSmsCtrlDeActivated to EFalse
  4606       // Set MoSmsCtrl object´s member IsMoSmsCtrlDeActivated to EFalse
  4689         iTsySatMessaging->GetMoSmsCtrl()->Deactivate();
  4607       iTsySatMessaging->GetMoSmsCtrl()->Deactivate();
  4690         TSatUtility::AppendWord( 0x0000, data);
  4608       }
  4691         }
  4609     }
  4692     ResourceConfReqSb.CompleteSubBlock();
       
  4693     SmsResoureConfReq(
       
  4694         iTsySatMessaging->GetTransactionId(),
       
  4695         SMS_RESOURCE_CONF_REQ,
       
  4696         data );
       
  4697     }
       
  4698 
       
  4699 
  4610 
  4700 // -----------------------------------------------------------------------------
  4611 // -----------------------------------------------------------------------------
  4701 // CSatMessHandler::UiccTerminalProfileReq
  4612 // CSatMessHandler::UiccTerminalProfileReq
  4702 // Send terminal profile
  4613 // Send terminal profile
  4703 // -----------------------------------------------------------------------------
  4614 // -----------------------------------------------------------------------------