syncmlfw/common/transport/src/nsmltransport.cpp
branchRCL_3
changeset 61 b183ec05bd8c
parent 0 b497e44ab2fc
child 62 19bba8228ff0
equal deleted inserted replaced
59:13d7c31c74e0 61:b183ec05bd8c
    19 
    19 
    20 
    20 
    21 #include <CoreApplicationUIsSDKCRKeys.h>
    21 #include <CoreApplicationUIsSDKCRKeys.h>
    22 #include <btengdomaincrkeys.h>
    22 #include <btengdomaincrkeys.h>
    23 #include <centralrepository.h>
    23 #include <centralrepository.h>
    24 #include <ApUtils.h>
       
    25 #include "nsmltransport.h"
    24 #include "nsmltransport.h"
    26 #include "nsmlhttp.h"
    25 #include "nsmlhttp.h"
    27 #include "NSmlObexClient.h"
    26 #include "NSmlObexClient.h"
    28 #include "nsmlobexserverbinding.h"
    27 #include "nsmlobexserverbinding.h"
    29 #include "nsmlerror.h"  
    28 #include "nsmlerror.h"  
    30 #include <featmgr.h>
    29 #include <featmgr.h>
       
    30 #include <cmconnectionmethoddef.h>
       
    31 #include <cmmanagerext.h>
       
    32 #include <cmpluginwlandef.h>
       
    33 
    31 
    34 
    32 //============================================================
    35 //============================================================
    33 // CNSmlTransport definition
    36 // CNSmlTransport definition
    34 //============================================================
    37 //============================================================
    35 EXPORT_C CNSmlTransport::CNSmlTransport()
    38 EXPORT_C CNSmlTransport::CNSmlTransport()
   246             // used, so it is ok to use first one in the list.
   249             // used, so it is ok to use first one in the list.
   247             if ( aIAPIdArray->At(0) != 0xffffffff && aIAPIdArray->At(0) != 0xfffffffe ) 
   250             if ( aIAPIdArray->At(0) != 0xffffffff && aIAPIdArray->At(0) != 0xfffffffe ) 
   248 			// 0xffffffff is same as -1 (KErrNotFound) and -2 for Default connection
   251 			// 0xffffffff is same as -1 (KErrNotFound) and -2 for Default connection
   249                 {
   252                 {
   250                 TUint32 accesspointId = aIAPIdArray->At(0);
   253                 TUint32 accesspointId = aIAPIdArray->At(0);
   251                 CCommsDatabase* commDb = CCommsDatabase::NewL();
   254                 RCmManagerExt  cmmanagerExt;
   252                 CleanupStack::PushL(commDb);
   255                 cmmanagerExt.OpenL();
   253                 CApUtils* aputils = CApUtils::NewLC( *commDb );
   256                 CleanupClosePushL(cmmanagerExt);
   254                 TRAP_IGNORE( accesspointId = aputils->WapIdFromIapIdL( accesspointId ) );
   257                 RCmConnectionMethodExt cm;
   255                 TApBearerType bearerType = aputils->BearerTypeL( accesspointId );
   258                 cm = cmmanagerExt.ConnectionMethodL( accesspointId );
   256                 CleanupStack::PopAndDestroy( 2 ); //commdb,aputils
   259                 CleanupClosePushL( cm );
       
   260                 TUint32 bearer = 0;
       
   261                                 
       
   262                 TRAP_IGNORE( accesspointId = cm.GetIntAttributeL(CMManager::ECmIapId) );
       
   263                 bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );
       
   264                 CleanupStack::PopAndDestroy( 2 ); //cmmanagerext,cm
   257                             
   265                             
   258                 if ( bearerType != EApBearerTypeWLAN )
   266                 if ( bearer != KUidWlanBearerType )
   259                     {
   267                     {
   260                     	errormsg = ETrue;
   268                     	errormsg = ETrue;
   261                     }
   269                     }
   262                 }
   270                 }
   263 			}
   271 			}