diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-65F8675F-FF08-5707-BA5B-BF3B4B779393.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-65F8675F-FF08-5707-BA5B-BF3B4B779393.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,49 @@ + + + + + +Handling +SDP results +

Clients that make service and attribute queries through CSdpAgent must +implement the MSdpAgentNotifier interface +to handle the responses.

+
How to create an object to handle inquiry results

There +are two kinds of results that require handling, they are:

    +
  • Service Search Results, +and

  • +
  • Attribute Read Results

  • +

We will examine a simple handling example for both kinds below.

Note: +Queries are asynchronous.

+
Handling service search results

When a service +search request completes, it calls the NextRecordRequestComplete():

virtual void NextRecordRequestComplete(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount)

aHandle gives the service record handle of the matching +service, and can be used in a subsequent attribute query. aTotalRecordsCount gives +the total number of matching records.

+
Handling attribute read results

When an attribute +request completes, each single attribute is returned with its attribute ID +using AttributeRequestResult().

virtual void AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue)

The ID of the attribute is given in aAttrID, and the +attribute value itself in aAttrValue. You can find the type +of the attribute through aAttrValue->Type(), cast aAttrValue on +this base to the correct subclass of CSdpAttrValue: +for example, if the type is ETypeBoolean, +you can cast aAttrValue to a CSdpAttrValueBoolean.

When +there are no more attributes to be returned, AttributeRequestComplete() is +called.

+
Where Next?

The complete set of Service Discovery +Agent tutorials are shown below:

    +
  • Querying +the SDP database

  • +
  • Reading +remote SDP service attributes

  • +
  • Handling SDP query +results - This document

  • +

Also refer to the Bluetooth +Service Discovery Agent Overview and the Bluetooth +SDP Overview for additional background information.

+
\ No newline at end of file