How to prevent web browsing with WLAN programatically

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code Example
Source file: Media:Wlanonoff.zip
Created: mahbub_s60 (02 Jun 2010)
Last edited: hamishwillee (26 Jul 2012)


With Symbian devices, we can connect to WLAN and browse internet without restriction. But if device management want to configure devices in such a way so that WLAN, BT, IRDA, GPRS etc can't be used in company devices for security reason. How we can stop WLAN from being used? In this article, we are examining how we can prevent WLAN to browse web programmatically.

We can monitor the publish and subscribe category (KPSUidWlan) to get notification about the status of the connection. When we get the value of key either EPSWlanIndicatorActive or EPSWlanIndicatorActiveSecure then we can disconnect the connection as shown in the following code.

void CWLANPubSub::RunL()
TInt Val = -1;
if(iWlanStatusExpected == EFalse)
TInt Count = iWlanEngine->Count();
if((Val == EPSWlanIndicatorActive || Val == EPSWlanIndicatorActiveSecure) && Count > 0)
TBuf<100> bearerName(0);
for(TInt i = 0; i <Count; i++ )
TRAPD(tt, iWlanEngine->GetBearerL(i, bearerName));
if(bearerName.Compare(_L("WLAN")) == 0) // Check for other??
TRAPD(trert, iWlanEngine->StopConnectionL(i));

Some related articles

How to block IP packet with IPhook module based on IP address Removing send via Bluetooth from send menu How to prevent data sending over Infrared programatically

Code example

This code was tested with E90 (S60 3.1 platform) We need capability NetworkControl Example code be found from following link: File:Wlanonoff.zip

This page was last modified on 26 July 2012, at 06:09.
50 page views in the last 30 days.