Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Connecting to a WPA-PSK network via Opennetcf

Back to Forum: Tech Off
  • User profile image
    tr0x

    Hi all,

    My application's target platform is Window Embedded CE 6.0. My application handles making WiFi connections with access points when in range. I am using the Opennetcf SDF 1.4 right now, attempting to establish a connection with a call to SetWirelessSettingsAddEx.

    This works for open access points and WEP access points, but I currently fail to associate with WPA-PSK access points. The call to WZCSetInterface returns 0, but the association to the access point fails. However I can successfully establish a connection to the access point via the WZC dialog.

    This is my call to SetWirelessSettingsAddEx:

    WZC_EAPOL_PARAMS EAPParams = new WZC_EAPOL_PARAMS();

                EAPParams.AuthData = IntPtr.Zero;
                EAPParams.AuthDataLen = 0;

                EAPParams.EapType = EAPType.EAP_TYPE_TLS;
                EAPParams.Enable8021x = true;
                EAPParams.EapFlags = EAPFlags.DEFAULT_EAPOL_STATE;

                ConnectionManager.SetWirelessSettingsAddEx("mySSID", true, 1, AuthenticationMode.Ndis802_11AuthModeWPAPSK, WEPStatus.Ndis802_11Encryption2Enabled, ConnectionManager.KeyType.WPAPassphrase, "myPassphrase", EAPParams);

    The critical call is to WZCSetInterface and is as follows:

     uint uret = WZCPInvokes.WZCSetInterface(null, INTFFlags.INTF_PREFLIST, ref entry, null);

     

    Any suggestions on how to get this working? I am not restricted to using opennetcf, any other suggestions on how to programmatically establish a connection to a WPA-PSK network would be very helpful as well.

     

    Thanks!

  • User profile image
    figuerres

    I can not help much other than to say that when i was asekd to do some stuff like this with CE 4.xx / 5.xx it was a mess....

    i will see if i have any code that may help, i did not do WPA but i did do some kind of re-connect stuff for wep and i do use the opennetcf librarys in the app.

  • User profile image
    figuerres

    Ah, what i see we finally did was just had some code that would do the shell commands

    ipconfig /release

    then wait a couple of seconds and do

    ipconfig /renew

    and then test the local ip addresses to see if it was on a valid network.

     

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.