×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    wlan blocked by scanning with WLanMgntClient

    I am trying to scan the available Wlan APs with their signal strengthes every 10 seconds by using the SDK Plugin WLanMgntClient.

    But I found out, that my device's wlan will be blocked after some time. My program is blocked by the scan-point, the on-board wlan-scan doesn't work, ether. web browser not work (blocked at connecting to access point dialog).


    I would like to ask, if somebody has the same problem like me by scanning the wlan aps?!!

    I am using Nokia N95 with the original firmware on it.


    SDK 3rd FP1 and the newst Open C


    Thanks.

    Pai

  2. #2
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    107

    Re: wlan blocked by scanning with WLanMgntClient

    Hi,

    Indeed there is a problem with the WLAN Info API. I am troubble shooting it for 4 days now. I didn't find a solution yet.

    I am using this code:
    Code:
    /**
     * Constants for XML representation
     */
    _LIT(KXMLWNETTag, "<Network id=\"%d\">");
    _LIT(KXMLWNETEndTag, "</Network>");
    _LIT(KXMLWLANSecurityTag, "<Security>");
    _LIT(KXMLWLANSecurityEndTag, "</Security>");
    _LIT(KXMLWLANTypeTag, "<WLANType>");
    _LIT(KXMLWLANTypeEndTag, "</WLANType>");
    _LIT(KXMLBSSIDTag, "<BSSID>");
    _LIT(KXMLBSSIDEndTag, "</BSSID>");
    _LIT(KXMLSSIDTag, "<SSID>");
    _LIT(KXMLSSIDEndTag, "</SSID>");
    _LIT(KXMLWLANStrengthTag, "<WLANStrength>");
    _LIT(KXMLWLANStrengthEndTag, "</WLANStrength>");
    
    void CWLANInfo::GetWLANInfo(TDes &infoBuff)
    {
    	infoBuff.Zero();
    	if(iWLANMgmtClient == NULL || iScanInfo == NULL)
    		return;
    	
    	TInt securityMode;
    	TInt i=1, k;
    	TBuf<36> bss;
    
    	_LIT(KOPEN, "Open");
    	_LIT(KWEP, "WEP");
    	_LIT(K802, "802d1x");
    	_LIT(KWPA, "WPA");
    	_LIT(KINFRA, "Infrastructure");
    	_LIT(KADHOC, "Ad-hoc");
    	_LIT(KBSSIDFormat, "%02X:");
    	_LIT(KSSIDUnknown, "SSID Unknown");
    
    	for(iScanInfo->First(); !iScanInfo->IsDone(); iScanInfo->Next() )
    	{
    		infoBuff.AppendFormat(KXMLWNETTag, i);
    		i++;
    		
    		infoBuff.Append(KXMLWLANSecurityTag);
    		securityMode=iScanInfo->SecurityMode();
    		if(securityMode==EwlanConnectionSecurityOpen)
    			infoBuff.Append(KOPEN);
    
    		else if(securityMode==EwlanConnectionSecurityWep)
    			infoBuff.Append(KWEP);
    		else if(securityMode==EwlanConnectionSecurity802d1x)
    			infoBuff.Append(K802);
    		else if(securityMode==EwlanConnectionSecurityWpa)
    			infoBuff.Append(KWPA);
    		infoBuff.Append(KXMLWLANSecurityEndTag);
    
    		//In general if the least significant bit of the capbility field 
    		//is 1 then the network is of "Infrastructure Type" or else if the 
    		//capability field is 0 then the network is of "Ad-hoc type"
    		infoBuff.Append(KXMLWLANTypeTag);
    		TUint16 capability=iScanInfo->Capability();
    		TInt pad(1);
    		TInt lanType=capability & pad;
    
    		if(lanType==1)
    			infoBuff.Append(KINFRA);
    		else
    			infoBuff.Append(KADHOC);
    		infoBuff.Append(KXMLWLANTypeEndTag);
    		
    		infoBuff.Append(KXMLBSSIDTag);
    		//Retrieve BSSID
    		TWlanBssid bssid;
    		iScanInfo->Bssid( bssid );
    		bss.Zero();
    		for(k = 0; k < bssid.Length(); k++)
    			bss.AppendFormat(KBSSIDFormat, bssid[k]);
    		//remove last :
    		bss.Delete(bss.Length()-1, 1);
    		infoBuff.Append(bss);
    		infoBuff.Append(KXMLBSSIDEndTag);		
    		
    		infoBuff.Append(KXMLWLANStrengthTag);
    		//Get transmision level
    		TInt8 rxLevel = iScanInfo->RXLevel();
    		infoBuff.AppendNum(rxLevel);
    		infoBuff.Append(KXMLWLANStrengthEndTag);
    		
    		infoBuff.Append(KXMLWNETEndTag);
    	}
    }
    The line in red is ok, I mean that WLAN Info API retrieves the information without problems, but the problem is in this code somewhere as my phone crashes randomly but always. I mean that it doesn't crash everytime I use the function, but only sometimes. Anyway, if I try to call the function for lets say 10 times it surely crashes. Sometimes it just crashes (without any error) and sometimes the phone gets restarted. I am using Nokia N95.

    paipeng, are you using aprox. the same code as me?

    If someone knows what is the problem please advice, it would be very helpful. Also... as I posted before, the guys from Nokia forgot to put a Cancel routing for the asynchronous version of GetScanResults.

    If I discover the problem I'll say.

    Thanks,
    Omar
    Last edited by omarfr; 2008-04-10 at 21:36.

  3. #3
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: wlan blocked by scanning with WLanMgntClient

    yes, i am using the similar codes.


    I am using RConnectionMonitor to get the signalstrength of connected AP during period the WLan scan.

    And I think, the problem is on RConnectionMonitor and WLanMgntClient together.

    Because when i don't use RConnectionMonitor, it looks like the wlan module on device doesn't block any more.
    Last edited by paipeng; 2008-04-11 at 09:20.

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    107

    Re: wlan blocked by scanning with WLanMgntClient

    I thought the same thing at first because I was also using RConnectionMonitor, but then I removed the RConnectionMonitor from my code and I still got the crash. The problem is from WLAN Info API, RConnectionMonitor works great. Only with RConnectionMonitor the application works fine but I don't have the BSSID info.

    To get signal strenght you don't need RConnectionMonitor, you can get the strenght with WLAN Info API too.

    It would be nice to know how to get BSSID with RConnectionMonitor as it behaves much better than WLANInfo API.

  5. #5
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: wlan blocked by scanning with WLanMgntClient

    With RConnectionMonitor blocks the wlan scan also after a random time.


    Has anybody the same problem by wlan scanning under Symbian 3rd Edition?

    Thanks

    Pai
    Symbian && Android && iPhoneOS

  6. #6
    Regular Contributor
    Join Date
    Jun 2007
    Location
    INDIA
    Posts
    73

    Re: wlan blocked by scanning with WLanMgntClient

    I'm using RConnectionMonitor for scannig. I didn't have any blocking problem.

  7. #7
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: wlan blocked by scanning with WLanMgntClient

    Quote Originally Posted by bytes View Post
    I'm using RConnectionMonitor for scannig. I didn't have any blocking problem.
    How long do you set the scan interval?

    I set it to 10-15 seconds.
    Symbian && Android && iPhoneOS

Similar Threads

  1. Replies: 4
    Last Post: 2009-06-09, 12:08
  2. Problems scanning WLANs
    By omarfr in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-03-25, 15:08
  3. Periodically scanning for WLAN SSIDs from Java midlet..
    By mortenlindeberg in forum Wired and Wireless interfaces (Closed)
    Replies: 2
    Last Post: 2008-02-28, 09:24
  4. How to set WLAN IAP network mode to Ad-hoc instead of Infrastructure?
    By PopAndDestroy in forum Wired and Wireless interfaces (Closed)
    Replies: 2
    Last Post: 2007-08-29, 08:04
  5. Wlan scanning module
    By bergerc in forum Symbian
    Replies: 2
    Last Post: 2007-07-20, 10:13

Posting Permissions

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