views:

148

answers:

1

Hello

I'm developing a Win32 mobile application (.NET CF 2.0/3.5) that has to communicate with a WebService. The mobile computer will be used in places called "Dispatch" where good WLAN coverage is provided and company offers its own AP with defined SSID name. This means that the mobile computer must use those APs (knowing their SSID name) for Internet connection. The other use of mobile computer is by driver. In that case to commuicate with WebService, GPRS/EDGE connection must be used because of lack of WIFI access. I want to provide a way of "intelligent connection management" in my application so that the mobile computer detects if there is a known SSID (WIFI) and then connects to it and WebService communication is established through this connection. If no WIFI is in range, the mobile computer connects through GPRS/EDGE via the GSM ISP. How to approach this by using .NET CF and/or Win32 API?

Regards

+1  A: 

Use the Connection Manager API to let Windows automatically determine the best connection to use based on available connections. It will always use the Wi-Fi connection if it is available. If there is no Wi-Fi connection available then it will use the GPRS/EDGE connection. There is a C# wrapper for ConnMgr in OpenNETCF.

You can programatically configure your Wi-Fi and GPRS connections using the DMProcessConfigXML function with some XML data. See CM_GPRSEntries Configuration Service Provider and the Wi-Fi Configuration Service Provider. Example XML is included at the bottom of the links.

Trevor Balcom