Just some questions. I installed on each device, a netdcu8 and a picocom2, a WLAN USB Adapter with RaLink chipset. I configured the registry to detect the stick properly and also I configured the registry so that on both devices ad-hoc mode is possible. When booting both devices, a screen pop´s up, showing me the acces points that are detected.
I can configure with this tool an adhoc connection easily and it works stable like any other network adapter.
Now I wanted to do this programmaticaly, without this tool. I was´nt able to do this. I tried to use SDF2.3 with it´s wrappers classes. There are the approbiate methods and I did it like this:
- if (networkInterface is WirelessNetworkInterface)
- {
- Debug.WriteLine("-------------Found a WirelessNetworkInterface-------------");
- if (networkInterface is WirelessZeroConfigNetworkInterface)
- {
- WirelessZeroConfigNetworkInterface wzc = (WirelessZeroConfigNetworkInterface)networkInterface;
- Debug.WriteLine(string.Format(" AssociatedAccessPoint: {0}", wzc.AssociatedAccessPoint));
- Debug.WriteLine(string.Format(" PreferredAccessPoints: {0}", wzc.PreferredAccessPoints));
- Debug.WriteLine(string.Format("-----------------------------------------"));
- foreach (OpenNETCF.Net.NetworkInformation.AccessPoint ap in wzc.PreferredAccessPoints)
- {
- Debug.WriteLine(string.Format(" Name of Preferred AccessPoints: {0}", ap.Name));
- //byte[] key = null;
- if (wzc.AddPreferredNetwork(ap.Name, false, "", 1, OpenNETCF.Net.NetworkInformation.AuthenticationMode.Open, OpenNETCF.Net.NetworkInformation.WEPStatus.WEPDisabled, null))
- {
- Debug.WriteLine(string.Format(" AddPreferredNetwork {0} ", ap.Name));
- if (wzc.ConnectToPreferredNetwork(ap.Name))
- {
and so on. I never get an error and ConnectToPreferredNetwork() gives me back a "true", telling me that it worked. So what´s wrong? I never get a connection between my 2 devices.
To make it a bit more clear to me, I have the questions:
1. Do I make a basic error the way I try to connect programmatically? Is there a better way.
2. The windows tool that pop´s up, is this the wzctool? Can I disable this in registry?
3. What is the windows zero configuration? Is this just a service that I need and is already in the kernel?
4. Is there a Windows api available, offering some more functions to do connection.
thanks