CSdpAgent Class Reference

#include <btsdp.h>

Link against: sdpagent.lib

class CSdpAgent : public CBase

Inherits from

  • CSdpAgent

    Detailed Description

    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.

    See also: MSdpAgentNotifier

    Constructor & Destructor Documentation

    ~CSdpAgent ( )

    IMPORT_C~CSdpAgent()

    Destructor.

    Member Function Documentation

    AttributeRequestL ( TSdpServRecordHandle, TSdpAttributeID )

    IMPORT_C voidAttributeRequestL(TSdpServRecordHandleaHandle,
    TSdpAttributeIDaAttrID
    )

    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().

    See also: MSdpAgentNotifier::AttributeRequestComplete() MSdpAgentNotifier::AttributeRequestResult()

    capability
    LocalServices
    ParameterDescription
    aHandleThe service for which to get the attribute, specified by its record handle
    aAttrIDThe ID of the attribute to get

    AttributeRequestL ( TSdpServRecordHandle, const CSdpAttrIdMatchList & )

    IMPORT_C voidAttributeRequestL(TSdpServRecordHandleaHandle,
    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.

    See also: MSdpAgentNotifier::AttributeRequestComplete() MSdpAgentNotifier::AttributeRequestResult()

    capability
    LocalServices
    ParameterDescription
    aHandleThe service for which to get the attribute, specified by its record handle
    aMatchListA list of attributes to get

    AttributeRequestL ( MSdpElementBuilder *, TSdpServRecordHandle, TSdpAttributeID )

    IMPORT_C voidAttributeRequestL(MSdpElementBuilder *aBuilder,
    TSdpServRecordHandleaHandle,
    TSdpAttributeIDaAttrID
    )

    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.

    See also: MSdpAgentNotifier::AttributeRequestComplete()

    capability
    LocalServices
    ParameterDescription
    aBuilderObject implementing the MSdpElementBuilder interface. It will be called with each type found in the response.
    aHandleThe service for which to get the attribute, specified by its record handle
    aAttrIDThe ID of the attribute to get

    AttributeRequestL ( MSdpElementBuilder *, TSdpServRecordHandle, const CSdpAttrIdMatchList & )

    IMPORT_C voidAttributeRequestL(MSdpElementBuilder *aBuilder,
    TSdpServRecordHandleaHandle,
    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.

    See also: MSdpAgentNotifier::AttributeRequestComplete()

    capability
    LocalServices
    ParameterDescription
    aBuilderObject implementing the MSdpElementBuilder interface. It will be called with each type found in the response.
    aHandleThe service for which to get the attribute, specified by its record handle
    aMatchListA list of attributes to get

    Cancel ( )

    IMPORT_C voidCancel()

    Attempts to cancel an SDP Agent request.

    Calls cancel on active objects making request. Resets all variables associated with a request and its state.

    NB The cancel operation will not, and cannot stop results from an SDP query being sent by the remote.
    capability
    LocalServices

    NewL ( MSdpAgentNotifier &, const TBTDevAddr & )

    IMPORT_C CSdpAgent *NewL(MSdpAgentNotifier &aNotifier,
    const TBTDevAddr &aDevAddr
    )[static]

    Creates a new SDP Agent object.

    capability
    LocalServices
    ParameterDescription
    aNotifierInterface implemented by the query requester, which the agent calls asynchronously to pass responses to queries
    aDevAddrThe Bluetooth address of the remote device to query

    Returns: New service discovery agent

    NewLC ( MSdpAgentNotifier &, const TBTDevAddr & )

    IMPORT_C CSdpAgent *NewLC(MSdpAgentNotifier &aNotifier,
    const TBTDevAddr &aDevAddr
    )[static]

    Creates a new SDP Agent object.

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

    capability
    LocalServices
    ParameterDescription
    aNotifierInterface implemented by the query requester, which the agent calls asynchronously to pass responses to queries
    aDevAddrThe Bluetooth address of the remote device to query

    Returns: New service discovery agent

    NextRecordRequestL ( )

    IMPORT_C voidNextRecordRequestL()

    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: MSdpAgentNotifier::NextRecordRequestComplete()

    capability
    LocalServices

    SetAttributePredictorListL ( const CSdpAttrIdMatchList & )

    IMPORT_C voidSetAttributePredictorListL(const CSdpAttrIdMatchList &aMatchList)

    This does nothing! (It used to create a copy of an attribute match list supplied, and place it in the CSdpAgentEng object.)

    capability
    LocalServices
    Deprecated
    ParameterDescription
    aMatchListAttribute - now unused

    SetRecordFilterL ( const CSdpSearchPattern & )

    IMPORT_C voidSetRecordFilterL(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).

    capability
    LocalServices
    ParameterDescription
    aUUIDFilterA 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.