Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: btsdp.h
Link against: bluetooth.lib

Class CSdpAgent

CSdpAgent

Support

Supported from 6.1

Description

Makes Bluetooth service discovery protocol (SDP) requests to a remote device.

To make SDP requests,

A user of this class must implement MSdpAgentNotifier to receive the responses to queries.

Note that queries are asynchronous, although this is hidden in the API. The implication is that the interface functions that receive responses are only called when the thread's active scheduler can schedule handling of the completion of the query.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CSdpAgentMakes Bluetooth service discovery protocol (SDP) requests to a remote device

Defined in CSdpAgent:
AttributeRequestL(), NewL(), NewLC(), NextRecordRequestL(), SetAttributePredictorListL(), SetRecordFilterL(), ~CSdpAgent()

Inherited from CBase:
operator new()

See also:


Construction and destruction


NewL()

static CSdpAgent* NewL(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);

Description

Allocate and construct a service discovery agent.

Parameters

MSdpAgentNotifier& aNotifier

Interface implemented by the query requester, which the agent calls asynchronously to pass responses to queries

const TBTDevAddr& aDevAddr

The Bluetooth address of the remote device to query

Return value

CSdpAgent*

New service discovery agent


NewLC()

static CSdpAgent* NewLC(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);

Description

Allocate and construct a service discovery agent, leaving the object on the cleanup stack.

Parameters

MSdpAgentNotifier& aNotifier

Interface implemented by the query requester, which the agent calls asynchronously to pass responses to queries

const TBTDevAddr& aDevAddr

The Bluetooth address of the remote device to query

Return value

CSdpAgent*

New service discovery agent


~CSdpAgent()

~CSdpAgent();

Description

Destructor.

[Top]


Service requests


SetAttributePredictorListL()

void SetAttributePredictorListL(const CSdpAttrIdMatchList& aMatchList);

Description

Creates a copy of an attribute match list supplied, and places it in the CSdpAgent object.

If an old attribute match list exists, it will be deleted.

Parameters

const CSdpAttrIdMatchList& aMatchList

Attribute match list to copy


SetRecordFilterL()

void SetRecordFilterL(const CSdpSearchPattern& aUUIDFilter);

Description

Sets the classes of service to query for on the remote device.

Responses from the agent will only contain records for services that belong to the classes listed in aUUIDFilter. Service classes are represented as unique identifiers (UUIDs).

Parameters

const CSdpSearchPattern& aUUIDFilter

A list of UUIDs that will be matched in SDP Service Search Requests. The function takes a copy of the object. Any previous UUID list is deleted.


NextRecordRequestL()

void NextRecordRequestL();

Description

Gets a handle to the record for the next (or first) service on the remote device that matches the service class filter previously set.

The function is asynchronous: on completion, it calls NextRecordRequestComplete() on the MSdpAgentNotifier interface passed in the NewL().

See also:

[Top]


Attribute requests


AttributeRequestL()

void AttributeRequestL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID);

Description

Gets the specified attribute for a remote service.

The function is asynchronous: on completion, it calls MSdpAgentNotifier::AttributeRequestComplete().

If the attribute is found, the function passes it by also calling MSdpAgentNotifier::AttributeRequestResult().

Parameters

TSdpServRecordHandle aHandle

The service for which to get the attribute, specified by its record handle

TSdpAttributeID aAttrID

The ID of the attribute to get

See also:


AttributeRequestL()

void AttributeRequestL(TSdpServRecordHandle aHandle, const CSdpAttrIdMatchList& aMatchList);

Description

Gets the specified attributes for a remote service.

The function is asynchronous: on completion, it calls MSdpAgentNotifier::AttributeRequestComplete().

The function also calls MSdpAgentNotifier::AttributeRequestResult() for each attribute found.

Parameters

TSdpServRecordHandle aHandle

The service for which to get the attribute, specified by its record handle

const CSdpAttrIdMatchList& aMatchList

A list of attributes to get

See also:


AttributeRequestL()

void AttributeRequestL(MSdpElementBuilder* aBuilder, TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID);

Description

Gets the specified attribute for a remote service.

The function is asynchronous: on completion, it calls MSdpAgentNotifier::AttributeRequestComplete().

If the attribute is found, the function calls aBuilder's interface to set the attribute ID and value.

Parameters

MSdpElementBuilder* aBuilder

Object implementing the MSdpElementBuilder interface. It will be called with each type found in the response.

TSdpServRecordHandle aHandle

The service for which to get the attribute, specified by its record handle

TSdpAttributeID aAttrID

The ID of the attribute to get

See also:


AttributeRequestL()

void AttributeRequestL(MSdpElementBuilder* aBuilder,TSdpServRecordHandle aHandle, const CSdpAttrIdMatchList& aMatchList);

Description

Gets the specified attributes for a remote service.

The function is asynchronous: on completion, it calls MSdpAgentNotifier::AttributeRequestComplete().

As each attribute is found, the function calls aBuilder's interface to set the attribute ID and value.

Parameters

MSdpElementBuilder* aBuilder

Object implementing the MSdpElementBuilder interface. It will be called with each type found in the response.

TSdpServRecordHandle aHandle

The service for which to get the attribute, specified by its record handle

const CSdpAttrIdMatchList& aMatchList

A list of attributes to get

See also: