Developers guide

Chapter 22: Wireless Wide-Area Networking
Closing WWAN
Psion Teklogix Mobile Devices SDK Developers Guide 205
22.5 Closing WWAN
When an application has finished using the WWAN interface, the WWAN interface must be
closed. It is essential that the interface is closed before the application exits.
22.6 Connecting To The Internet
A WWAN modem must initiate a connection. This behaviour is similar to a dial-up connection but
different from an Ethernet interface which connects automatically. When a WWAN modem is
attached to a network and powered up, it detects the network, but is unable to transfer packets to
the network until a packet data connection is set up.
if ((wwanReadyStatePtr.State & WWAN_READY_STATE_FLAGS.INITIALIZED) != 0)
{
// Already in the ready state.
return true;
}
count--;
}
return false;
}
Example 22.2 Initializing WWAN in C# (Continued)
Warning: If a Shutdown call is not paired with each Initialize call, system resources are not
released or cleaned up properly, resulting in a memory leak.
Example 22.3 Closing WWAN in C++
// For the initialization process
// see Example 22.1 Initializing WWAN in C++ on page 202
if (InitializeWWANAndWait())
{
// Do WWAN work here...
// Shutdown the interface
WirelessWAN::Shutdown();
}
Example 22.4 Closing WWAN in C#
// For the initialization process see Example 22.2 Initializing WWAN in C# on
page 204
if (InitializeWWANAndWait())
{
// Do WWAN work here...
// Shutdown (clean up) the WWAN interface
WirelessWAN.Shutdown();
}