in Search

Configuring WiFi connectivity via cab file

Last post 08-20-2008 5:06 AM by pauldiston. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-25-2008 11:22 AM

    • CRC
    • Top 50 Contributor
    • Joined on 05-08-2008
    • Australia
    • Posts 44
    • Points 475
    • 1_colleague
      Small Business Specialist
      Specialist

    Configuring WiFi connectivity via cab file

    Some of this was copy and pasted from DavidC's tutorial on configuring exchange via a cab file to standardise things in this forum.

    Wifi connectivity on supported Windows Mobile 5, 6 & 6.1 devices can use the CSP provided to configure the device automatically. 

    The XML:

    <characteristic type="CM_WiFiEntries">
      <characteristic type="Your SSID">
        <parm name="DestID" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
      </characteristic>
    </characteristic>

    <characteristic type="Wi-Fi">
      <characteristic type="access-point">
        <characteristic type="Your SSID">
          <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
          <parm name="Encryption" value="0"/>
          <parm name="Authentication" value="0"/>
          <parm name="Hidden" value="0"/>
          <parm name="KeyProvided" value="0"/>
          <parm name="NetworkKey" value="your network key"/>
          <parm name="KeyIndex" value="1"/>
          <parm name="Use8021x" value="0"/>
        </characteristic>
      </characteristic>
    </characteristic>

    There are a couple of values that you will want to change to suit your network environment.

    Firstly, DestID. This tells the device if this network is "Work Network" or "The Internet". The possible values are {436EF144-B4FB-4863-A041-8F905A62C572 for The Internet, or {A1182988-0D73-439e-87AD-2A5B369F808B} for Work Network.

    Encryption can be one of the following values to suit your network:

    0 = Encrypt using 802.11 wired equivalent privacy (WEP) key.
    1 = No encryption.
    4 = Encrypt using Temporal Key Integrity Protocol (TKIP) sequence counters.
    6 = Encrypt using Advanced Encryption Standard (AES).

    Authentication can be any of the following:

    0 = Open Network
    1 = Shared Network
    3 = WPA
    4 = WPA-PSK
    5 = WPA-NONE
    6 = WPA2
    7 = WPA2-PSK

    Put this into NOTEPAD.  We cannot have any text formatting on this, so word is out of the question, just straight notepad.
    Save this as _setup.xml from the notepad save as menu. If you can't save as xml, then change the file extension after you save it as a .txt.

    The name of the file - _setup.xml is important.


    You can change around the below instructions, but this should make it easier for people who are new to compiling cabs

    1. Save your _setup.xml to a directory called C:\Cabs\   on your computer.
    2. Now open up a command prompt window Start>Run>cmd.
    3. Type cd C:\Cabs in the command prompt window
    4. Type MakeCAB.exe /D COMPRESS=OFF _setup.xml Wifi.cab


    Now you will have an Wifi.cab file in your C:\Cabs directory.
    Launch this on your device and the settings will be provisioned.

    • Post Points: 15
  • 05-25-2008 4:02 PM In reply to

    • davidc
    • Top 25 Contributor
    • Joined on 05-02-2008
    • Sydney
    • Posts 290
    • Points 3,439
    • 2_advocate
      Small Business Specialist
      Specialist

    Re: Configuring WiFi connectivity via cab file

    Awesome,

    Wifi is a handy one to have too.  

    Current Devices - HTC Touch Pro : Samsung Omnia : HTC Advantage : i-mate 801-f
    - Ask me about these devices
    • Post Points: 10
  • 06-25-2008 3:49 AM In reply to

    Re: Configuring WiFi connectivity via cab file

    Hi,

     I was wondering whether it is possible via the XML to provision the device in such a way that the config can be as follows :-

    Encryption - WPA TKIP

    EAP Type - PEAP-MSCHAP

    Credentials - Username and Password

    Thanks in advance.

     Paul Diston

    • Post Points: 15
  • 06-25-2008 6:33 AM In reply to

    • Laura Rooke
    • Top 10 Contributor
    • Joined on 03-27-2008
    • Northern California
    • Posts 4,274
    • Points 42,228
    • 4_ambassador
      Microsoft Windows Mobile MVP
      Moderator
      Small Business Specialist
      Specialist

    Re: Configuring WiFi connectivity via cab file

    Welcome Paul.

    Though I shall have to leave the answer to David or CRC or one of our other developer contributers.

    Laura Rooke
    MVP - Mobile Devices
    My Devices..........
    IPAQ 3650
    IPAQ 5450
    IPAQ 4700
    IPAQ 2795
    Jasjar
    Motorola Q
    T-Mobile Dash
    AT&T TILT
    Advantage 7510
    HTC Pure
    HTC Diamond2
    Motorola Backflip
    • Post Points: 5
  • 06-25-2008 3:43 PM In reply to

    • CRC
    • Top 50 Contributor
    • Joined on 05-08-2008
    • Australia
    • Posts 44
    • Points 475
    • 1_colleague
      Small Business Specialist
      Specialist

    Re: Configuring WiFi connectivity via cab file

    EAP is configured by the "EAPType" XML element.

    The allowed values are:
    13 - Smart Card or Certificate (EAP-TLS)
    25 (default) - Protected EAP (PEAP)

    That being said, I haven't found a way to supply a username and password via XML - someone else may have that information however...

    • Post Points: 5
  • 06-25-2008 4:27 PM In reply to

    • yrless
    • Top 10 Contributor
    • Joined on 05-02-2008
    • Central Ohio
    • Posts 1,192
    • Points 11,711
    • 3_expert
      Microsoft Windows Mobile MVP
      Moderator User
      Small Business Specialist
      Specialist

    Re: Configuring WiFi connectivity via cab file

    Great job CRC!!

    Trent L. McMurray - MVP Mobile Devices
    LAMARCOMM, LLC
    "Mobility Simplified"
    www.lamarcommllc.com
    • Post Points: 10
  • 07-17-2008 5:42 AM In reply to

    Re: Configuring WiFi connectivity via cab file

    Hi,

     I am trying to extract the Wi-Fi settings from my Windows Mobile 6 device using the following XML :-

    <wap-provisioningdoc>
        <characteristic-query type="Wi-Fi" recursive="true"/>
    </wap-provisioningdoc>

    http://msdn.microsoft.com/en-us/library/aa456174.aspx

    And the following C# code :-

    string xml = ReadXMLFile(@"\Temp\WPA.xml");

    string output = ConfigWrapper.ProcessXml(xml, ConfigFlag.Metadata);

    using System;

    using System.Runtime.InteropServices;

    namespace WPAConfigTester

    {

    public enum ConfigFlag : uint

    {

    /// <summary>

    /// The configuration management service and the

    /// Configuration Service Providers (CSPs) process

    /// the input data.

    /// </summary>

    Process = 1,

    /// <summary>

    /// The configuration management service gathers

    /// and returns metadata for any XML parm elements

    /// it encounters.

    /// </summary>

    Metadata = 2

    }

    /// <summary>

    /// The code was taken directly from

    /// http://www.smartphonethoughts.com/articles.php?action=expand,4397

    /// </summary>

    public class ConfigWrapper

    {

    [
    DllImport("aygshell.dll")]

    private extern static UInt32 DMProcessConfigXML(string xmlIn, UInt32 flag, out IntPtr xmlOutPtr);

    [DllImport("coredll.dll")]

    private extern static IntPtr LocalFree(IntPtr hMem);

    public static string ProcessXml(string xml)

    {

    return ProcessXml(xml, ConfigFlag.Process);

    }

    /// <summary>

    /// This function wraps acts as a managed interface to the

    /// DMProcessConfigXML in Pocket PC 2003+ and Smartphone 2002+

    /// The DMProcessConfigXML function grants remote access to the

    /// configuration management functionality of the mobile device.

    /// This function enables the submission of Extensible Markup

    /// Language (XML) information that causes the settings of a

    /// mobile device to change. See "Configuration Service Providers"

    /// in the API for details on the XML schema.

    /// </summary>

    /// <param name="xml">

    /// String of valid XML containing configuration data

    /// </param>

    /// <param name="flag">

    /// Action flag (see ConfigFlag for details)

    /// </param>

    /// <returns>

    /// String of valid XML containing the result of this operation

    /// </returns>

    public static string ProcessXml(string xml, ConfigFlag flag)

    {

    IntPtr xmlOutPtr;

    string xmlOutStr;

    long result;

    result = DMProcessConfigXML(xml, (uint)flag, out xmlOutPtr);

    // marshal the output string

    xmlOutStr = Marshal.PtrToStringUni(xmlOutPtr);

    // free the memory allocated by the API

    LocalFree(xmlOutPtr);

    // throw an exception if an error code was returned

    if (result != 0)

    {

    throw new ArgumentException(String.Format("DMProcessConfigXML returned error code {0}", result),

    xml);

    }

    return xmlOutStr;

    }

    }

    }

     However each time I run this code all I get back is whatever XML I pass into the ProcessXml method.

    Please could someone shed some light on this.

    Thanks in advance.

    Paul Diston

    • Post Points: 10
  • 07-24-2008 3:01 PM In reply to

    Re: Configuring WiFi connectivity via cab file

    Hi, pauldiston! Did you ever figure out an answer to your code question? We do have a few technical experts here - could you have stumped them? Anyone? Thanks!

     

    • Post Points: 10
  • 08-20-2008 5:06 AM In reply to

    Re: Configuring WiFi connectivity via cab file

    Hi,

    I have not found an answer yet to this, I will spend some more time on this and hopefully come up with a solution.

    Thanks

    Paul Diston

    • Post Points: 5
Page 1 of 1 (9 items)
  * SHARE YOUR FEEDBACK ABOUT THE SITE USING OUR NEW FEEDBACK FORM *