Bluetooth SDP Overview

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

Purpose

The Symbian platform Bluetooth Service Discovery Protocol (SDP) component provides APIs that allow you to register services to the SDP database or 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 is the database that 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 and 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 " SDP 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.

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;

if you need to print a document on your Symbian platform phone you could:

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

  2. Should a device be found offering the print service you would further query it for connection details.

  3. With that information your application would then create a Bluetooth connection to the device in question using the connection configuration required and print the document.

SDP library details

The Bluetooth SDP component has two 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: