Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


Bluetooth BTComm Overview

[Top]


Purpose

BTComm provides the framework to produce an RS232 emulation plugin communicating over a Bluetooth RFComm connection.

[Top]


Introduction

BTComm has no API of its own but instead works over the Serial Communications C32 server using the Ser comms C32 APIs. BTComm is itself provided by a serial communications module in the form of a CSY file. Bluetooth virtual serial ports are typically used for application debugging over Bluetooth.

[Top]


Key Concepts

BTComm is used to create an emulated serial connection over the serial communications (Ser comms C32) server. There are three key concepts to consider when you need serial comms emulation over Bluetooth.


Serial Communications

BTComm provides Serial Communications emulation over Bluetooth. As such, the following Ser Comms C32 classes are used in making an RS232 BTComm connection:

Serial Communication Sessions

RCommServ::Connect() creates a session on the comms server. The desired serial protocol is loaded using the RCommServ::LoadCommModule() function.

Note: Several instances of a module can be loaded, the reference count for the module will simply be incremented for each subsequent load.

Serial Communications Server

RComm provides several useful methods for serial communications including:

Opening the port

Having connected to the server and configured the session the connection can be opened. There are two RComm::Open() methods. For BTComm we are only interested in the three parameter version. The three parameters are aServer, aName and aMode. The other RComm::Open() also includes an aRole. Roles are discussed in more detail below.

Communications Modules

There are three Comm modules provided by default, they are:

The BTCOMM.csy module provides Serial over Bluetooth. The .csy extension is omitted in code.

Communication Modes

The aMode parameter takes a TCommAccess mode. There are three possible modes defined by TCommAccess, they are:

BTComm must be opened in Exclusive mode ECommExclusive.

Roles

There are two possible serial communication roles, they are:

The role can be omitted as BTComm only supports the DTE mode. In this mode the signal lines DTR and RTS are outputs while the others are inputs. If you require the DCE rolw use RFComm instead of BTComm.

Note: Re-using ports can cause problems. An attempt to open a port might fail if the session (previously opened for exclusive use) is still closing. The kernel completes the RHandleBase::Close() function immediately, therefore RCommServ resources still used by this client may not yet have been released at the time the Close() returns.

[Top]


BTComm Tutorials

Using BTComm walks through the steps involved in setting up a BTComm connection.

[Top]


See Also

For more information please see the following: