Win32Exception using AddPreferredNetwork with WEPStatus.TKIPEnable

J

James Black

In my mobile app I have a valid adapter in
WirelessZeroConfigNetworkInterface, and when I call the function below with a
passphrase I get the error that follows, but, if I don't pass in a passphrase
and use AuthenticationMode.OPEN and WEPStatus.WEPDisabled I don't get any
errors, it appears to work.

m_Interface.AddPreferredNetwork("myssid", true, "somepass", 1,
AuthenticationMode.Shared, WEPStatus.TKIPEnabled, null);

System.ComponentModel.Win32Exception: Unable to Set WZC Interface
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean infrastructureMode, Byte[] keyMaterial, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, KeyType kt, String
wpaPassphrase, EAPParameters eapParams)
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean bInfrastructure, String sKey, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, EAPParameters eapParams)
at ICx.Plugins.WiFiPlugin.AddPreferredAccessPoint(String ssid, String sKey)


I am curious what I may be doing wrong. Should I be generating the key from
the passphrase, or should it be done within AddPreferredNetwork?

If I should be doing it, is there is class/function to generate it?

When I go through the device's wireless setup, then the wep and auth
settings above match what I do manually, and that works.

Thank you.
 
J

James Black

I tried version 2.3.0.21 and I get this error:
2/13/2009 8:39:28 AM: trying to add adapter:
System.ComponentModel.Win32Exception: Unable to Set WZC Interface
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean infrastructureMode, Byte[] keyMaterial, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, KeyType kt, String
wpaPassphrase, EAPParameters eapParams)
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean bInfrastructure, String sKey, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, EAPParameters eapParams)


Is there a function to convert my passphrase to the key byte representation?

Thank you.

Chris Tacke said:
There's a bug in the AddPreferredNetwork method. A fix will be out next
week.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

James Black said:
In my mobile app I have a valid adapter in
WirelessZeroConfigNetworkInterface, and when I call the function below
with a
passphrase I get the error that follows, but, if I don't pass in a
passphrase
and use AuthenticationMode.OPEN and WEPStatus.WEPDisabled I don't get any
errors, it appears to work.

m_Interface.AddPreferredNetwork("myssid", true, "somepass", 1,
AuthenticationMode.Shared, WEPStatus.TKIPEnabled, null);

System.ComponentModel.Win32Exception: Unable to Set WZC Interface
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean infrastructureMode, Byte[] keyMaterial, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, KeyType kt, String
wpaPassphrase, EAPParameters eapParams)
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean bInfrastructure, String sKey, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, EAPParameters
eapParams)
at ICx.Plugins.WiFiPlugin.AddPreferredAccessPoint(String ssid, String
sKey)


I am curious what I may be doing wrong. Should I be generating the key
from
the passphrase, or should it be done within AddPreferredNetwork?

If I should be doing it, is there is class/function to generate it?

When I go through the device's wireless setup, then the wep and auth
settings above match what I do manually, and that works.

Thank you.
 
J

James Black

I used 2.3.0.21 and I get this error now:
2/13/2009 8:39:28 AM: trying to add adapter:
System.ComponentModel.Win32Exception: Unable to Set WZC Interface
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean infrastructureMode, Byte[] keyMaterial, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, KeyType kt, String
wpaPassphrase, EAPParameters eapParams)
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean bInfrastructure, String sKey, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, EAPParameters eapParams)


Is there a function to convert the string key to a byte representation?

Thank you.

Chris Tacke said:
There's a bug in the AddPreferredNetwork method. A fix will be out next
week.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

James Black said:
In my mobile app I have a valid adapter in
WirelessZeroConfigNetworkInterface, and when I call the function below
with a
passphrase I get the error that follows, but, if I don't pass in a
passphrase
and use AuthenticationMode.OPEN and WEPStatus.WEPDisabled I don't get any
errors, it appears to work.

m_Interface.AddPreferredNetwork("myssid", true, "somepass", 1,
AuthenticationMode.Shared, WEPStatus.TKIPEnabled, null);

System.ComponentModel.Win32Exception: Unable to Set WZC Interface
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean infrastructureMode, Byte[] keyMaterial, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, KeyType kt, String
wpaPassphrase, EAPParameters eapParams)
at
OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface.AddPreferredNetwork(String
SSID, Boolean bInfrastructure, String sKey, Int32 keyIndex,
AuthenticationMode authMode, WEPStatus privacyMode, EAPParameters
eapParams)
at ICx.Plugins.WiFiPlugin.AddPreferredAccessPoint(String ssid, String
sKey)


I am curious what I may be doing wrong. Should I be generating the key
from
the passphrase, or should it be done within AddPreferredNetwork?

If I should be doing it, is there is class/function to generate it?

When I go through the device's wireless setup, then the wep and auth
settings above match what I do manually, and that works.

Thank you.
 
Top