×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  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 Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    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 Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    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

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

    Re: Connect to a wlan iap

    Thank you I solved.
    And is possilbe to connect the device to a wi-fi network without make an iap first?

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

    Re: Connect to a wlan iap

    Quote Originally Posted by andrea993 View Post
    And is possilbe to connect the device to a wi-fi network without make an iap first?
    never found an easy way.... but i admit i've never been enough motivated to search for it into symbian sources... IAPs seem just an aggregation of ntw info, maybe in some layers below you can get rid of them (provided that you can isolate code/libs and obtain capabilities) ...

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

    Re: Connect to a wlan iap

    In the pdk I've found "wlmserver.cpp".

    The problem is that to close a connection I should use RConnection::Stop() (RConnection::Close() doesn't work) but it need NetworkControl capability. So I'm looking for a way to make a temporary connection to a wlan network (start and stop connection) without use NetworkControl.
    Last edited by andrea993; 2013-01-16 at 21:48.

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Connect to a wlan iap

    I admit I have not checked all the links in this discussion, but the related IAP configuration articles I remember about are http://www.developer.nokia.com/Commu...g_CommsDat_API, http://www.developer.nokia.com/Commu..._access_points and http://www.developer.nokia.com/Commu...nnect_to_it%3F
    For the capability stuff:
    - NetworkServices is "free", you can even self-sign it. It is required for doing any communication, including connection to an IAP
    - NetworkControl is the strong one, it is required for RConnection::Stop for example. However that particular method you do not really need, as an unused IAP (RConnection::Close) is expected to stop after a while, depending on device settings. NetworkControl is "strong" because it can kill a connection even if an other application would use it, so RConnection::Stop is not a friendly move in general
    - CommDD would be a capability needed if you want to access the WLAN driver without configuring an IAP, but that is certainly some arcane thing, you would need to get documentation directly from Nokia (drivers for actual hardware are not present in the ex-open sourced code). It is also a high level capability anyway.
    - I have not really checked, but for working with IAP configuration, Write/ReadDeviceData are probably enough, which are accessible with a devcert.
    It is true that you will not be able to remove the "temporary" IAP configuration, since it is going to be remain used for a while after a simple RConnection::Close.

    By the way, the super-old CAp* API set may still work (though it is marked as deprecated for several platform releases), http://www.developer.nokia.com/Commu...ymbian_C%2B%2B summarizes some use of it.

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

    Re: Connect to a wlan iap

    To make an iap and connect the device to it I've not any problem.
    But after, if I want disconnect the device from the iap I can't use RConnection::Close because as soon I connect to it others applications start to use it also if I don't want (I think it because Close doesn't work) and RConnection::Stop require NetworkControl.
    Is there a way to start a private connection that only my application can use, where I can start and stop the connection without NetworkControl?
    Last edited by andrea993; 2013-01-17 at 10:41.

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

    Re: Connect to a wlan iap

    Quote Originally Posted by andrea993 View Post
    But after, if I want disconnect the device from the iap I can't use RConnection::Close because as soon I connect to it others applications start to use it also if I don't want
    This is not nice, i would take a deeper look into those apps ;-) Or change their settings if possible.

    Quote Originally Posted by andrea993 View Post
    (I think it because Close doesn't work) and RConnection::Stop require NetworkControl.
    As Wizard already mentioned, Close() is nicer than Stop(): Close() closes the connection if no one else (no other app) is using it, Stop() forces a brutal disconnection for all, that's why it requires higher caps.
    Quote Originally Posted by andrea993 View Post
    Is there a way to start a private connection that only my application can use, where I can start and stop the connection without NetworkControl?
    hmmm... while looking at these things sometime ago, i found that somewhere into iap database there's a field that let's you specify the id of the app that can use the IAP.... but it wasn't my need so i didn't test it..... if i can find the link again i'll post it

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

    Re: Connect to a wlan iap

    Quote Originally Posted by pavarang View Post
    hmmm... while looking at these things sometime ago, i found that somewhere into iap database there's a field that let's you specify the id of the app that can use the IAP.... but it wasn't my need so i didn't test it..... if i can find the link again i'll post it
    Excellent!!
    Maybe is this: IAP_APPSID?

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

    Re: Connect to a wlan iap

    Quote Originally Posted by andrea993 View Post
    Excellent!!
    Maybe is this: IAP_APPSID?
    Yes! I've put it into my OpenGrok but i couldn't find any useful example, maybe it's not even taken into consideration by connection manager....
    but you could try.. just write into it the sid of your app and see what happens when you try to use it from your app and from another app (web browser for example)
    good luck :-)

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
  •  
×