satengine/SatServer/Commands/OpenChannelCmd/src/COpenChannelHandler.cpp
branchRCL_3
changeset 8 ba42c4bd84dd
parent 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
7:a19c8664496d 8:ba42c4bd84dd
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-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 "Eclipse Public License v1.0"
     5 * under the terms of "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".
   631     {
   631     {
   632     LOG2( SIMPLE,
   632     LOG2( SIMPLE,
   633         "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL calling,\
   633         "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL calling,\
   634         aBearerType: %d", aBearerType )
   634         aBearerType: %d", aBearerType )
   635 
   635 
       
   636     RPacketContext::TProtocolType pdpType = RPacketContext::EPdpTypeIPv4;
       
   637     TUint32 defaultId( 0 );
   636     switch ( aBearerType )
   638     switch ( aBearerType )
   637         {
   639         {
   638         case MSatBIPUtils::ESatGPRS:
   640         case MSatBIPUtils::ESatGPRS:
   639             {
   641             {
   640             // Resolve override settings
   642             // Resolve override settings
   646 
   648 
   647                 TUint32 iapId( 0 );
   649                 TUint32 iapId( 0 );
   648                 TUint32 nwId( 0 );
   650                 TUint32 nwId( 0 );
   649                 TBool apnCreated( EFalse );
   651                 TBool apnCreated( EFalse );
   650 
   652 
   651                 RPacketContext::TProtocolType pdpType = 
   653                 pdpType = RPacketContext::EPdpTypeIPv6;
   652                            RPacketContext::EPdpTypeIPv6;
   654 
   653                 
       
   654                 if ( RSat::EIPv4Address ==
   655                 if ( RSat::EIPv4Address ==
   655                     iOpenChannelData.iDestinationAddress.iType )
   656                     iOpenChannelData.iDestinationAddress.iType )
   656                     {
   657                     {
   657                     LOG( NORMAL, 
   658                     LOG( NORMAL, 
   658                     "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL \
   659                     "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL \
   682 
   683 
   683                 SetOverrideSettingsL( iapId );
   684                 SetOverrideSettingsL( iapId );
   684                 }
   685                 }
   685             else
   686             else
   686                 {
   687                 {
   687                 LOG( NORMAL, "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL \
   688                 LOG( NORMAL, "OPENCHANNEL: SetConnectionSettingsL \
   688                 No APN, using defaults" )
   689                 No APN, using defaults" )
   689                 // No APN, use default settings
   690                 // No APN, use default settings
   690                 SetOverrideSettingsL( 0 );
   691                 TRAPD( err, defaultId = 
       
   692                 iUtils->BipUtils().ApnHandler().FindDefaultApL( pdpType ) );
       
   693                 LOG2( NORMAL, "OPENCHANNEL: SetConnectionSettingsL \
       
   694                     No APN, using defaults err = %i", err )
       
   695                 SetOverrideSettingsL( defaultId );
   691                 }
   696                 }
   692             break;
   697             break;
   693             }
   698             }
   694 
   699 
   695         default:
   700         default:
   701             }
   706             }
   702         }
   707         }
   703 
   708 
   704 #ifdef SAT_USE_DUMMY_TSY
   709 #ifdef SAT_USE_DUMMY_TSY
   705     // No APN, use default settings
   710     // No APN, use default settings
   706     SetOverrideSettingsL( 0 );
   711     TRAPD( err, 
       
   712     defaultId = iUtils->BipUtils().ApnHandler().FindDefaultApL( pdpType ) );
       
   713     LOG2( NORMAL, "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL \
       
   714         No APN, using defaults err = %i", err )
       
   715     SetOverrideSettingsL( defaultId );
   707 #endif // SAT_USE_DUMMY_TSY
   716 #endif // SAT_USE_DUMMY_TSY
   708 
   717 
   709     LOG( SIMPLE,
   718     LOG( SIMPLE,
   710         "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL exiting" )
   719         "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL exiting" )
   711     }
   720     }