
Chapter 19: Wireless Wide-Area Networking
The DbGprs.csv File
209
Psion Mobile Devices Developers Guide
The following example shows how to connect to the Internet using the Connection Manager:
19.7.2.1 Disconnecting from Connection Manager
On Windows Embedded hand-Held 6.5-based computers, the Connection Manager API,
ConnMgrReleaseConnection, does not fully close the connection. for information on
ConnMgrReleaseConnection see msdn.microsoft.com/en-us/library/bb416503.aspx.
Use RasHangUp to fully close the connection. For information see
msdn.microsoft.com/en-us/library/aa450851.aspx.
Find the connection handle, HRASCONN, using RasEnumConnections. For information see
msdn.microsoft.com/en-us/library/aa918049.aspx
19.7.3 The DbGprs.csv File
To make an Internet connection using either RAS, or the Connection Manager, a username, a password, and
some other related information—such as APN, DNS, MCC, or MNC—may be needed. Psion provides this infor-
mation in the ...\Windows\DbGprs.csv file, on every 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 spread-
sheet program. When you locate your WWAN service provider in this file, the most common information
types required by the provider are listed.
19.7.4 Checking Packet Data Status
If packet data is enabled for the connection to the WWAN service provider, The WWAN driver automatically
configures the system so that a connection can be made using RAS or Connection Manager.
The following example shows how to check the packet data status:
Note: It is recommended to wait for a Packet Service Status (see Section 19.7.4) of Wwan
AttachStateAttached before attempting a connection through Connection Manager.
// 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!
//
}
WWanRequestParameters opts;
opts.hWaitForAsyncCompletion = 0;
WWAN_PACKET_SERVICE packetService;
if (WirelessWAN::GetPacketService(opts, packetService) == WwanRequestSuccess)
{
Comentarios a estos manuales