Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

WLAN State

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-13-2009, 09:05 AM
Knows the basics
 
Join Date: Mar 2008
Location: germany, Heidelberg
Posts: 90
Default WLAN State

Hi,

this is my way to detect the Wlan-state. It works only on devices!
Tested for WM5.0 and WM6.5
.
.
.
reg.New1
reg.RootKey(reg.rtLocalMachine)
.
.
x=getWlanState

If x = 0 Then
Msgbox(" no WlanCard!",cMsgboxOK,cMsgboxAsterisk)
End If

If x = 1 Then
Msgbox(" Wlan is disabled!",cMsgboxOK,cMsgboxAsterisk)
End If

If x = 19 Then
Msgbox(" Wlan is OK!",cMsgboxOK,cMsgboxAsterisk)
End If
.
.
.

Sub getWlanState
'HKEY_LOCAL_MACHINE\System\State\Hardware\Wifi (0 not present, 1 disabled, 19 enabled)
wlan=0
If cPPC Then
regnames() = reg.GetValueNames("System\State\Hardware\")
For i = 0 To ArrayLen(regnames())-1 'Show all values found
If regnames(i)="Wifi" Then
wlan = reg.GetValue("System\State\Hardware\", "Wifi")
End If
Next
End If
return wlan
End Sub
Reply With Quote
  #2 (permalink)  
Old 08-13-2009, 11:31 AM
ghale's Avatar
Basic4ppc Veteran
 
Join Date: Dec 2008
Location: Earth, Europe, Italy, Puglia, Lecce
Posts: 219
Default

Very good!

Thanks!
__________________
My Creatures of the Night!
Reply With Quote
  #3 (permalink)  
Old 08-13-2009, 04:07 PM
taximania's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Just for the record.

x=23 for 'Wlan is on', on my WM6.1 Pro O2-XDA Orbit
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk
Reply With Quote
  #4 (permalink)  
Old 08-13-2009, 04:42 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

From Googling around

> 0 - powered off
> 1 or 5 - ready
> 11 or 15 - connecting
> 19 or 23 - connected

There was a suggestion that the offset of 4 might indicate ActiveSync is connected (or then again it might not!).

Also you should be able to get the following system state notifications from my SystemState library.

WiFiStateConnected
WiFiStateConnecting
WiFiStateHardwarePresent
WiFiStateNetworksAvailable
WiFiStatePowerOn
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TreeView State marathon332 Questions (Windows Mobile) 4 06-17-2009 09:30 PM
file copy via WLAN krausebert Questions (Windows Mobile) 2 06-06-2009 06:30 AM
Nível do sinal WLAN pavieira Portuguese Forum 1 04-22-2009 12:35 PM
Check the state of a relay or a switch chr Questions (Windows Mobile) 1 09-19-2008 05:31 PM
WLAN communication WolfgangGruia Questions (Windows Mobile) 24 08-02-2008 07:02 PM


All times are GMT. The time now is 10:34 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0