Motorola SYMBOL MINISCAN MSXX04 Uživatelská příručka Strana 217

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 278
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 216
Chapter 19: Wireless Wide-Area Networking
Closing WWAN
205
Psion Mobile Devices Developers Guide
19.6 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.
wwanReadyStatePtr);
if (retVal == WwanRequestStatus.NotInitialized)
{
if (WirelessWAN.Initialize() != WwanRequestStatus.Success)
{
return false;
}
}
int count = 60;
while (count > 0)
{
Thread.Sleep(1000);
// Get the ready state again....
retVal = WirelessWAN.GetReadyState(wwanParameters, wwanReadyStatePtr);
if (
(retVal != WwanRequestStatus.Success) ||
(wwanParameters.resultCode != WwanResult.Success) ||
(wwanReadyStatePtr == null)
)
{
// Unable to get the ready state. See return value / result code for reason.
return false;
}
if ((wwanReadyStatePtr.State & WWAN_READY_STATE_FLAGS.INITIALIZED) != 0)
{
// Already in the ready state.
return true;
}
count--;
}
return false;
}
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.
// For the initialization process
// see Section 19.5.3 Initializing the WWAN Driver on page 202
if (InitializeWWANAndWait())
{
// Do WWAN work here...
// Shutdown the interface
WirelessWAN::Shutdown();
}
// For the initialization process see Section 19.5.3 Initializing the WWAN Driver on page 202
if (InitializeWWANAndWait())
{
// Do WWAN work here...
// Shutdown (clean up) the WWAN interface
WirelessWAN.Shutdown();
}
Zobrazit stránku 216
1 2 ... 212 213 214 215 216 217 218 219 220 221 222 ... 277 278

Komentáře k této Příručce

Žádné komentáře