Bluetooth SDP Overview

The Bluetooth Service Discovery Protocol (SDP) component enables you to register services with the SDP database, and to query the database for available services.

Purpose

The Symbian platform Bluetooth Service Discovery Protocol (SDP) component provides APIs that allow you to register services with the SDP database or to query the database for available services. This functionality is provided by the two SDP APIs:

Required background

You need to be familiar with the following:

Key concepts and terms

The following terms are used frequently throughout the SDP Overviews and Tutorials.

Service Discovery Database

This database stores information about available services. If you are writing an application to advertise a specific service you will use the SDP Database APIs to register your service. If you are writing an application that needs to search for available services on other devices you will use the SDP Agent APIs.

Service Record

A data record for an individual service in the service discovery database.

Service Record Attribute

An attribute of the service that is stored in the service record. We will discuss service record attributes in greater detail in "Service Records and Attributes ".

UUID

Universally Unique Identifier - See the Service Discovery Protocol Assigned Numbers listing from the Bluetooth SIG for a current list of default UUIDs. You will need to be logged in to the Bluetooth SIG website to see this document

DEA

Data element alternative - A sequence of data elements of which one must be selected.

DES

Data element sequence - A sequence of data elements.

Architecture

A service wishing to advertise on the SDP server must create a session with the SDP server using RSdp. A subsession must be created through RSdpDatabase to access the database. A subsession allows service records and their attributes to be added, deleted and updated in the database. The application uses CSdpAgent to query the services and has to implement MSdpAgentNotifier or MSdpElementBuilder interfaces to handle and organize responses from the server.

SDP Database

The SDP database maintains a list of service records that describe the characteristics of services on the local device that may be used by a remote device via Bluetooth. Each service record contains information about a single service.

SDP Agent

The SDP agent retrieves information from a service record in the SDP database by issuing an SDP request. If an application chooses to use a service, it opens a separate connection with the service provider. For example:

iI you need to print a document on your Symbian platform device you could:

  1. Perform an SDP search for devices offering a print service.

  2. If a device is found offering the print service, you then query it for connection details.

  3. With that information your application creates a Bluetooth connection to the device found using the required connection configuration and prints the document.

SDP library details

The Bluetooth SDP component has the following published libraries. The DLLs that provides the functionality and the libraries to which your code must link are identified below.

DLL LIB Short description

sdpdatabase.dll

sdpdatabase.lib

Allows a local service to register itself to a local Bluetooth service database.

sdpagent.dll

sdpagent.lib

Enables a Bluetooth device to discover the Bluetooth services, and the attributes of those services, that are available on a remote Bluetooth device.

Typical uses

The following are typical uses for the SDP Database and SDP Agent APIs:

SDP Database

The SDP Database API provides access to the database for creating and maintaining records of services and setting the service attributes.

For more information see:

The typical uses for the SDP Database are: