views:

87

answers:

1

Is it possible to switch between WiFi networks in WM 6 and .NET CF v3.5 ?

I'm writing a .NET Compact Framework v3.5 app for a Windows Mobile 6 device. I'd like to be able to switch between 2 different WiFi networks via C#. The first network is an Ad-Hoc wireless network with another device close by, and the second network is any other available WiFi network as configured in the Windows Mobile device (usually it will be a public/corporate WiFi with a known SSID)

The scenario I'm after is to do the following via C#/.NET code on the windows mobile device:

  1. Establish Ad-Hoc WiFi connection to another device
  2. Communicate with other device for a while
  3. Drop the Ad-Hoc connection and check if there's another WiFi network available that has public Internet access (i.e. can I get a reply from http://www.google.com or something like that)
  4. Connect to the available network in the previous step #3
  5. Send/receive some data over the public internet
  6. Drop the "public" network and reconnect to the Ad-Hoc network from step #1
+1  A: 

OpenNETCF has a class for handling wireless networks. Look for the OpenNETCF.Net.NetworkInformation namespace, and the WirelessNetworkInterface class.

MusiGenesis