Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


Loading the stack

This document shows you how to load the Bluetooth stack.

[Top]


Purpose

The Bluetooth stack needs to be loaded before you can use Bluetooth.

[Top]


How to load the Bluetooth stack

The following shows you how to load the Bluetooth stack.

Basic Procedures

  1. Set up required objects and literals.

    RSocketServ iSockSvr;
    _LIT(KPDDName, "EUART1");
    _LIT(KLDDName, "ECOMM");
  2. Start C32.

    TInt rerr = KErrNone;
    rerr = StartC32();// For any Serial comms
  3. Load the drivers

    User::LoadPhysicalDevice(KPDDName);
    User::LoadLogicalDevice(KLDDName);
  4. Connect the socket server

    iSockSvr.Connect();
  5. Configure the protocol

    TProtocolDesc iProtocolInfo;
    TRequestStatus status;
    iSockSvr.FindProtocol(_L("L2CAP"), iProtocolInfo);
  6. Start the protocol

    iSockSvr.StartProtocol(iProtocolInfo.iAddrFamily,iProtocolInfo.iSockType,iProtocolInfo.iProtocol, status);
    User::WaitForRequest(status);

At this point the Bluetooth stack is running. Other components can now use the Bluetooth hardware module.

The Remote Control Framework loads the stack automatically when started.

[Top]


See also

You may also be interested in the following: