S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CChatServiceSearcher Class Reference

#include <ChatServiceSearcher.h>

Inheritance diagram for CChatServiceSearcher:

CChatBtServiceSearcher MChatSdpAttributeNotifier List of all members.

Public Member Functions

virtual ~CChatServiceSearcher ()
TInt Port ()

Static Public Member Functions

static CChatServiceSearcher * NewL (MLog &aLog)
static CChatServiceSearcher * NewLC (MLog &aLog)

Protected Member Functions

const TUUID & ServiceClass () const
virtual void FoundElementL (TInt aKey, CSdpAttrValue &aValue)
RArray< TChatSdpAttributeParser::TChatSdpAttributeNode > & ProtocolList ()

Private Member Functions

 CChatServiceSearcher (MLog &aLog)
void ConstructL ()

Private Attributes

TUUID iServiceClass
TInt iPort
RArray< TChatSdpAttributeParser::TChatSdpAttributeNode > iProtocolArray

Detailed Description

CChatServiceSearcher Searches for a chat service.

Definition at line 29 of file ChatServiceSearcher.h.


Constructor & Destructor Documentation

CChatServiceSearcher::~CChatServiceSearcher (   )  [virtual]
 

~CMessageServiceSearcher() Destroy the object and release all memory objects.

Definition at line 66 of file ChatServiceSearcher.cpp.

References iProtocolArray.

00067     {
00068     iProtocolArray.Close();
00069     }

CChatServiceSearcher::CChatServiceSearcher (  MLog &  aLog  )  [private]
 

CChatServiceSearcher() Constructs this object

Parameters:
aLog the log to send output to

Definition at line 54 of file ChatServiceSearcher.cpp.

00055 : CChatBtServiceSearcher( aLog ),
00056   iServiceClass( KServiceClass ),
00057   iPort( -1 )
00058     {
00059     }


Member Function Documentation

CChatServiceSearcher * CChatServiceSearcher::NewLC (  MLog &  aLog  )  [static]
 

NewLC() Create a CChatServiceSearcher object

Parameters:
aLog the log to send output to
Returns:
a pointer to the created instance of CChatServiceSearcher

Definition at line 41 of file ChatServiceSearcher.cpp.

References CChatServiceSearcher().

00042     {
00043     CChatServiceSearcher* self = new ( ELeave ) CChatServiceSearcher( aLog );
00044     CleanupStack::PushL( self );
00045     self->ConstructL();
00046     return self;
00047     }

TInt CChatServiceSearcher::Port (   ) 
 

Port() Retrieve the port on which the service is installed

Returns:
the port number

Definition at line 159 of file ChatServiceSearcher.cpp.

References iPort.

00160     {
00161     return iPort;
00162     }

const TUUID & CChatServiceSearcher::ServiceClass (   )  const [protected, virtual]
 

ServiceClass()

Returns:
the service class uid.

Implements CChatBtServiceSearcher.

Definition at line 86 of file ChatServiceSearcher.cpp.

References iServiceClass.

00087     {
00088     return iServiceClass;
00089     }

void CChatServiceSearcher::FoundElementL (  TInt  aKey,
CSdpAttrValue &  aValue
)  [protected, virtual]
 

FoundElementL() Read the data element

Parameters:
aKey a key that identifies the element
aValue the data element

Implements CChatBtServiceSearcher.

Definition at line 147 of file ChatServiceSearcher.cpp.

References iPort.

00148     {
00149     __ASSERT_ALWAYS( aKey == static_cast<TInt>( KRfcommChannel ), 
00150         Panic( EChatBtServiceSearcherProtocolRead ) );
00151     iPort = aValue.Uint();
00152     }

RArray< TChatSdpAttributeParser::TChatSdpAttributeNode > & CChatServiceSearcher::ProtocolList (   )  [protected, virtual]
 

ProtocolList()

Returns:
the attribute list.

Implements CChatBtServiceSearcher.

Definition at line 97 of file ChatServiceSearcher.cpp.

References TChatSdpAttributeParser::TChatSdpAttributeNode::SetCommand(), TChatSdpAttributeParser::TChatSdpAttributeNode::SetType(), and TChatSdpAttributeParser::TChatSdpAttributeNode::SetValue().

00098     {
00099     TChatSdpAttributeParser::TChatSdpAttributeNode attrib;
00100     attrib.SetCommand( TChatSdpAttributeParser::ECheckType );
00101     attrib.SetType( ETypeDES );
00102     iProtocolArray.Append( attrib );
00103 
00104     attrib.SetCommand( TChatSdpAttributeParser::ECheckType );
00105     attrib.SetType( ETypeDES );
00106     iProtocolArray.Append( attrib );
00107 
00108     attrib.SetCommand( TChatSdpAttributeParser::ECheckValue );
00109     attrib.SetType( ETypeUUID );
00110     attrib.SetValue( KL2CAP );
00111     iProtocolArray.Append( attrib );
00112 
00113     attrib.SetCommand( TChatSdpAttributeParser::ECheckEnd );
00114     iProtocolArray.Append( attrib );
00115   
00116     attrib.SetCommand( TChatSdpAttributeParser::ECheckType );
00117     attrib.SetType( ETypeDES );
00118     iProtocolArray.Append( attrib );
00119 
00120     attrib.SetCommand( TChatSdpAttributeParser::ECheckValue );
00121     attrib.SetType( ETypeUUID );
00122     attrib.SetValue( KRFCOMM );
00123     iProtocolArray.Append( attrib );
00124   
00125     attrib.SetCommand( TChatSdpAttributeParser::EReadValue );
00126     attrib.SetType( ETypeUint );
00127     attrib.SetValue( KRfcommChannel );
00128     iProtocolArray.Append( attrib );
00129 
00130     attrib.SetCommand( TChatSdpAttributeParser::ECheckEnd );
00131     iProtocolArray.Append( attrib );
00132   
00133     attrib.SetCommand( TChatSdpAttributeParser::ECheckEnd );
00134     iProtocolArray.Append( attrib );
00135 
00136     attrib.SetCommand( TChatSdpAttributeParser::EFinished );
00137     iProtocolArray.Append( attrib );
00138   
00139     return iProtocolArray;
00140     }

void CChatServiceSearcher::ConstructL (   )  [private]
 

ConstructL() Performs second phase construction of this object

Definition at line 76 of file ChatServiceSearcher.cpp.

00077     {
00078     // no implementation required
00079     }


Member Data Documentation

TUUID CChatServiceSearcher::iServiceClass [private]
 

iServiceClass the service class UUID to search for

Definition at line 110 of file ChatServiceSearcher.h.

TInt CChatServiceSearcher::iPort [private]
 

iPort the port number that the remote service is installed

Definition at line 116 of file ChatServiceSearcher.h.

RArray<TChatSdpAttributeParser::TChatSdpAttributeNode> CChatServiceSearcher::iProtocolArray [private]
 

iProtocolArray the attribute list

Definition at line 122 of file ChatServiceSearcher.h.


© Nokia 2006

Back to top