×

Discussion Board

Results 1 to 15 of 19

Hybrid View

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Connect to a wlan iap

    Hi all,
    I want to connect the device to a wifi iap already saved in the phone and then read the default gateway.

    I have saw RConnection API. Are the correct API?
    Is there an example to start?
    Last edited by andrea993; 2013-01-02 at 17:03.

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Connect to a wlan iap

    As you already have active thread for the problem, you should not start new ones, just explain the problem in it: http://www.developer.nokia.com/Commu...-with-wlan-IAP

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Connect to a wlan iap

    But this is another question

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Connect to a wlan iap

    I suppose for default IAP, you could see: http://www.developer.nokia.com/Commu...ki/Default_iap

    and checking all accesspoints, youcould see: http://www.developer.nokia.com/Commu...rom_the_device

  5. #5
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Connect to a wlan iap

    Hello,
    sorry i didn't precisely understand what you were asking:
    1. do you want to search for wi-fi iap stored on phone and then start a connection using them?
    2. do you want to search for wi-fi iap stored on phone and read their settings (like default gateway)?
    3. do you want to know if the phone is connected through wi-fi and then read settings?

    then:
    1 & 2. maybe something like this (taking into account only bearer wlan):
    http://www.developer.nokia.com/Commu...rom_the_device
    or post #3 of
    http://www.developer.nokia.com/Commu...ons&highlight=
    (again searching for wlan and not gprs):

    and #3 of
    http://www.developer.nokia.com/Commu...age&highlight=


    3. yes, RConnectionMonitor is the right API to monitor phone connections, please see post #4 in http://www.developer.nokia.com/Commu...-for-http-post for some starting points... you can also look into rconnmon.h for attribute list (but at first glance i don't see anything related to default gateway...)

    there's also a couple of links that could give you an idea about wi-fi scanning:
    http://www.developer.nokia.com/Commu...Management_API
    http://www.developer.nokia.com/Commu...-WLAN-scanning

    hope it helps somehow :-)
    regards
    pg

  6. #6
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Connect to a wlan iap

    Thank you..
    but I didn't find for start a connection to a wi-fi iap stored in the device and how disconnect from a wi-fi iap

  7. #7
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Connect to a wlan iap

    Quote Originally Posted by andrea993 View Post
    Thank you..
    but I didn't find for start a connection to a wi-fi iap stored in the device and how disconnect from a wi-fi iap
    hello,
    * step 1, look for defined wlan iap:
    http://www.developer.nokia.com/Commu...rom_the_device
    take the part starting more or less from:
    Code:
    CCommsDbTableView* gprsTable = iCommsDB->OpenIAPTableViewMatchingBearerSetLC(
    		ECommDbBearerGPRS|ECommDbBearerWLAN|ECommDbBearerVirtual,
    		ECommDbConnectionDirectionOutgoing);
    and filter using only ECommDbBearerWLAN

    or, you can use CommsDat API
    more info here:
    http://library.developer.nokia.com/i...n%20Guide.html
    http://www.symlab.org/wiki/index.php...d_Technologies
    and something like this:

    Code:
    	CommsDat::CMDBSession *dbs = CMDBSession::NewLC(KCDLatestVersion);
    	
    	
    	// Counter for the iap we append
    	TInt prefIapCount = 0;
    	
    	// Reset the IAP ID array
    	iIapArray.Reset();
    
    	if(iUseWiFi)
    		{
    		//let's search for "LANService" serviceType
    		//Create a record set
    		CMDBRecordSet<CCDIAPRecord>* wlanIapRecordSet = new (ELeave) CMDBRecordSet<CCDIAPRecord>(KCDTIdIAPRecord);
    		CleanupStack::PushL(wlanIapRecordSet);
    		//To find all IAP records supporting LANService service
    		TPtrC lanServiceType(KCDTypeNameLANService);
    		//To prime for a search, create a record with the priming fields and append it to the Recordset
    		CCDIAPRecord* ptrPrimingRecord = static_cast<CCDIAPRecord *>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
    		ptrPrimingRecord->iServiceType.SetMaxLengthL(lanServiceType.Length());
    		ptrPrimingRecord->iServiceType = lanServiceType;  
    		wlanIapRecordSet->iRecords.AppendL(ptrPrimingRecord);    
    		ptrPrimingRecord=NULL; //since ownership is been passed to the recordset
    		
    		//Search
    		if(wlanIapRecordSet->FindL(*dbs))
    			{
    			//The iapRecordSet->iRecords.Count() will now reflect the number of records found   
    			TInt wlanIapRecordsFound = wlanIapRecordSet->iRecords.Count();
    					
    			for(TInt8 i=0; i<wlanIapRecordsFound; i++)
    				{
    				CCDIAPRecord* singleIapRecord = static_cast<CCDIAPRecord*>( wlanIapRecordSet->iRecords[i]);
    				RBuf iapName;
    				iapName.CreateL(singleIapRecord->iRecordName);
    				iapName.CleanupClosePushL();
    				if(iapName.Compare(_L("IPDC"))==0 || iapName.Compare(_L("Easy WLAN"))==0 || iapName.Compare(_L("Search for WLAN"))==0)
    					{
    					;//  do nothing, it's not  valid wlan ap
    					} 
    				else 
    					{
    					// it's a valid wlan ap, append it
    					prefIapCount = ++prefIapCount;
    					iIapArray.Insert(singleIapRecord->RecordId(),0);
    					}
    				CleanupStack::PopAndDestroy();  // iapName		
    				}
    			}
    		else 
    			{
    			// No records found..but iRecords[0] is still present (though will only 
    			//contain the priming values), so its important to check for the return code 
    			}   
    
    		CleanupStack::PopAndDestroy(1);  //wlanIapRecordSet
    	
    		}
    you should now have a list of configured access points id

    * step 2, connect through the iap, use RConnection::Start(TConnPref& aPref) as documented in:
    http://www.symlab.org/main/documenta...6E9FEDC93.html
    http://www.symlab.org/main/documenta...4707C67FD.html

    loop through the list until you find one that connects with no errors

    * step 4, close connection using RConnection::Close()

    If you want to use a specific connection for HTTP traffic, this is the link:
    http://www.developer.nokia.com/Commu...ive_connection

    regards,
    pg

Similar Threads

  1. connect pc to internet thru e72 wlan?
    By fullon in forum General Development Questions
    Replies: 2
    Last Post: 2011-05-21, 13:33
  2. How to Add WLAN Configuration to my Phone and Connect to it
    By @Rainier in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2010-12-06, 20:00
  3. how to find all Wlan IAP and connect to them
    By rahultechie in forum Symbian
    Replies: 2
    Last Post: 2010-05-18, 07:50
  4. How to connect to Internet using WLAN in E70
    By pran2et in forum Wired and Wireless interfaces (Closed)
    Replies: 1
    Last Post: 2006-09-20, 06:35
  5. E70 connect thru WLAN
    By sanasath in forum Wired and Wireless interfaces (Closed)
    Replies: 0
    Last Post: 2006-09-18, 07:29

Posting Permissions

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