Closing the PAN

So far in this tutorial series we have looked at the steps involved in creating a Personal Area Network and adding and removing devices on the PAN. Now we will look at Closing the PAN.

Using the Tutorial

The code fragments in this tutorial are derived from the Bluetooth Example application available in /src/COMMON/DEVELOPERLIBRARY/examples/Bluetooth/BTExample1 . Although the code has been reformatted to the requirements of the tutorial there is always enough information included with the code to find the actual example code.

Intended Audience:

This tutorial is designed for Symbian licensees only. Several APIs mentioned ad used throughout this tutorial series are only available in a device creators kit environment.

Basic procedure:

The high level steps to remove a device from a PAN are:

  • User sends a stop command from the UI.

  • The connection is stopped.

Closing the PAN Connection

The user will be presented with a list of menu options. Selecting the option to stop the connection will trigger the following:

       
        
       
       ...
 if(iIapStarted)
 {
  rerr = iConnection.Stop();
  if(rerr != KErrNone)
 {
  iConsole.Printf(_L("Failed to STOP IAP.  Err %d.\n"), rerr);
 }
 iIapStarted = EFalse;
 }
}
return rerr;
      

Recall from Creating a Personal Area Network tutorial that iConnection is an RConnection .

What's next?

There is nothing more to the PAN Profile tutorial series. In this series you have learned about the following: