Service records and attributes

The Bluetooth SDP Database contains entries for service records, one entry for each service registered to the database. Each of these entries contains information about that service in the form of service attributes. We will briefly discuss these concepts below.

Service Records

All information about a service that is maintained by an SDP database is contained within a single service record. A service record consists entirely of a list of service attributes.

To understand services and attributes, you should read the Service Discovery Protocol specification, available at http://www.bluetooth.com/Bluetooth/Learn/Technology/Specifications/. This page provides a few of the main points to get you started.

UUID Values

In a service record, classes are specified using Universally Unique Identifier (UUID) numbers. The current predefined values for class IDs and attribute IDs are in the Service Discovery Protocol Assigned Numbers listing from the Bluetooth SIG.

Attributes

Each attribute has an ID, a type, and a value. The types, and some attribute IDs, are predefined: for example, the URL for the icon to show for a service must always have attribute ID value 12 (UUID 0x000C). Complex attributes can be formed through lists of attributes; such lists can themselves contain lists of attributes.

The service class attribute

A key attribute is the service class, Bluetooth ID ServiceClassIDList (UUID 0x0001): each service is an instance of a service class, which provides an initial indicator of the capabilities of the service, and defines what other attributes, including their types and semantics, must or can appear in the service record.

A single application may provide multiple services. These different services should have different service records. Additionally, each service record can have many service classes listed in it. These service classes must be in a subclasses/superclasses of each other, and must be ordered most derived to least derived in the list. For example, the service might have a class entry that indicates it provides printing services; and another class entry that indicates that it provides Postscript printing (and consequently has extra attributes relating to this).

Where next?

The complete set of Service Discovery Database tutorials are shown below:

  1. Connecting to the service discovery database

  2. Handling SDP attributes

  3. Registering Services

  4. Setting service record attributes

Also refer to the Bluetooth Service Discovery Database overview and the Bluetooth SDP Overview for additional background information.