Location:
btsdp.h
Link against: bluetooth.lib
CSdpAgent
Supported from 6.1
Makes Bluetooth service discovery protocol (SDP) requests to a remote device.
To make SDP requests,
Construct a CSdpAgent
object with the Bluetooth address of
the remote device to query.
Set the classes of service that you want to query for. The classes have predefined UUIDs, which you specify with SetRecordFilterL()
.
Get results through NextRecordRequestL()
. Information on services is stored as records, which can be queried in turn for attribute values for the service through AttributeRequestL()
.
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.
|
Defined in CSdpAgent
:
AttributeRequestL()
, NewL()
, NewLC()
, NextRecordRequestL()
, SetAttributePredictorListL()
, SetRecordFilterL()
, ~CSdpAgent()
Inherited from CBase
:
operator new()
static CSdpAgent* NewL(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);
Allocate and construct a service discovery agent.
|
|
static CSdpAgent* NewLC(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);
Allocate and construct a service discovery agent, leaving the object on the cleanup stack.
|
|
void SetAttributePredictorListL(const CSdpAttrIdMatchList& aMatchList);
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.
|
void SetRecordFilterL(const CSdpSearchPattern& aUUIDFilter);
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).
|
void NextRecordRequestL();
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()
.
void AttributeRequestL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID);
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()
.
|
void AttributeRequestL(TSdpServRecordHandle aHandle, const CSdpAttrIdMatchList& aMatchList);
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.
|
void AttributeRequestL(MSdpElementBuilder* aBuilder, TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID);
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.
|
void AttributeRequestL(MSdpElementBuilder* aBuilder,TSdpServRecordHandle aHandle, const CSdpAttrIdMatchList& aMatchList);
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.
|