CSdpAgentEng Class Reference

class CSdpAgentEng : public CBase

Engine that actually implements the CSdpAgent facade funtionality.

Inherits from

Public Member Functions
~CSdpAgentEng ()
void AttributeRequestL ( TSdpServRecordHandle , const CSdpAttrIdMatchList &)
void AttributeRequestL ( MSdpElementBuilder *, TSdpServRecordHandle , const CSdpAttrIdMatchList &)
void Cancel ()
void ConstructL ()
CSdpAgentEng * NewL ( MSdpAgentNotifier &, TBTDevAddr )
void NextRecordRequestL ()
void SetRecordFilterL (const CSdpSearchPattern &)
Private Member Functions
CSdpAgentEng ( MSdpAgentNotifier &, TBTDevAddr )
void HandleAttributeError ( TInt )
void HandleAttributeResponseL (const TDesC8 &, const TDesC8 &)
void HandleServiceSearchError ( TInt )
void HandleServiceSearchResponseL ( TUint16 , TUint16 , const TDesC8 &, const TDesC8 &)
void ResetForNewAttributeRequest ()
void ResetForNewRecordRequest ()
void SendAttributeRequestL ()
TBool TryToCompleteNextRecordRequest ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enum TServiceSearchState { EIdle , ERequesting , EResultsReceived }
Private Attributes
TContState iAttributeRequestContState
TSdpServRecordHandle iAttributeRequestHandle
CSdpAttributeRequester * iAttributeRequester
CArrayFix < TSdpServRecordHandle > * iBuiltRecHandles
TBool iCancelCalled
CSdpAttrBuilder * iDefaultAttributeBuilder
CSdpAttrIdMatchList * iMatchList
TInt iNextRecHandle
MSdpAgentNotifier & iNotifier
CElementParser * iParser
TBTDevAddr iRemoteAddress
RSdpSession iSdpSession
TContState iSearchRequestContState
CSdpSearchRequester * iSearchRequester
TServiceSearchState iServiceSearchState
TInt iTotalRecCount
CSdpSearchPattern * iUUIDFilter

Constructor & Destructor Documentation

CSdpAgentEng(MSdpAgentNotifier &, TBTDevAddr)

CSdpAgentEng ( MSdpAgentNotifier & aNotifier,
TBTDevAddr aDevAddr
) [private]

Constructor: caches the results notifier and the remote device address to be used.

Parameters

MSdpAgentNotifier & aNotifier
TBTDevAddr aDevAddr

~CSdpAgentEng()

~CSdpAgentEng ( )

Creates a new SDP Agent Engine object.

The SDP Agent Engine is the class for the data member of the SDP Agent which actually does the work. (The SDP Agent is a facade class.)

Member Functions Documentation

AttributeRequestL(TSdpServRecordHandle, const CSdpAttrIdMatchList &)

void AttributeRequestL ( TSdpServRecordHandle aHandle,
const CSdpAttrIdMatchList & aMatchList
)

Retrieve attributes from a record on the remote server.

On completion, an up call on MSdpAgentNotifier::AttributeRequestComplete will occur. Each attribute found will be passed up through a call to MSdpAgentNotifier::AttributeRequestResult .

Parameters

TSdpServRecordHandle aHandle Record handle to retrieve attribute from
const CSdpAttrIdMatchList & aMatchList List Attribute IDs to retrieve.

AttributeRequestL(MSdpElementBuilder *, TSdpServRecordHandle, const CSdpAttrIdMatchList &)

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

Retrieve attributes from a record on the remote server.

On completion, an up call on MSdpAgentNotifier::AttributeRequestComplete will occur. As attributes are found, calls the MSdpElementBuilder class to describe the attribute. This will be of the form n * [AttrID:AttrVal], where n is the number of attributes actually found.

Parameters

MSdpElementBuilder * aBuilder Class implementing MSdpElementBuilder interface to handle the result
TSdpServRecordHandle aHandle Record handle to retrieve attribute from
const CSdpAttrIdMatchList & aMatchList List Attribute IDs to retrieve.

Cancel()

void Cancel ( )

ConstructL()

void ConstructL ( )

Sets ip basic requirements for SDP Agent.

Perform ipc connection with ESock.

Create active objects which look after requests.

Create a parser to parse responses. (A builder for the parser is provided at point of request.)

HandleAttributeError(TInt)

void HandleAttributeError ( TInt aError ) [private]

Pass attribute error up to notifier.

Parameters

TInt aError

HandleAttributeResponseL(const TDesC8 &, const TDesC8 &)

void HandleAttributeResponseL ( const TDesC8 & aAttributeList,
const TDesC8 & aContState
) [private]

Up Called by Attribute Request Active Object "RunL" Parse out the attribute response, and handle accordingly.

Parameters

const TDesC8 & aAttributeList
const TDesC8 & aContState

HandleServiceSearchError(TInt)

void HandleServiceSearchError ( TInt aError ) [private]

Pass service search error up to notifier - the handle supplied is simply a dummy ... the notifier needs to check for errors.

Parameters

TInt aError

HandleServiceSearchResponseL(TUint16, TUint16, const TDesC8 &, const TDesC8 &)

void HandleServiceSearchResponseL ( TUint16 aTotalRecCount,
TUint16 aCurrentRecCount,
const TDesC8 & aRecHandles,
const TDesC8 & aContState
) [private]

Upcall from service search requester.

Parameters

TUint16 aTotalRecCount
TUint16 aCurrentRecCount
const TDesC8 & aRecHandles
const TDesC8 & aContState

NewL(MSdpAgentNotifier &, TBTDevAddr)

CSdpAgentEng * NewL ( MSdpAgentNotifier & aNotifier,
TBTDevAddr aDevAddr
) [static]

Creates a new SDP Agent Engine object.

The SDP Agent Engine is the class for the data member of the SDP Agent which actually does the work. (The SDP Agent is a facade class.)

Parameters

MSdpAgentNotifier & aNotifier
TBTDevAddr aDevAddr

NextRecordRequestL()

void NextRecordRequestL ( )

Retrieves the next record handle from the remote server, that matches the UUID filter previously set by SetRecordFileterL(). On completion, an upcall will occur on MSdpAgentNotifier::NextRecordRequestComplete() .

ResetForNewAttributeRequest()

void ResetForNewAttributeRequest ( ) [private]

ResetForNewRecordRequest()

void ResetForNewRecordRequest ( ) [private]

SendAttributeRequestL()

void SendAttributeRequestL ( ) [private]

Ask the active object which performs attribute requests to do just that.

The parameters used for the request are those currently stored as data members in this object. These will have been previousfly supplied by the user.

SetRecordFilterL(const CSdpSearchPattern &)

void SetRecordFilterL ( const CSdpSearchPattern & aUUIDFilter )

This function creates a new COPY of a UUID filter from the UUID filter supplied, and places it in the CSdpAgentEng object.

If an old UUID filter list exists, it will be deleted. (A UUID filter is a list of UUIDs that must be contained in a service record in a remote database if the handle of that record is to be returned by a service search.)

Parameters

const CSdpSearchPattern & aUUIDFilter

TryToCompleteNextRecordRequest()

TBool TryToCompleteNextRecordRequest ( ) [private]

Checks whether it is necessary or not to ask remote device for more records.

SdpAgent collects as many of the remote device's record handles that conform to the record filter as it can on each service search request sent. Thus the SdpAgent will only perform a fresh service search if either the record filter has been changed (=> iBuiltRecordHandles->Count() returns 0) or the remote device returned a non "null" continuation state and all the record handles currently returned by the remote device have been processed.

Member Enumerations Documentation

Enum TServiceSearchState

Enumerators

EIdle
ERequesting
EResultsReceived

Member Data Documentation

TContState iAttributeRequestContState

TContState iAttributeRequestContState [private]

TSdpServRecordHandle iAttributeRequestHandle

TSdpServRecordHandle iAttributeRequestHandle [private]

CSdpAttributeRequester * iAttributeRequester

CSdpAttributeRequester * iAttributeRequester [private]

CArrayFix< TSdpServRecordHandle > * iBuiltRecHandles

CArrayFix < TSdpServRecordHandle > * iBuiltRecHandles [private]

TBool iCancelCalled

TBool iCancelCalled [private]

CSdpAttrBuilder * iDefaultAttributeBuilder

CSdpAttrBuilder * iDefaultAttributeBuilder [private]

CSdpAttrIdMatchList * iMatchList

CSdpAttrIdMatchList * iMatchList [private]

TInt iNextRecHandle

TInt iNextRecHandle [private]

MSdpAgentNotifier & iNotifier

MSdpAgentNotifier & iNotifier [private]

CElementParser * iParser

CElementParser * iParser [private]

TBTDevAddr iRemoteAddress

TBTDevAddr iRemoteAddress [private]

RSdpSession iSdpSession

RSdpSession iSdpSession [private]

TContState iSearchRequestContState

TContState iSearchRequestContState [private]

CSdpSearchRequester * iSearchRequester

CSdpSearchRequester * iSearchRequester [private]

TServiceSearchState iServiceSearchState

TServiceSearchState iServiceSearchState [private]

TInt iTotalRecCount

TInt iTotalRecCount [private]

CSdpSearchPattern * iUUIDFilter

CSdpSearchPattern * iUUIDFilter [private]