Bluetooth Service Discovery Database Overview

Purpose

Allows a local service to register itself to a local Bluetooth service database. This enables remote Bluetooth devices to discover the service doing an SDP Agent search.

Architectural relationships

The Service Discovery Database API is one of two APIs that allow you to use the Bluetooth Service Discovery Protocol. The other, the Bluetooth Service Discovery Agent, enables you to discover the Bluetooth services, and the attributes of those services, that are available on a remote device.

Description

Service Discovery Database

A client must create and connect a session, RSdp, and a subsession, RSdpDatabase, to access the database. A subsession allows service records and their attributes to be added, updated, and deleted.

Service attributes

A service is described through a number of attributes, each of which can hold a specific type of value, such as an integer, boolean, string, etc.

The base class through which all attributes are manipulated is CSdpAttrValue.

A family of classes derived from CSdpAttrValue provide classes through which these types can be manipulated: CSdpAttrValueBoolean, CSdpAttrValueDEA, CSdpAttrValueDES, CSdpAttrValueInt, CSdpAttrValueNil, CSdpAttrValueString, CSdpAttrValueUint, CSdpAttrValueURL, and CSdpAttrValueUUID.

Two classes, CSdpAttrValueDEA and CSdpAttrValueDES, enable lists of attributes to be constructed. Both implement the MSdpElementBuilder interface that provides functions to accumlatively add attributes to a list.

Service record handle

The attributes for a service are stored in a service record. A record is referred to through an ID, known as a service record handle, stored in a TSdpServRecordHandle.

Typical Uses

Start with the Service Records and Attributes guide.

The following tutorials explain how to get started using the service discovery database.