当前位置: 首页>>代码示例>>C++>>正文


C++ TCommDbConnPref::SetBearerSet方法代码示例

本文整理汇总了C++中TCommDbConnPref::SetBearerSet方法的典型用法代码示例。如果您正苦于以下问题:C++ TCommDbConnPref::SetBearerSet方法的具体用法?C++ TCommDbConnPref::SetBearerSet怎么用?C++ TCommDbConnPref::SetBearerSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCommDbConnPref的用法示例。


在下文中一共展示了TCommDbConnPref::SetBearerSet方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TCommDbConnPref

void
CConnectionManager::OpenLinkLayerConnectionL()
{
#ifdef USE_RCONNECTION
   User::LeaveIfError(iSocketServ->Connect());
   User::LeaveIfError(iConnection->Open(*iSocketServ));
   TCommDbConnPref prefs = TCommDbConnPref();

   if (iIAP >= 0) {
      prefs.SetIapId(iIAP);
      prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
      iConnection->Start(prefs, iStatus);
   } else if (iIAP == -2) {
      // Debug mode - use system default
      iConnection->Start(iStatus);
   } else {
      // Use Always ask
      prefs.SetDialogPreference(ECommDbDialogPrefPrompt);
      prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
# ifdef NAV2_CLIENT_SERIES60_V2
      prefs.SetBearerSet( EApBearerTypeGPRS | EApBearerTypeHSCSD );
# else //s80, s90
      prefs.SetBearerSet( ECommDbBearerCSD | ECommDbBearerWcdma |
            ECommDbBearerCdma2000 | ECommDbBearerPSD );

# endif
      iConnection->Start(prefs, iStatus);
   }
   SetActive();

#endif
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:32,代码来源:ConnectionManager.cpp

示例2: SetIap

TInt CResourceManager::SetIap(TUint32 aIapId, TBool aIsWap)
{
    m_bUseOutNetSettting = false;

    m_socketServ.Connect();
    m_connection.Open(m_socketServ);

    m_iapId = aIapId;
    m_isWap = aIsWap;

    TInt err = KErrNone;

    // Now we have the iap Id. Use it to connect for the connection.
    // Create a connection preference variable.
    TCommDbConnPref connectPref;

    // setup preferences 
    connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    connectPref.SetDirection(ECommDbConnectionDirectionUnknown);
    connectPref.SetBearerSet(ECommDbBearerGPRS | ECommDbBearerWLAN | ECommDbBearerLAN);
    //Sets the CommDb ID of the IAP to use for this connection
    connectPref.SetIapId(aIapId);

    err = m_connection.Start(connectPref);

    if (err == KErrNone) {
        m_IAPSeted = true;
        m_IAPReady = true;
        ResendRequest();
    }

    return err;
}
开发者ID:github188,项目名称:homebrew,代码行数:33,代码来源:ResourceManager.cpp

示例3: OpenExplicitUdpSocketL

/* 
 * Open an Explicit UDP Socket
 */
void CMultipleArray::OpenExplicitUdpSocketL(TInt aExtraSocksToJoin, RSocketServ iSocketServer)
	{
   /* Get number of sockets from script
	* Open a UDP socket
	* Store socket handle
	* Return the EFail or EPass
	*/
	RSocket* sock;
	RConnection* conn;
	TCommDbConnPref prefs;
	TInt err = 0;
		
	sock = new (ELeave) RSocket;
	conn = new (ELeave) RConnection;
	CleanupStack::PushL(sock);
	CleanupStack::PushL(conn);

	// Start an outgoing connection
	err = conn->Open(iSocketServer);
	if (err!=KErrNone)
		{
		iQoSStep->iQoSSuite->Log(_L("Failed to open Connection: return value = <%d>"), err);
		User::Leave(err);
		}
		
	// Setup SetBearerSet
	prefs.SetBearerSet(iSetBearerSet[aExtraSocksToJoin]);	
	// Setup IAP
	prefs.SetIapId(iIAP[aExtraSocksToJoin]);

	err = conn->Start(prefs);
	if (err!=KErrNone)
		{
		iQoSStep->iQoSSuite->Log(_L("Failed to open socket: return value = <%d>"), err);
		User::Leave(err);
		}

	err = sock->Open(iSocketServer, KAfInet, KSockDatagram, KProtocolInetUdp, *conn);
	if (err!=KErrNone)
		{
		iQoSStep->iQoSSuite->Log(_L("Failed to open socket: return value = <%d>"), err);
		User::Leave(err);
		}
		
	AddSocketToListL(sock);
	AddConnectionToListL(conn);

	CleanupStack::Pop(2);	//sock and conn
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:52,代码来源:CMultipleArray.cpp

示例4: SetupConnection


//.........这里部分代码省略.........
	    if (iCurrentProfileId == EConnectionStatus::Disconnected)
	    {
	        iBearerFilter = EApBearerTypeWLAN;
	    }

	    // Show IAP selection dialog
	    /*CActiveApDb* aDb = CActiveApDb::NewL();
	    CleanupStack::PushL(aDb);

	    CApSettingsHandler* settings = CApSettingsHandler::NewLC
	        (
	           *aDb
	         , ETrue
	         , EApSettingsSelListIsPopUp
	         , EApSettingsSelMenuSelectNormal
	         , KEApIspTypeAll
	         , iBearerFilter
	         , KEApSortNameAscending
	         , 0
	         , EVpnFilterBoth
	         , ETrue
	        );

	    TInt iapRet = settings->RunSettingsL(0, iSelectedConnectionId);
	    CleanupStack::PopAndDestroy(settings);
	    CleanupStack::PopAndDestroy(aDb);

	    if (iapRet != KApUiEventSelected)
	    {
	        // Exit no selection
	        User::Leave(KErrNotReady);
	    }
	    else*/

	    // open the IAP communications database 
		CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
		CleanupStack::PushL(commDB);

		// initialize a view 
		CCommsDbConnectionPrefTableView* commDBView = 
		commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionUnknown);

		// go to the first record 
		User::LeaveIfError(commDBView->GotoFirstRecord());

		CCommsDbConnectionPrefTableView::TCommDbIapBearer bearer;
		bearer.iBearerSet = iBearerFilter;
		
		// Declare a prefTableView Object.
		CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref;

		pref.iBearer = bearer;
		pref.iDirection = ECommDbConnectionDirectionOutgoing;
		
		// read the connection preferences 
		commDBView->ReadConnectionPreferenceL(pref);

		iSelectedConnectionId = pref.iBearer.iIapId; 
		
		// pop and destroy the IAP View 
		CleanupStack::PopAndDestroy(commDBView);

		// pop and destroy the database object
		CleanupStack::PopAndDestroy(commDB);

    	iNewConnection = ETrue;
    	
        // IAP Selected
        // Open socket server and start the connection
        User::LeaveIfError(iServerSocket.Connect(KESockDefaultMessageSlots));
        User::LeaveIfError(iConnection.Open(iServerSocket, KConnectionTypeDefault));
        // Now we have the iap Id. Use it to connect for the connection
        TCommDbConnPref connectPref;
        // Setup preferences 
        connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
        // Sets the CommDb ID of the IAP to use for this connection
        connectPref.SetIapId(iSelectedConnectionId);
        // Sets direction
        connectPref.SetDirection(ECommDbConnectionDirectionOutgoing);
        
        connectPref.SetBearerSet(iBearerFilter);
        
        // Start connection
        User::LeaveIfError(iConnection.Start(connectPref));
        
        //TInt retval = iConnection.Start();
        //User::LeaveIfError(retval);
	        
        // Set the sessions connection info...
        RStringPool strPool = iSessionHttp.StringPool();
        RHTTPConnectionInfo connInfo = iSessionHttp.ConnectionInfo();
        // ...to use our socket server and connection
        connInfo.SetPropertyL(strPool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal (iServerSocket.Handle()));
        // ...to use our connection
        connInfo.SetPropertyL(strPool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))));

        iConnectionSetup = ETrue;
	
	    return ETrue;
}
开发者ID:ZhangHanDong,项目名称:rhodes,代码行数:101,代码来源:ConnectionManager.cpp

示例5: SetupConnectionL

// ----------------------------------------------------------------------------
// CClientEngine::SetupConnectionL()
//
// The method set the internet access point and connection setups.
// ----------------------------------------------------------------------------	
void CClientEngine::SetupConnectionL()
    {
    if( iConnectionSetupDone )
        return;
    
    iConnectionSetupDone = ETrue;
    //open socket server and start the connection
    User::LeaveIfError(iSocketServ.Connect());
    User::LeaveIfError(iConnection.Open(iSocketServ));
    
    TCommDbConnPref connectPref;
    TUint32 iapID;

    if(iSetIap == EFalse)
	{
    // open the IAP communications database 
	CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
	CleanupStack::PushL(commDB);

	// initialize a view 
	CCommsDbConnectionPrefTableView* commDBView = 
	commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionUnknown);

	// go to the first record 
	User::LeaveIfError(commDBView->GotoFirstRecord());

	// Declare a prefTableView Object.
	CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref;
	// read the connection preferences 
	commDBView->ReadConnectionPreferenceL(pref);

	iapID = pref.iBearer.iIapId;

	// pop and destroy the IAP View 
	CleanupStack::PopAndDestroy(commDBView);

	// pop and destroy the database object
	CleanupStack::PopAndDestroy(commDB);

	// setup preferences 
	connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
	connectPref.SetDirection(ECommDbConnectionDirectionUnknown);
	connectPref.SetBearerSet(ECommDbBearerGPRS);
	//Sets the CommDb ID of the IAP to use for this connection
	connectPref.SetIapId(iapID);
	}else{
	connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
	connectPref.SetDirection(ECommDbConnectionDirectionUnknown);
	connectPref.SetBearerSet(ECommDbBearerGPRS);
	//Sets the CommDb ID of the IAP to use for this connection
	connectPref.SetIapId(iIapId);
	}
    
    User::LeaveIfError(iConnection.Start(connectPref));
	
    //set the sessions connection info
    RStringPool strPool = iSession.StringPool();
    RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();
    
    //to use our socket server and connection
    connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ,
        RHTTPSession::GetTable() ), THTTPHdrVal (iSocketServ.Handle()) );

    connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection,
        RHTTPSession::GetTable() ), 
        THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))) );
    }
开发者ID:Seikareikou,项目名称:symbian,代码行数:72,代码来源:ClientEngine.cpp

示例6: StartNetworkingL

void Syscall::StartNetworkingL(ConnOp& connOp) {
	LOGST("StartNetworkingL");
	DEBUG_ASSERT(gNetworkingState != EStarted);
	if(gNetworkingState == EStarting) {
		LOGST("SN pending");
		connOp.iStatus = KRequestPending;
		connOp.SetActive();
		gConnOpsWaitingForNetworkingStart.AppendL(&connOp);
		return;
	}

	gNetworkingState = EStarting;
	LHEL(gConnection.Open(gSocketServ));

	TCommDbConnPref pref;
#ifdef __SERIES60_3X__
	if(gIapMethod == MA_IAP_METHOD_WLAN) {
#if 0	// didn't work; prompted anyway.
		pref.SetBearerSet(KCommDbBearerWLAN);
#endif
		RArray<TUint> iaps;
		if(gWlanAvailable) {
			LHEL(gWlanClient->GetAvailableIaps(iaps));
			LOG("%i WLAN IAPs available.\n", iaps.Count());
		}
		if(iaps.Count() > 0) {
			LOG("Picked IAP %i\n", iaps[0]);
			pref.SetIapId(iaps[0]);
			pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
		} else {
			LOG("No WLAN IAPs available. Failing...\n");
			//connOp.SendResult(CONNERR_NETWORK);
			connOp.mConn.connErr = CONNERR_NETWORK;
			//connOp.RunL();
			connOp.SetActive();
			TRequestStatus* rsp = &connOp.iStatus;
			User::RequestComplete(rsp, KErrGeneral);
			return;
		}
	} else
	if(gIapMethod == MA_IAP_METHOD_STANDARD)
#endif	//__SERIES60_3X__
	{
		bool hasSavedIap = getSavedIap(gIapId);
		if(hasSavedIap) {
			LOG("Saved IAP: %u\n", gIapId);
			pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
			pref.SetIapId(gIapId);
			DEBUG_ASSERT(pref.IapId() == gIapId);
		} else {
			LOG("No saved IAP, showing dialog...\n");
#ifdef __SERIES60_3X__
			if(gIapFilter == MA_IAP_FILTER_NOT_WLAN) {
				// Note: doesn't work on E61i. WLAN is still displayed.
				LOG("Not wlan.\n");
				pref.SetBearerSet(0xFF & ~KCommDbBearerWLAN);
			} else if(gIapFilter == MA_IAP_FILTER_WLAN) {
				LOG("Wlan only.\n");
				pref.SetBearerSet(KCommDbBearerWLAN);
			} else {
				DEBUG_ASSERT(gIapFilter == MA_IAP_FILTER_ALL);
			}
#endif	//__SERIES60_3X__
			pref.SetDialogPreference(ECommDbDialogPrefPrompt);
		}
	}
#ifdef __SERIES60_3X__
	else
	{
		DEBIG_PHAT_ERROR;
	}
#endif	//__SERIES60_3X__
	gConnection.Start(pref, connOp.iStatus);

	connOp.SetActive();
	LOGST("SN active");
}
开发者ID:Felard,项目名称:MoSync,代码行数:77,代码来源:netImpl.cpp

示例7: SetupConnection

TBool CConnectionManager::SetupConnection()
	{
		TInt iCurrentProfileId;    
		iBearerFilter = EApBearerTypeAllBearers;

		ASSERT(iRepository);

		// Check whether we are offline or online
		iRepository->Get(KProEngActiveProfile, iCurrentProfileId);
		
	    // Close the connection only if
	    // a) this is not the first time and
	    // b) the profile has changed and
	    // c) either the previous or the current profile is Offline (5 = Offline)
	    if (iPreviousProfileId != -1 && iPreviousProfileId != iCurrentProfileId &&
	            (iPreviousProfileId == EConnectionStatus::Disconnected || iCurrentProfileId == EConnectionStatus::Disconnected))
	    {
	        // Close and uninitialize
	        iConnectionSetup = EFalse;
	        iSessionHttp .Close();
	        iConnection  .Close();
	        iServerSocket.Close();
	    }

	    // Save current profile id
	    iPreviousProfileId = iCurrentProfileId;

	    // Try to find an existing connection. If connection has not been set up,
	    // iConnection is not initialized and FindExistingConnection() fails.
	    // Thus, in that case, finding must not be carried out.
	    if (iConnectionSetup && !FindExistingConnection())
	    {
	        iConnectionSetup = EFalse;
	    }

	    if (iConnectionSetup)
	    {
	        // Connection setup is done
	    	iNewConnection = EFalse;
	        return ETrue;
	    }

	    // Open RHTTPSession with default protocol ("HTTP/TCP")
	    iSessionHttp.OpenL();

	    // Install this class as the callback for authentication requests. When
	    // page requires authentication the framework calls GetCredentialsL to get
	    // user name and password.
	    InstallAuthenticationL(iSessionHttp);

	    // In offline, only WLAN connections are available
	    if (iCurrentProfileId == EConnectionStatus::Disconnected)
	    {
	        iBearerFilter = EApBearerTypeWLAN;
	    }


	    // Show IAP selection dialog
	    if ( gSelectedConnectionId == -1 )
	    	gSelectedConnectionId = SelectIAP();
	    
	    iSelectedConnectionId =  gSelectedConnectionId;
	    
    	iNewConnection = ETrue;
    	
        // IAP Selected
        // Open socket server and start the connection
        User::LeaveIfError(iServerSocket.Connect(KESockDefaultMessageSlots));
        User::LeaveIfError(iConnection.Open(iServerSocket, KConnectionTypeDefault));
        // Now we have the iap Id. Use it to connect for the connection
        TCommDbConnPref connectPref;
		// Setup preferences 
		connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
		
		// Sets the CommDb ID of the IAP to use for this connection
        connectPref.SetIapId(iSelectedConnectionId);
        // Sets direction
        connectPref.SetDirection(ECommDbConnectionDirectionOutgoing);
        
        connectPref.SetBearerSet(iBearerFilter);
        
        // Start connection
        User::LeaveIfError(iConnection.Start(connectPref));
        
        //TInt retval = iConnection.Start();
        //User::LeaveIfError(retval);
	        
        // Set the sessions connection info...
        RStringPool strPool = iSessionHttp.StringPool();
        RHTTPConnectionInfo connInfo = iSessionHttp.ConnectionInfo();
        // ...to use our socket server and connection
        connInfo.SetPropertyL(strPool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal (iServerSocket.Handle()));
        // ...to use our connection
        connInfo.SetPropertyL(strPool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))));

        iConnectionSetup = ETrue;
	
	    return ETrue;
}
开发者ID:addame,项目名称:rhodes,代码行数:99,代码来源:ConnectionManager.cpp

示例8: doTestStepL

TVerdict CTestConnectStep::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 * Demonstrates reading configuration parameters fom an ini file section
 */
	{
	if(TestStepResult()==EPass)
		{
		INFO_PRINTF1(_L("In Test Step ConnectWithOverrides"));
		// When bootstrapping C32 we have to avoid the PhBkSyncServer being started, since
 		// it needs a different CommDB
		TInt ret = StartC32WithCMISuppressions(KPhbkSyncCMI);
		
		if((ret!=KErrNone) && (ret!=KErrAlreadyExists))
			{
			INFO_PRINTF2(_L("error is : %d \n"),ret);
			}
		else
			{
			INFO_PRINTF1(_L("Started C32\n"));
			}

		RHostResolver hr;

		INFO_PRINTF1(_L("Connect to RSocketServ"));			
		User::LeaveIfError(iSocketServ.Connect());

		// Set up the connections, both overridden as host resolver won't work 
		// on the default interface
		INFO_PRINTF1(_L("Open the RConnection interface"));			
		User::LeaveIfError(iConnection.Open(iSocketServ));

		// get the IapNumber value from the ini file
		if(!GetIntFromConfig(ConfigSection(), KIapNumber, iIapNumber))
			{
			if(!GetIntFromConfig(KIap, KIapNumber, iIapNumber))
				{
				iIapNumber=1;
				INFO_PRINTF1(_L("Failed to read Iap from ini file, using default"));
				}
			}
		INFO_PRINTF2((_L("IapNumber = %d")), iIapNumber);

		TRequestStatus status;
#ifdef SIROCCO_CODE_MIGRATION
	TCommDbConnPref prefs;
	prefs.SetIapId(iIapNumber);
	prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
		const TUid KMyPropertyCat = {0x101FD9C5};
        const TUint32 KMyPropertyDestPortv4 = 67;
        TInt err = RProperty::Define(KMyPropertyCat, KMyPropertyDestPortv4, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
		     TSecurityPolicy(ECapabilityWriteDeviceData));
        User::LeaveIfError(RProperty::Set(KMyPropertyCat, KMyPropertyDestPortv4, 93));
#else

		TInt rank = 1;

		// Create a multiple connection preference object
		TCommDbMultiConnPref prefs;

		for(TInt i=0;i<iapCount;i++)
			{
			TCommDbConnPref pref;
			// Set the direction
			pref.SetDirection(ECommDbConnectionDirectionOutgoing);
			// Set the bear ser
			pref.SetBearerSet(KCommDbBearerPSD | KCommDbBearerCSD);
			// Set the IAP
			pref.SetIapId(iIapNumber + i);
			// Set the dialog preference to Do Not Prompt
			pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
			// Set the rank
			User::LeaveIfError(prefs.SetPreference(rank, pref));

			rank++;
			}

		prefs.SetConnectionAttempts(rank-1);
#endif 

		// Start the connection
		iConnection.Start(prefs, status);

		
		User::WaitForRequest(status);

		TInt result = status.Int();

		if(result!=KErrNone)
			{
			ERR_PRINTF2(_L("Failed to start connection. Error %d"), result);
			SetTestStepResult(EFail);
			User::Leave(EFail);
			}
		else
			{
			INFO_PRINTF1(_L("Connection started with overrides"));
			}

//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:101,代码来源:TeMsgStep.cpp


注:本文中的TCommDbConnPref::SetBearerSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。