lungic
lungic

Reputation: 344

Windows Mobile 6.1, Test for WI-FI access

I'm developing a software for Windows Mobile 5.0, 6.1, 6.5 that is using a range of different PDA:s. But I've yet to find a robust way to wait for the WI-FI to wake up properly. Sometimes the WI-FI device just hangs, and you need to reboot the pda, which obviously isn't what you want. Usually if you're simply patient enough and waits for the pda to wake properly and access the network it won't hang.

Is there a proper way of checking that the wi-fi is available before trying to use it? Preferably a generic method that works with a range of manufacturers (Intermec, Symbol, Datalogic and Opticon).

The way we're doing it today is more or less trying to resolve our own name by DNS.GetHostName() and waiting until 127.0.0.1 responds.

Any suggestions are greatly appreciated. Blocking or Asynchronous calls are both welcome.

Upvotes: 0

Views: 1282

Answers (3)

Robbie Dee
Robbie Dee

Reputation: 1977

All our wireless software uses webservices. We just build in a simple method to each webservice called IsConnected that returns true. If we get an exception back from this, we know there is a problem with our wifi.

Upvotes: 0

neerajMAX
neerajMAX

Reputation: 269

if you are using devices which are SYMBOL based, then by using Symbol.WirelessLAN or Symbol.Fusion dll you can cheack whether your wifi is woke up or not. these dlls provide you signal strentgh of wifi. and show none or 0% when wifi is not connected.

Upvotes: 1

josef
josef

Reputation: 5959

as all OEMs use different custom WiFi drivers or security supplicants (like Odyssey or others instead of MS Security) and not all use ZeroConfig you need a general approach.

One option is using the System State notifications for network. But in the past I found that these are unreliable. The same was with using connection manager (CM). CM does sometimes report a working connection where there is no one. Has to do something with caching or so.

Checking a working connection is possible using a ping. A ping verifies that the stack is usable and that the host is reachable. Other options, as for example checking the WiFi access point association or the local IP address does not really mean you can reach the host you need.

On my web site is an easy to use background worker class that implements a ping as example for a blocking function: http://www.hjgode.de/wp/2010/06/01/mobile-development-easy-to-use-background-thread-with-gui-update/

In your main code you start the background thread, subscribe to its event and you will get the event fired, when the ping has finished. Then you can check the response (number of pings returned) and start or wait your action to your host.

Remember to include some logic for suspend/resume of the device. The WiFi is normally switched off for suspend and you need to restart your logic to access your host.

Upvotes: 0

Related Questions