Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory

Keywords: Match:
Making GPRS connections in Windows CE 6.0
by K. Ashok Babu and R. Vinoth (Sep. 25, 2007)

Foreword: This technical whitepaper explains how to achieve GPRS connectivity by means of Windows CE 6.0's dial-up networking functionality. It includes snippets of the required settings and provides screenshots that illustrate the connection process on the device.



Windows CE 6.0 GPRS connectivity through dial-up networking

by K. Ashok Babu and R. Vinoth


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.


Figure 1: How RIL exposes proxy devices to the application developer
(Click image to enlarge)

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.


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.

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"="ATcr"
"2"="ATE0V1&C1&D2cr"

[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"="ATcr"

[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:

;************************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 components)
  • Telephony API (TAPI 2.0) (Including all the sub components)

Run Time steps to connect the GPRS through the dial-up 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:


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:


Figure 4: Make New Connection

Select "Hayes compatible on COM1" as a modem diver in the "select a modem" option, and click the "Configure" button. Figure 5 shows this step.


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 5 shows these tabs.


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.


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.


Figure 8: Phone number

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


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.


Figure 10: Connect to GPRS



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.



About the authors:

Ashok Babu is a Program Manager at e-con Systems in Chennai, India. His software specialities include developing Windows device drivers and designing Video codecs, and he also has hands-on experience in both Windows CE and Windows Mobile. He holds a Bachelor of Engineering, and his hobbies include music, soccer, and debugging. You can reach him by email, at "ashok at e-consystems dot com."

R. Vinoth is a Technical Lead at e-con Systems in Chennai, India. His software specialities include porting/building Windows CE BSPs to new platforms. Vinoth holds a Master of Sciences Degree in Software Engineering, and his hobbies include singing and composing classical south Indian carnatic songs. He can be reached at "vinoth at e-consystems dot com."



Related stories:

(Click here for further information)


Windows XP for Embedded Applications
This white paper describes the benefits of using Windows XP when developing embedded applications.

A Manager's Guide to Selecting a Mobile Device Operating System
This white paper offers a comparative review of Microsoft Windows CE and Windows Mobile.

Visual Basic 6.0 to .NET Migration
This paper focuses on the methodology and techniques which Infosys (Microsoft Technology Center) has developed for migrating VB 6.0 Applications to .NET. Our approach ensures a smooth, cost effective, and efficient migration.

Mobile Device Security: Securing the Handheld, Securing the Enterprise
This whitepaper identifies security threats to corporate data on mobile devices and details how mobile devices can become a "backdoor" to the enterprise.

Mobile Device Security: The Eight Areas of Risk
It's common knowledge that adding mobile devices to your network increases security risks. There are multiple facets to mobile security, all of which should be paid close attention to. This E-Guide presents a more in depth look into the eight key areas of securing wireless devices.

Quality Assurance and .NET
This paper discusses best practices for functional, regression and load testing of .NET applications.

SCADA Security in Integrated Networks
As businesses leverage their SCADA systems by integrating them into the business networks, they must also assure the security of the SCADA system.

The Advantages of Small Form Factor HMI
HMIs have mutated and changed with new requirements, and they have become more flexible and capable. And while they've been doing that, they've become smaller and more useful.

9 Critical Requirements for Web Application Security
Learn why your Web applications expose dangerous security breaches and what’s required to effectively protect your Web applications and the sensitive information behind them.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Updated! The latest Windows-powered...

mobile phones!

other cool
gadgets

HOT TOPICS
Microsoft targets PNDs with new embedded OS
Microsoft tips .NET MF 3.0 highlights
Microsoft previews Windows Embedded Standard
Microsoft offers free Windows CE 6.0 textbook
Microsoft renames embedded operating systems
Microsoft unveils Windows Mobile 6.1
New Atom models target low-cost PCs
REFERENCE GUIDES
Windows Device Showcase
Intro to Windows Embedded
Intro to Shared Source
Real-time Windows Embedded
Windows Embedded books
Join our Windows Embedded discussion forums:
Windows XP Embedded
Windows CE
Windows Mobile


Windows Embedded developer newsgroups
Windows CE
XP Embedded
PocketPC
Smartphone

Microsoft's Windows Embedded resources
Embedded dev center
Mobile dev center
Windows CE tutorials
XP Embedded tutorials
Windows Embedded seminars
Windows Embedded application categories
3rd-party partners


BREAKING NEWS

• Cortex-A8 SBCs target signage and kiosks
• Student competition offers a different kind of fireworks
• Windows CE SBC targets HMI development
• All-you-can-eat carrier launches -- sort of
• Adeneo and IntervalZero promote "soft-control" architecture
• App creates virtual serial ports in Windows CE
• Windows satellite phone service takes off (literally)
• Bsquare and Microsoft renew key distribution agreement
• Software syncs HTC phones with Macs
• Electricity meter runs Windows, talks to Google
• Windows device is two phones in one
• MIcrosoft's online store to debut with 600 Windows Mobile apps
• Windows Mobile gets upgraded Skype VoIP client
• Panel PC targets outdoor use
• Samsung shrinks ARM11 application processor


MOST POPULAR (last 90 days)
• "Netbook" uses Intel's Atom N270
• Windows CE takes on Linux in low-end netbooks
• HTC ups Touch resolution
• Microsoft unleashes new embedded OS
• Windows Mobile phone gets 800 x 480 display
• HTC spins WiMAX phone?
• Smart camera sports Atom
• Dual-core AMD netbook gets rave review
• Windows Mobile 7 "delayed"
• GPS phone uses new Marvell "Tavor" chip
MOST POPULAR (Classics from the vault)
Windows XP Embedded USB boot
Troubleshooting Windows XPe's blue screen "Stop 0x0000007B" error
Asus reveals $190 mini notebook
Windows Mobile 6 SDKs available for download
Windows Mobile VPN client plays with Cisco
HTC adds GPS to Windows Mobile Touch line
Microsoft unveils Windows Mobile 6.1
Guide to HTC's Windows Mobile smartphone platforms
• HTC releases Touch Diamond ROM upgrade
Customizing Windows XP Embedded thin clients

Also visit our sister sites:


Sign up for WindowsForDevices.com's...

news feed

Or, follow us on Twitter...



Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2009 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Windows is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries and is used by WindowsForDevices under license from owner. All other marks are the property of their respective owners. WindowsForDevices is an independent publication not affiliated with Microsoft Corporation.