Configure wireless network connection programmatically?

T

Tomppa

Is it possible to configure a wireless network connection programmatically
in CF 2.0

Our product will have Ethernet and Wireless 802.11.

We would like to provide a web page for configuration so the user does not
have to connect a mouse and keyboard to set up wireless options.
 
P

Paul G. Tobey [eMVP]

That's a *very* big job. Think about all of the possible configuration
options for wireless: WEP keys, open/shared keys, automatically-generated
keys or manually-entered keys, if the access points aren't broadcasting
their SSID values, the user would need to enter those, WPA (two types, TKIP
and PSK, which requires the entry of a key), and then there's the
authentication stuff EAP-TLS, PEAP, etc., etc.

OK, so convinced yet? I assume that, since you're talking about a Web page,
you're planning to have a Web server on the device, right? And, when the
guy wants to configure the unit, he has to plug in wired Ethernet, configure
the wireless stuff, then allow wireless to connect and check that? How is
the Web server going to make something in .NET CF 2.0 happen? I don't
recall the Windows CE Web server having the ability to be extended using
managed code.

Convinced now? Well, it is possible. The best reference to the actual
wireless API is probably going to be the source code for the WZCTool that
comes with Windows CE itself. If you are building this device, you should
find it in Platform Builder's folder structure at
PUBLIC\COMMON\OAK\DRIVERS\NETSAMP\WZCTOOL. There's no actual written
documentation of the API, but we've wrapped some of the things that it can
do in OpenNETCF's SDF, www.opennetcf.org. There's not enough stuff there,
probably, to write a complete configurator, but there are some things that
you'll need to call in native code wrapped in managed code, at least.

An alternative method of doing this, since you're planning to force the guy
to plug in wired Ethernet anyway, is to include the Remote Display utility
in the device OS and ship the matching PC side of that utility. When the
remote display utility runs, it allows the matching program on the PC to
remotely see the screen of the device, sending keyboard and mouse actions to
the device, etc. If you did that, you'd just have to find a way to
configure what PC the device will talk to, which is a much easier thing to
accomplish with a Web page (just launch "cerdisp.exe -c" after writing the
IP address of the target PC to the right spot in the registry). In that
case, the full Windows CE wireless configuration API is available with no
coding from you (except to save the IP to the registry). Much easier and
much easier to maintain, if MS changes something.

Paul T.
 
T

Tomppa

I see under OpenNETCF.NET.Adapter Class.Methods there is
SetWirelessSettings.

Basically I want to be able to configure a set top box to use the wireless
interface where the user would 1st plug it into ethernet to get to the
device to do this.

SSID WEP and so forth. If it goes beyond the basic config they could plug
in a keyboard and mouse but I really want to avoid that.

Will this method suffice?
 
P

Paul G. Tobey [eMVP]

Again, there is still the issue of how you're going to get a Web server to
execute your managed code, but it might work, yes. If you only support WEP,
though, it's going to limit your ability to support a secure network.
Whether it will suffice or not is up to your customers...

Paul T.
 
P

Paul G. Tobey [eMVP]

I believe that it's just a sample program (which you can use anywhere), but
the licensing check program should be able to tell you...

Paul T.
 
P

Paul G. Tobey [eMVP]

I can help a little. Our Telnet server and serial port configuration
program both allow the default remote host IP to be set and both allow the
cerdisp program to be launched (again, -c causes it to connect automatically
to the pre-configured IP in the registry).

#define CERDISP_BASE_KEY_NAME _T( "Software\\CERDisp" )
#define CERDISP_HOST_VALUE_NAME _T( "HostName" )

The HostName REG_SZ value is the IP (or name), of the PC to connect to.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top