diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-7F2C1C45-43FA-5F19-81E3-4DBC0328E4A7.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-7F2C1C45-43FA-5F19-81E3-4DBC0328E4A7.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,14 @@ + + + + + +Bluetooth Sockets Overview
Purpose

Discovers other Bluetooth devices, and reads and writes data over Bluetooth.

There are two roles to be played in establishing a communications channel over Bluetooth, they are:

  • Initiator

  • Receiver

The receiver starts the Bluetooth system and waits for an initiator to make the connection. Once the connection has been made, both ends are equals, and either can send and receive data and terminate the connection. This API allows either role to be programmed.

Architectural relationships

The API supports communication over both the L2CAP and RFCOMM layers of the Bluetooth protocol suite. The API is based on the Sockets Client-Side API, which provides a standard API that allows a client to make a connection to a remote device or have the remote device connect to it, then to send and receive data before disconnecting.

Description

The API has five key concepts: socket address, remote device inquiry, RFCOMM commands and options, L2CAP commands, and HCI commands.

Socket address

Each Bluetooth device has a unique 48-bit address. This is encapsulated by TBTDevAddr.

The sockets API encapsulates a generic communications end point through a TSockAddr. Bluetooth provides a specialised version of this, TBTSockAddr, which adds a Bluetooth device address field.

Remote device inquiry

A client can query for available remote devices through the sockets class RHostResolver. A parameter of type TInquirySockAddr is supplied for such queries: principally, this allows you to limit discovery to specific classes of device.

Commands and options

You can send commands to an RFCOMM socket through an RSocket::Ioctl() call. It is possible to get and set options on a socket through RSocket::GetOpt() and RSocket::SetOpt() respectively.

You can send commands to L2CAP sockets and to the HCI layer through RSocket::Ioctl().

Bluetooth User + Tutorials Bluetooth Stack + Overview
\ No newline at end of file