×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    How to use bearer management to select access point

    QNetworkConfigurationManager manager;
    QNetworkConfiguration cfg = manager.defaultConfiguration();
    m_session = new QNetworkSession(cfg, this);
    m_session->open();

    With these codes,my app asked me to select AP for ONLY 3 times and after that the selected AP was likely set as the default one,so what's wrong with this case happened?

  2. #2
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to use bearer management to select access point

    May be this article is useful to you.
    http://wiki.forum.nokia.com/index.ph..._Mobility_APIs

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: How to use bearer management to select access point

    Quote Originally Posted by savaj View Post
    May be this article is useful to you.
    http://wiki.forum.nokia.com/index.ph..._Mobility_APIs
    I used this piece of codes and got the same result.

    Any help is welcome and appreciated.

    Thanks!

  4. #4
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    31

    Re: How to use bearer management to select access point

    I don't quite understand the question. Are you saying that defaultConfiguration) returns a valid configuration but the platform still asks you what to use? Or are you asking why the application asks you more than once?

    What type of configuration do you get? If it is UserChoice it means that no default has been set. Therefore by testing for its type you can determine whether the subsequent QnetworkSession:pen() call is going to popup a platform dialog asking the user what to use.

    Also S60 3.1 devices do not have default configuration. The always return a configuration of type UserChoice.

  5. #5
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: How to use bearer management to select access point

    I think he wants to know how to set a configuration other than "ask".

  6. #6
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: How to use bearer management to select access point

    Quote Originally Posted by AlexBl View Post
    I don't quite understand the question. Are you saying that defaultConfiguration) returns a valid configuration but the platform still asks you what to use? Or are you asking why the application asks you more than once?

    What type of configuration do you get? If it is UserChoice it means that no default has been set. Therefore by testing for its type you can determine whether the subsequent QnetworkSession:pen() call is going to popup a platform dialog asking the user what to use.

    Also S60 3.1 devices do not have default configuration. The always return a configuration of type UserChoice.

    I wanna know why the application asks me more than once to select AP and I used N95 to test my app.
    Actually, I only want to select AP only once when application launched and then the selected AP would be saved as default, but now I can't get this completed. I just want to know how to set my selected AP as default. I have already used AccessPointManager in mobile-extension to accomplish this case and I can get my expected result!

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: How to use bearer management to select access point

    Quote Originally Posted by danhicksbyron View Post
    I think he wants to know how to set a configuration other than "ask".

    Yes, I wanna to know how to set my selected AP as default one so that application would no longer ask me to select AP more than once.

  8. #8
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: How to use bearer management to select access point

    On the emulator I can get the expected result(popup a dialog asking the user to select AP only once)while on N95 it will popup three times!

  9. #9
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: How to use bearer management to select access point

    Have you tried setting a selected AP (and not "default")?

  10. #10
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: How to use bearer management to select access point

    Quote Originally Posted by danhicksbyron View Post
    Have you tried setting a selected AP (and not "default")?
    Thanks, but how can I do it?

  11. #11
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: How to use bearer management to select access point

    Not saying this is right, but it seems to work for some simple cases:
    Code:
    	// Note:  Should be calling updateConfigurations here.  See QNetworkConfigurationManager::allConfigurations writeup.
    
    	QNetworkConfiguration cfg = manager.defaultConfiguration();
    	if (!cfg.isValid() || (!canStartIAP && cfg.state() != QNetworkConfiguration::Active)) {
    		QMessageBox::information(this, tr("TestMobility"), tr("Available Access Points not found."));
    		return;
    	}
    	
    	if (cfg.type() == QNetworkConfiguration::UserChoice) {
    		QNetworkConfiguration::StateFlags flags = QNetworkConfiguration::Discovered | QNetworkConfiguration::Active;
    		QList<QNetworkConfiguration> allCfg = manager.allConfigurations(flags);
    		// Just take the first one -- need a better algorithm to pick one
    		if (allCfg.count() > 0) {
    			cfg = allCfg.at(0);
    		}
    	}

  12. #12
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: How to use bearer management to select access point

    Quote Originally Posted by danhicksbyron View Post
    Not saying this is right, but it seems to work for some simple cases:
    Code:
    	// Note:  Should be calling updateConfigurations here.  See QNetworkConfigurationManager::allConfigurations writeup.
    
    	QNetworkConfiguration cfg = manager.defaultConfiguration();
    	if (!cfg.isValid() || (!canStartIAP && cfg.state() != QNetworkConfiguration::Active)) {
    		QMessageBox::information(this, tr("TestMobility"), tr("Available Access Points not found."));
    		return;
    	}
    	
    	if (cfg.type() == QNetworkConfiguration::UserChoice) {
    		QNetworkConfiguration::StateFlags flags = QNetworkConfiguration::Discovered | QNetworkConfiguration::Active;
    		QList<QNetworkConfiguration> allCfg = manager.allConfigurations(flags);
    		// Just take the first one -- need a better algorithm to pick one
    		if (allCfg.count() > 0) {
    			cfg = allCfg.at(0);
    		}
    	}
    I tried this method with a simple case, but got the same result.

  13. #13
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: How to use bearer management to select access point

    Do you know if allCfg.count() is greater than zero?

Similar Threads

  1. Connecting J2ME application to Internet using WAP access point?
    By khurshed79 in forum Mobile Java Networking & Messaging & Security
    Replies: 12
    Last Post: 2012-09-12, 09:53
  2. Access point selection panics
    By tote_b5 in forum Python
    Replies: 31
    Last Post: 2009-01-25, 22:09
  3. select access point query when using browser control
    By rajani_sp1 in forum Symbian User Interface
    Replies: 8
    Last Post: 2008-03-17, 07:16
  4. select access point in programe
    By sangr in forum Mobile Java General
    Replies: 0
    Last Post: 2004-12-15, 02:38
  5. Gateway IP address in Nokia 6600 access point
    By yashodhan in forum General Development Questions
    Replies: 0
    Last Post: 2004-10-01, 12:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •