Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

CBTCommunicator Class Reference

Communications handler with the bluetooth API. More...

#include <bluetoothcommunicator.h>


Public Member Functions

 ~CBTCommunicator ()
RSocket * ConnectL (TPeerData *aPeerData)
 Connects to a remote service.

void DiscoverPeersL (const RMessage &aMessage, CServerSession &aSession)
 Discover all matching bluetooth peers.

CConcreteConnectionStartListeningL (const TInt aServiceClassID, const TInt aApplicationID, const TDesC8 &aServiceName, const TDesC8 &aServiceDesc)
 Sets up a service described by the parameters and starts listening for incoming connections.

void StopListeningL ()
 Stops listening for inbound connections.


Static Public Member Functions

CBTCommunicatorNewL (CServerSession *aSession)

Private Member Functions

 CBTCommunicator (CServerSession *aSession)
void ConstructL ()
void StartAdvertisingL (TInt aPort, const TInt aServiceClassID, const TInt aApplicationID, const TDesC8 &aServiceName, const TDesC8 &aServiceDesc)
TInt OpenListeningSocketL ()
void SetChannelSecurityL (TInt aChannel)
void SetAvailabilityL (TBool aIsAvailable)

Private Attributes

CServerSessioniServerSession
CSdpAgent * iAgent
CBTDiscovereriDiscoverer
RSocketServ iSocketServ
RSocket iListeningSocket
CConcreteConnectioniListeningConnection
RSdp iSdpSession
RSdpDatabase iSdpDB
TSdpServRecordHandle iRecord
TInt iRecordVersion
TBool iIsListening


Detailed Description

Communications handler with the bluetooth API.

Author:
Matti Dahlbom
Version:
beta0_7_2003-12-08, 1.20

Definition at line 54 of file bluetoothcommunicator.h.


Constructor & Destructor Documentation

CBTCommunicator::~CBTCommunicator  ) 
 

Definition at line 43 of file bluetoothcommunicator.cpp.

References iDiscoverer, iIsListening, iSdpDB, iSdpSession, iSocketServ, Log::Print(), and StopListeningL().

CBTCommunicator::CBTCommunicator CServerSession aSession  )  [private]
 

Definition at line 36 of file bluetoothcommunicator.cpp.

References iServerSession.

Referenced by NewL().


Member Function Documentation

RSocket * CBTCommunicator::ConnectL TPeerData aPeerData  ) 
 

Connects to a remote service.

Parameters:
aPeerData peer data
Returns:
connected socket

Definition at line 129 of file bluetoothcommunicator.cpp.

References TPeerData::iDeviceAddress, TPeerData::iPort, and iSocketServ.

Referenced by CServerSession::ConnectL().

void CBTCommunicator::ConstructL  )  [private]
 

Definition at line 60 of file bluetoothcommunicator.cpp.

References iSocketServ.

Referenced by NewL().

void CBTCommunicator::DiscoverPeersL const RMessage &  aMessage,
CServerSession aSession
 

Discover all matching bluetooth peers.

Invoking this method will launch an active object that takes care of the actual discovery, and will call aMessage.Complete() upon completion of the discovery.

Parameters:
aSize pointer to size
aMessage original client-server call message

Definition at line 76 of file bluetoothcommunicator.cpp.

References TPeerData::iDeviceAddress, TPeerData::iDeviceName, iDiscoverer, TPeerData::iPort, TPeerData::iServiceID, iSocketServ, CBTDiscoverer::NewL(), CServerSession::SetPeerList(), CBTDiscoverer::StartL(), and TPeerDataList.

Referenced by CServerSession::GetNumPeersL().

CBTCommunicator * CBTCommunicator::NewL CServerSession aSession  )  [static]
 

Definition at line 66 of file bluetoothcommunicator.cpp.

References CBTCommunicator(), and ConstructL().

Referenced by CServerSession::ConstructL().

TInt CBTCommunicator::OpenListeningSocketL  )  [private]
 

Definition at line 286 of file bluetoothcommunicator.cpp.

References iListeningConnection, iListeningSocket, iServerSession, iSocketServ, KListeningQueueSize, CConcreteConnection::NewListeningL(), and Log::Print().

Referenced by StartListeningL().

void CBTCommunicator::SetAvailabilityL TBool  aIsAvailable  )  [private]
 

Definition at line 273 of file bluetoothcommunicator.cpp.

References iRecord, iRecordVersion, and iSdpDB.

Referenced by StartListeningL().

void CBTCommunicator::SetChannelSecurityL TInt  aChannel  )  [private]
 

Definition at line 370 of file bluetoothcommunicator.cpp.

Referenced by StartListeningL().

void CBTCommunicator::StartAdvertisingL TInt  aPort,
const TInt  aServiceClassID,
const TInt  aApplicationID,
const TDesC8 &  aServiceName,
const TDesC8 &  aServiceDesc
[private]
 

Definition at line 194 of file bluetoothcommunicator.cpp.

References iRecord, iSdpDB, and iSdpSession.

Referenced by StartListeningL().

CConcreteConnection * CBTCommunicator::StartListeningL const TInt  aServiceClassID,
const TInt  aApplicationID,
const TDesC8 &  aServiceName,
const TDesC8 &  aServiceDesc
 

Sets up a service described by the parameters and starts listening for incoming connections.

Parameters:
aServiceClassID 
aApplicationID 32-bit representation of the application BT UUID (short form)
aServiceName visible name of the service
aServiceDesc visible description of the service
Returns:
listening connection

Definition at line 403 of file bluetoothcommunicator.cpp.

References iIsListening, iListeningConnection, KErrBTCommAlreadyListening, KerrBTCommFailedToCreateListeningSocket, OpenListeningSocketL(), SetAvailabilityL(), SetChannelSecurityL(), and StartAdvertisingL().

Referenced by CServerSession::StartListen().

void CBTCommunicator::StopListeningL  ) 
 

Stops listening for inbound connections.

Definition at line 173 of file bluetoothcommunicator.cpp.

References iIsListening, iListeningConnection, iRecord, iSdpDB, and Log::Print().

Referenced by CServerSession::AbortListen(), ~CBTCommunicator(), and CServerSession::~CServerSession().


Field Documentation

CSdpAgent* CBTCommunicator::iAgent [private]
 

Definition at line 115 of file bluetoothcommunicator.h.

CBTDiscoverer* CBTCommunicator::iDiscoverer [private]
 

Definition at line 118 of file bluetoothcommunicator.h.

Referenced by DiscoverPeersL(), and ~CBTCommunicator().

TBool CBTCommunicator::iIsListening [private]
 

Definition at line 136 of file bluetoothcommunicator.h.

Referenced by StartListeningL(), StopListeningL(), and ~CBTCommunicator().

CConcreteConnection* CBTCommunicator::iListeningConnection [private]
 

Definition at line 123 of file bluetoothcommunicator.h.

Referenced by OpenListeningSocketL(), StartListeningL(), and StopListeningL().

RSocket CBTCommunicator::iListeningSocket [private]
 

Definition at line 122 of file bluetoothcommunicator.h.

Referenced by OpenListeningSocketL().

TSdpServRecordHandle CBTCommunicator::iRecord [private]
 

Definition at line 130 of file bluetoothcommunicator.h.

Referenced by SetAvailabilityL(), StartAdvertisingL(), and StopListeningL().

TInt CBTCommunicator::iRecordVersion [private]
 

Definition at line 133 of file bluetoothcommunicator.h.

Referenced by SetAvailabilityL().

RSdpDatabase CBTCommunicator::iSdpDB [private]
 

Definition at line 127 of file bluetoothcommunicator.h.

Referenced by SetAvailabilityL(), StartAdvertisingL(), StopListeningL(), and ~CBTCommunicator().

RSdp CBTCommunicator::iSdpSession [private]
 

Definition at line 126 of file bluetoothcommunicator.h.

Referenced by StartAdvertisingL(), and ~CBTCommunicator().

CServerSession* CBTCommunicator::iServerSession [private]
 

Definition at line 113 of file bluetoothcommunicator.h.

Referenced by CBTCommunicator(), and OpenListeningSocketL().

RSocketServ CBTCommunicator::iSocketServ [private]
 

Definition at line 121 of file bluetoothcommunicator.h.

Referenced by ConnectL(), ConstructL(), DiscoverPeersL(), OpenListeningSocketL(), and ~CBTCommunicator().


The documentation for this class was generated from the following files:
Generated on Mon Dec 8 10:26:08 2003 for CobainAPIImplementation by doxygen 1.3.5