bulat-icon  Articles  
 
 

[+]  Articles

 
     
   

Windows CE 6.0 GPRS connectivity through dial-up networking

by K. Ashok Babu and R. Vinoth
 

Introduction

 
Windows CE provides two ways to obtain connectivity with a GPRS modem: by using the "cell core" function, and using "dial-up networking." Because most GPRS modems are not available with support for the Radio Interface Layer (RIL) driver required for the former of these options, dial-up networking is often what is required.

This document explains how GPRS modems can be used for dial-up networking on Windows CE 6.0-based devices. It also provides solutions to typical problems that may arise when implementing this approach.
 

GPRS connectivity

 
Cellular systems combined with GPRS are often described as 2.5G -- that is, a technology between the second and third generations of mobile telephony. GPRS provides moderate speed data transfer, by employing unused TDMA channels in, for example, the GSM system. GPRS, based on packet switching methods, is a successor to earlier circuit switch data connectivity techniques. It can provide uplink and downlink speeds of up to 50 Kbits/sec. GPRS, in turn, has more recently been supplanted by EDGE, UMTS, and other high-speed transfer technologies that offer speeds on the order of megabits per second. However, in several developing countries, such as India, GPRS is still the main method used for data transfer on mobile devices.
 

GPRS modems and the need for RIL

 
Modems have recently become quite complex, particularly due to the need for an internal multiplexer along with the device drivers required to support it. This is necessary because today's cellular modems must support multiple interfaces, such as USB, shared memory, UARTs, etc. Even when the modem is using a simple UART interface, if the interface has been configured for data, there is no way for an AT command to be passed through the interface to get status etc. There are, for example, modems that require the data connection to be disconnected and the voice connection to be started, in order to initiate voice communications in GPRS mode. Recently, modems have tended to expose multiple ports for each service, in order to support the use of voice, SMS, and data simultaneously. Internally, the modem has a multiplexer to handle this. To abstract the developer from all this complexity of handling AT commands for multiplexing etc, Microsoft has introduced Radio Interface Layer - RIL drivers that interact with the radio hardware.
 
RIL provides proxy devices or COM ports to handle each device inside the modem. Figure 1 shows how RIL exposes proxy devices to the application developer. This type of handling becomes a necessity when the user needs voice, SMS, and data to be done simultaneously and the modem supports such capabilities. An RIL driver in principle could support a proxy or virtual COM ports for voice, data, and SMS; in practice, however, an RIL driver might only support a single COM port interface with the modem.
 
How RIL exposes proxy devices to the application developer
 
Figure 1: How RIL exposes proxy devices to the application developer
top-icon

RIL vs dial-up networking

 
Some mobile Windows CE devices, such as hand-held POS (point of sale) terminals, do not require voice or SMS connectivity; instead, they simply require a data connection to obtain data from a remote server or store it to a remote server over the cellular network. In the event that a mobile terminal requires GPRS connectivity, there are two ways to manage the modem interface:

  • Connecting through RIL
  • Connecting through dial-up networking

  • Since most GPRS modems do not come with RIL drivers, it is often necessary to utilize dial-up networking. If the modems are used only for data -- and not for voice, data, and SMS -- or to get status repeatedly about the connection etc., then it is better to go with the standard dial-up networking feature of Windows CE. This is because the application only needs a single serial port connection, and does not require the use of special modem features.
     
    Connecting through dial-up networking
     
    Figure 2: Connecting through dial-up networking
    (Click image to enlarge)
     
    This article analyzes the problems and steps involved in establishing a GPRS connection using Windows CE's standard modem support for dial-up networking. The procedure to accomplish this consists of four steps:

  • Source code changes
  • Registry settings
  • Build options and OS design component selection
  • Run time steps to connect the GPRS
  •  

    Source Code Changes

     
    The GPRS connection requires a driver component in the Windows CE layer. The Universal Modem (Unimodem) is the standard 19200 baud rate modem driver used for connecting to the GPRS modem through a serial port. This driver conforms to the PC's standard 19.2Kbps serial modem driver. The Unimodem driver supports GSM modems, which support "Hayes Compatible" modem "AT commands" and data transfers.
     
    The Unimodem driver is part of the Windows CE driver package; the source code of the Unimodem driver is also available. This driver should work as provided without any changes, and should support any serial 56Kbps dialup telephone modem connected to the serial port. However, when a GPRS device is connected to the serial port, the Unimodem driver does not appear to support the new GPRS modem in the same way has supported dialup modems in the past.
     
    A timing problem arises when using GPRS. This is because GSM/GPRS modem command processing is slower than what is provided by normal PSTN (landline) dialup modems, resulting in longer response times. Consequently, a command response timeout may occur during the initialization sequence, and the connection may therefore not be established.
     
    A watch-dog timer thread running in the Unimodem driver maintains the timing counter. The driver expects an "OK" response before the watch-dog timer times out. Unfortunately, however, the timer times out in the case of GPRS.
     
    So, when an AT command is sent during the connection phase, the Unimodem driver times out the transaction well before the expected response (OK) is received. To resolve the issue, following changes has to be made to the Unimodem driver.
     
    Change the value of the INIT_WATCHDOG_TIMEOUT #define parameter to 10 times its original value.
     
    top-icon

    Registry settings and Modifications

     

    The registry settings pertaining to the GPRS connection have to be set properly in order to get the connection established successfully. The registry keys of importance are discussed in this section.

    The poor response time of the GPRS modem creates problems with the watchdog timer in the Unimodem driver, as discussed above. During some timeouts the modem is reset by the Unimodem driver. This can be overridden using the registry settings.

    In the platform.reg file the entry under the \Unimodem\Settings registry key, "Reset" = "ATZ", would result in the modem being reset. To disable this and protect the modem to preserve the previous modem settings, the following setting has to be used: "Reset" = "AT". Here is a snippet from the platform.reg file:

     

    ;**********************Overriding Unimodem settings***********************

    [HKEY_LOCAL_MACHINE\Drivers\Unimodem\Init]

    "1"="AT<cr>"

    "2"="ATE0V1&C1&D2<cr>"

    [HKEY_LOCAL_MACHINE\Drivers\Unimodem\Settings]

    "Prefix"="AT"

    "Terminator"="<cr>"

    "DialPrefix"="D"

    "DialSuffix"=";"

    "Pulse"="P"

    "Tone"="T"

    "Blind_Off"="X4"

    "Blind_On"="X3"

    "CmdSendDelay"="500"

    "CallSetupFailTimeout"="ATS7=<#><cr>"

    "Reset"="AT<cr>"

    [HKEY_LOCAL_MACHINE\Drivers\Unimodem\Config]

    "CallSetupFailTimer"=dword:B4

    Another problem that the registry settings pose pertains to the telephone dialing number and related details.

    When the components are chosen, the default registry settings will be initialized with country code and area code values that most likely won't match your application's requirements. This causes an improper number to be dialed. Obviously, the registry settings have to be modified to solve this problem. These registry settings override the default registry settings, and will accept only the local number. For GPRS, *number# will be used to establish the connection.

    In the platform.reg file, care must be taken to ensure that the correct numbers are entered. Here is an example snippet of what is contained in platform.reg:

    top-icon

    ;************************Overriding Dialing Settings***********************

    [HKEY_CURRENT_USER\ControlPanel\Dial]

    ; What is Location ID (value name) for the current location

    "CurrentLoc"=dword:0

    ; What is the next permanent location ID to be used when creating a new entry

    "HighLocID"=dword:2

    ;Default Location settings -- need to be localized

    [HKEY_CURRENT_USER\ControlPanel\Dial\Locations]

    ; Each MultiSz location (value name = PermLocationID" has :

    ; LocationName, LocalFmt, LdFmt, IntntlFmt, AreaCode, CwCode, CountryCode, & Options

    "0"=multi_sz: "Work",

    "G",

    "G",

    "G",

    "425",

    " ",

    "1",

    "0"

    "1"=multi_sz: "Home",

    "G",

    "1FG",

    "011,EFG",

    "425",

    " ",

    "1",

    "0"

    ;*****************************************************************

    Build Options and OS Design Component selection

     

    There are no special build options required, for building the "GPRS Connection through Dial Up and networking." However, the following components have to be added in order to get the "GPRS Connection through Dial Up and networking" to build properly:

  • Communication services and Networking->Networking Wide Area Network (WAN)
  • Dial Up Networking(RAS/PPP) (Including all the sub component)
  • Telephony API(TAPI 2.0) (Including all the sub component)
  •  

    Run Time steps to connect the GPRS through the Dial Up and networking

     

    This section details the steps involved in connecting to GPRS with Windows CE's dial-up networking function. Screenshots are provided, to illustrate the process.

    Since all the Dialing options are set in the registry settings, there is not much need to change the Dialing properties in the Dialing wizard that pops up when clicked on the Properties of the connection.

    Figure 3 shows the settings of the Dialing properties:

     
    Dialing Properties
    Figure 3) Dialing Properties
     

    Go to the control panel --> Network and Dial up wizard. Click "Make New Connection."
    Type the name of the connection; for example, "GPRS." Select the Connection type as the Dialup connection. Click "next" to continue. Figure 4 shows the new connection wizard:

     
    Make New Connection
    Figure 4) Make New Connection
     
    Select “Hayes compatible on COM1” as a modem diver in the “select a modem” option and click “Configure” button. Fig 5) shows this step.
     
    Select a modem
    Figure 5) Select a modem
     

    The "Device Properties" dialog box will open. Leave the port settings tab as it is, and click the "call options" tab. Figure 6 shows these tabs.

    top-icon
    Device properties

    Figure 6) Device properties

     

    In the "call option" add the special initialization command in the text box as shown in Figure 7. The original command is AT+CGDCONT=1,"IP","airtelgprs.com". This AT command may differ from one service provider to another, so be sure to check with the applicable service provider for the correct command setting.

     
    call Options

    Figure 7) call Options

     

    Click "Next" and enter the phone number, *99#, in the phone number dialog box. Figure 8 shows the phone number dialog box. Click the "finish" button.

    top-icon
    Phone Number

    Figure 8) Phone Number

     

    The new "GPRS Connection" appears in the network and connection wizard. Figure 9 shows the new connection:

     
    Network Connections

    Figure 9) Network Connections

     

    Right click the "GPRS icon" and click the "Connect" for connecting to GPRS. Figure 10 depicts this step, and Figure 11 shows that the device has connected to the GPRS network.

     
    top-icon
    Connect  to GPRS
     

    Figure 10) Connect to GPRS.

     
     
       
    Device has connected to the GPRS network Device has connected to the GPRS network

    Figure 11) Device has connected to the GPRS network

     

    Conclusion

     
    The Windows CE dial-up networking component and Unimodem driver can be efficiently used to include support for transferring data over GPRS modems in Windows CE 6.0-based systems and devices.
     
    top-icon