Developers guide

Chapter 22: Wireless Wide-Area Networking
Windows Mobile 5.0 And Windows Mobile 6 Connection
Psion Teklogix Mobile Devices SDK Developers Guide 209
22.6.2 Windows Mobile 5.0 And Windows Mobile 6 Connection
For Windows Mobile operating systems, Microsoft provides the Connection Manager API. This
replaces RAS for making WWAN connections.
For more information on using the Connection Manager API, visit the following URLs:
http://msdn2.microsoft.com/en-us/library/bb416435.aspx
http://msdn2.microsoft.com/en-us/library/bb840031.aspx
http://msdn.microsoft.com/en-ca/netframework/dd296752.aspx
See also “The DbGprs.csv File” on page 209 for information that may need to be provided to com-
plete the connection.
The following example shows how to connect to the Internet using the Connection Manager:
22.6.3 The DbGprs.csv File
To make an Internet connection using either RAS or the Connection Manager a username, a pass-
word, and some other related information—such as APN, DNS, MCC, or MNC—may be needed.
Psion Teklogix provides this information in the ...\Windows\DbGprs.csv file, on every
Psion Teklogix computer that supports WWAN.
This file is in comma delimited format, so it can be easily read with a text editor or loaded into a
spreadsheet program. When you locate your WWAN service provider in this file, the most
common information types required by the provider are listed.
Note: It is recommended to wait for a Packet Service Status (see Section 22.6.4) of Wwan
AttachStateAttached before attempting a connection through Connection Manager.
Example 22.7 Connecting to the Internet using Connection Manager in C#
// pinvoke region required to access native Connection
// Manager not included here.
//
const int _syncConnectTimeout = 60000; // 60 seconds
string url = "http://msdn2.microsoft.com";
int ncache = 0;
if (status == ConnMgrStatus.Connected)
ConnMgrReleaseConnection(_connectionHandle, ncache);
Guid networkGuid = Guid.Empty;
ConnMgrMapURL(url, ref networkGuid, 0);
ConnMgrConnectionInfo info =
new ConnMgrConnectionInfo(networkGuid, ConnMgrPriority.UserInteractive);
ConnMgrEstablishConnectionSync(info, ref _connectionHandle, _syncConnectTimeout, ref
status);
ConnMgrEstablishConnection(info, ref _connectionHandle);
if (status == ConnMgrStatus.Connected)
{
//
// Success!
//
}