cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp
changeset 27 489cf6208544
parent 23 7ec726f93df1
child 40 c5b848e6c7d1
equal deleted inserted replaced
23:7ec726f93df1 27:489cf6208544
    15 *      Implementation of packetdata Plugin interface.
    15 *      Implementation of packetdata Plugin interface.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 #include <stringloader.h>
    20 #include <StringLoader.h>
    21 #include <FeatMgr.h>
    21 #include <featmgr.h>
    22 #include <centralrepository.h>
    22 #include <centralrepository.h>
    23 #include <CoreApplicationUIsSDKCRKeys.h>
    23 #include <CoreApplicationUIsSDKCRKeys.h>
    24 
    24 
       
    25 #include "datamobilitycommsdattypes.h"
    25 #include "cmpluginpacketdata.h"
    26 #include "cmpluginpacketdata.h"
    26 
    27 
    27 #include "OstTraceDefinitions.h"
    28 #include "OstTraceDefinitions.h"
    28 #ifdef OST_TRACE_COMPILER_IN_USE
    29 #ifdef OST_TRACE_COMPILER_IN_USE
    29 #include "cmpluginpacketdataTraces.h"
    30 #include "cmpluginpacketdataTraces.h"
    32 using namespace CMManager;
    33 using namespace CMManager;
    33 using namespace CommsDat;
    34 using namespace CommsDat;
    34 
    35 
    35 // ================= CONSTANTS =======================
    36 // ================= CONSTANTS =======================
    36 
    37 
    37 const TUint32 KDefaultPriorityPacketData = 1;
    38 /// Modem bearer names for GPRS/WCDMA access points.
    38 
       
    39 /// Modem bearer names for GPRS/WCDMA Access Points
       
    40 _LIT( KModemBearerPacketData, "GPRS Modem" );
    39 _LIT( KModemBearerPacketData, "GPRS Modem" );
    41 _LIT( KDefaultQosDataRecordName, "PRIMARY1" );
    40 _LIT( KDefaultQosDataRecordName, "PRIMARY1" );
    42 _LIT( KDefaultQosDataRecordNamewithSpace, "PRIMARY1 " );
    41 _LIT( KDefaultQosDataRecordNamewithSpace, "PRIMARY1 " );
    43 
    42 
    44 const TInt KQosRecordIndex = 0;
    43 const TInt KQosRecordIndex = 0;
   311     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CONSTRUCTL_ENTRY );
   310     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CONSTRUCTL_ENTRY );
   312 
   311 
   313     FeatureManager::InitializeLibL();
   312     FeatureManager::InitializeLibL();
   314     CCmPluginBaseEng::ConstructL();
   313     CCmPluginBaseEng::ConstructL();
   315 
   314 
       
   315     // Get bearer priority table ID.
       
   316     TRAP_IGNORE( iBearerPriorityTableId =
       
   317             CCDGlobalBearerTypePriorizationRecord::TableIdL( iSession ) );
       
   318 
       
   319     if ( !iBearerPriorityTableId )
       
   320         {
       
   321         iBearerPriorityTableId =
       
   322                 CCDGlobalBearerTypePriorizationRecord::CreateTableL( iSession );
       
   323         }
       
   324 
   316     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CONSTRUCTL_EXIT );
   325     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CONSTRUCTL_EXIT );
   317     }
   326     }
   318 
   327 
   319 // ----------------------------------------------------------------------------
   328 // ----------------------------------------------------------------------------
   320 // CCmPluginPacketData::CanHandleIapIdL()
   329 // CCmPluginPacketData::CanHandleIapIdL()
   383         RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray,
   392         RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray,
   384         RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray )
   393         RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray )
   385     {
   394     {
   386     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_PREPAREPLUGINTOUPDATERECORDSL_ENTRY );
   395     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_PREPAREPLUGINTOUPDATERECORDSL_ENTRY );
   387 
   396 
   388     CCDIAPRecord* iapRecord =
   397     //TODO, Add null checks for mandatory specific record pointers.
   389                 static_cast<CCDIAPRecord*>( aGenRecordArray[KIapRecordIndex] );
   398 
   390 
   399     CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>(
   391     CCDWCDMAPacketServiceRecord* serviceRecord =
   400             aGenRecordArray[KIapRecordIndex] );
   392             static_cast<CCDWCDMAPacketServiceRecord*>( aGenRecordArray[KServiceRecordIndex] );
   401 
       
   402     CCDWCDMAPacketServiceRecord* serviceRecord = static_cast<CCDWCDMAPacketServiceRecord*>(
       
   403             aGenRecordArray[KServiceRecordIndex] );
   393 
   404 
   394     CheckIfNameModifiedL( iapRecord, serviceRecord );
   405     CheckIfNameModifiedL( iapRecord, serviceRecord );
   395 
   406 
   396     CheckDNSServerAddressL( ETrue,
   407     CheckDNSServerAddressL( ETrue,
   397             serviceRecord->iGPRSIP6NameServer1,
   408             serviceRecord->iGPRSIP6NameServer1,
   416         RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray,
   427         RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray,
   417         RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray )
   428         RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray )
   418     {
   429     {
   419     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETDAEMONNAMEL_ENTRY );
   430     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETDAEMONNAMEL_ENTRY );
   420 
   431 
   421     // use DHCP if we can
   432     // Use DHCP if we can.
   422     TBool ipfromSrv = GetBearerBoolAttributeL( EPacketDataIPAddrFromServer,
   433     TBool ipfromSrv = GetBearerBoolAttributeL( EPacketDataIPAddrFromServer,
   423                                                aGenRecordArray,
   434                                                aGenRecordArray,
   424                                                aBearerSpecRecordArray );
   435                                                aBearerSpecRecordArray );
   425     if ( ipfromSrv )
   436     if ( ipfromSrv )
   426         {
   437         {
  1229                 {
  1240                 {
  1230                 retVal = KCommDbBearerWcdma;
  1241                 retVal = KCommDbBearerWcdma;
  1231                 }
  1242                 }
  1232                 break;
  1243                 break;
  1233             case ECmDefaultUiPriority:
  1244             case ECmDefaultUiPriority:
       
  1245                 {
       
  1246                 retVal = GetDefPriorityL( aAttribute );
       
  1247                 }
       
  1248                 break;
  1234             case ECmDefaultPriority:
  1249             case ECmDefaultPriority:
  1235                 {
  1250                 {
  1236                 retVal = KDefaultPriorityPacketData;
  1251                 retVal = GetDefPriorityL( aAttribute );
  1237                 }
  1252                 }
  1238                 break;
  1253                 break;
  1239             case ECmExtensionLevel:
  1254             case ECmExtensionLevel:
  1240                 {
  1255                 {
  1241                 retVal = KExtensionBaseLevel;
  1256                 retVal = KExtensionBaseLevel;
  2490         case ECmCommsDBBearerType:
  2505         case ECmCommsDBBearerType:
  2491             {
  2506             {
  2492             retVal = KCommDbBearerWcdma;
  2507             retVal = KCommDbBearerWcdma;
  2493             }
  2508             }
  2494             break;
  2509             break;
  2495 
       
  2496         case ECmDefaultUiPriority:
  2510         case ECmDefaultUiPriority:
       
  2511             {
       
  2512             retVal = GetDefPriorityL( aAttribute );
       
  2513             }
       
  2514             break;
  2497         case ECmDefaultPriority:
  2515         case ECmDefaultPriority:
  2498             {
  2516             {
  2499             retVal = KDefaultPriorityPacketData;
  2517             retVal = GetDefPriorityL( aAttribute );
  2500             }
  2518             }
  2501             break;
  2519             break;
  2502         case ECmExtensionLevel:
  2520         case ECmExtensionLevel:
  2503             {
  2521             {
  2504             retVal = KExtensionBaseLevel;
  2522             retVal = KExtensionBaseLevel;
  2982     aTableIdArray.AppendL( KCDTIdUmtsR99QoSAndOnTableRecord );
  3000     aTableIdArray.AppendL( KCDTIdUmtsR99QoSAndOnTableRecord );
  2983 
  3001 
  2984     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERTABLEIDSTOBEOBSERVEDL_EXIT );
  3002     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERTABLEIDSTOBEOBSERVEDL_EXIT );
  2985     }
  3003     }
  2986 
  3004 
       
  3005 // ---------------------------------------------------------------------------
       
  3006 // CCmPluginPacketData::GetDefPriorityL
       
  3007 // ---------------------------------------------------------------------------
       
  3008 //
       
  3009 TUint32 CCmPluginPacketData::GetDefPriorityL( const TUint32 aAttribute ) const
       
  3010     {
       
  3011     OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETDEFPRIORITYL_ENTRY );
       
  3012 
       
  3013     TUint32 retVal( KDataMobilitySelectionPolicyPriorityWildCard );
       
  3014 
       
  3015     CCDGlobalBearerTypePriorizationRecord* priorityRecord =
       
  3016             new( ELeave ) CCDGlobalBearerTypePriorizationRecord( iBearerPriorityTableId );
       
  3017     CleanupStack::PushL( priorityRecord );
       
  3018 
       
  3019     priorityRecord->iServiceType.SetL( TPtrC( KCDTypeNameOutgoingWCDMA ) );
       
  3020 
       
  3021     if ( priorityRecord->FindL( iSession ) )
       
  3022         {
       
  3023         priorityRecord->LoadL( iSession );
       
  3024 
       
  3025         switch ( aAttribute )
       
  3026             {
       
  3027             case ECmDefaultPriority:
       
  3028                 {
       
  3029                 retVal = priorityRecord->iPriority;
       
  3030                 }
       
  3031                 break;
       
  3032             case ECmDefaultUiPriority:
       
  3033                 {
       
  3034                 retVal = priorityRecord->iUIPriority;
       
  3035                 }
       
  3036                 break;
       
  3037             default:
       
  3038                 break;
       
  3039             }
       
  3040         }
       
  3041     CleanupStack::PopAndDestroy( priorityRecord );
       
  3042 
       
  3043     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETDEFPRIORITYL_EXIT );
       
  3044     return retVal;
       
  3045     }
       
  3046 
  2987 // End of file
  3047 // End of file