CSdpAgentEng Class Reference

class CSdpAgentEng : public CBase

Engine that actually implements the CSdpAgent facade funtionality.

Inherits from

Public Member Functions
~CSdpAgentEng()
voidAttributeRequestL(TSdpServRecordHandle, const CSdpAttrIdMatchList &)
voidAttributeRequestL(MSdpElementBuilder *, TSdpServRecordHandle, const CSdpAttrIdMatchList &)
voidCancel()
voidConstructL()
CSdpAgentEng *NewL(MSdpAgentNotifier &, TBTDevAddr)
voidNextRecordRequestL()
voidSetRecordFilterL(const CSdpSearchPattern &)
Private Member Functions
CSdpAgentEng(MSdpAgentNotifier &, TBTDevAddr)
voidHandleAttributeError(TInt)
voidHandleAttributeResponseL(const TDesC8 &, const TDesC8 &)
voidHandleServiceSearchError(TInt)
voidHandleServiceSearchResponseL(TUint16, TUint16, const TDesC8 &, const TDesC8 &)
voidResetForNewAttributeRequest()
voidResetForNewRecordRequest()
voidSendAttributeRequestL()
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
enumTServiceSearchState { 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,
TBTDevAddraDevAddr
)[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 &)

voidAttributeRequestL(TSdpServRecordHandleaHandle,
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 aHandleRecord handle to retrieve attribute from
const CSdpAttrIdMatchList & aMatchListList Attribute IDs to retrieve.

AttributeRequestL(MSdpElementBuilder *, TSdpServRecordHandle, const CSdpAttrIdMatchList &)

voidAttributeRequestL(MSdpElementBuilder *aBuilder,
TSdpServRecordHandleaHandle,
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 * aBuilderClass implementing MSdpElementBuilder interface to handle the result
TSdpServRecordHandle aHandleRecord handle to retrieve attribute from
const CSdpAttrIdMatchList & aMatchListList Attribute IDs to retrieve.

Cancel()

voidCancel()

ConstructL()

voidConstructL()

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)

voidHandleAttributeError(TIntaError)[private]

Pass attribute error up to notifier.

Parameters

TInt aError

HandleAttributeResponseL(const TDesC8 &, const TDesC8 &)

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

voidHandleServiceSearchError(TIntaError)[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 &)

voidHandleServiceSearchResponseL(TUint16aTotalRecCount,
TUint16aCurrentRecCount,
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,
TBTDevAddraDevAddr
)[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()

voidNextRecordRequestL()

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

voidResetForNewAttributeRequest()[private]

ResetForNewRecordRequest()

voidResetForNewRecordRequest()[private]

SendAttributeRequestL()

voidSendAttributeRequestL()[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 &)

voidSetRecordFilterL(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]