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, TInt aListeningSocketType)
 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)
TInt ResolveMTU (RSocket &socket)
 Resolves bearer specific MTU for sockets created by this communicator type.


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
CBTDiscovereriDiscoverer
TBool iIsListening
TInt iListeningSocketType
RSocketServ iSocketServ
RSocket iListeningSocket
CConcreteConnectioniListeningConnection
CSdpAgent * iAgent
RSdp iSdpSession
RSdpDatabase iSdpDB
TSdpServRecordHandle iRecord
TInt iRecordVersion


Detailed Description

Communications handler with the bluetooth API.

Author:
Matti Dahlbom
Version:
beta0_9_1_2004-01-13, 1.22

Definition at line 54 of file bluetoothcommunicator.h.


Constructor & Destructor Documentation

CBTCommunicator::~CBTCommunicator  ) 
 

Definition at line 44 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, iSocketServ, TPeerData::p, and Log::Print().

Referenced by CServerSession::ConnectL().

void CBTCommunicator::ConstructL  )  [private]
 

Definition at line 61 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 77 of file bluetoothcommunicator.cpp.

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

Referenced by CServerSession::GetNumPeersL().

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

Definition at line 67 of file bluetoothcommunicator.cpp.

References CBTCommunicator(), and ConstructL().

Referenced by CServerSession::ConstructL().

TInt CBTCommunicator::OpenListeningSocketL  )  [private]
 

Definition at line 298 of file bluetoothcommunicator.cpp.

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

Referenced by StartListeningL().

TInt CBTCommunicator::ResolveMTU RSocket &  socket  )  [static]
 

Resolves bearer specific MTU for sockets created by this communicator type.

Parameters:
socket Reference to a socket created by this communicator type.
Returns:
Maximum transfer unit of the given connections as octets.

Definition at line 446 of file bluetoothcommunicator.cpp.

Referenced by CServerSession::ConnectL(), and CAsynchListen::RunL().

void CBTCommunicator::SetAvailabilityL TBool  aIsAvailable  )  [private]
 

Definition at line 285 of file bluetoothcommunicator.cpp.

References iRecord, iRecordVersion, and iSdpDB.

Referenced by StartListeningL().

void CBTCommunicator::SetChannelSecurityL TInt  aChannel  )  [private]
 

Definition at line 371 of file bluetoothcommunicator.cpp.

References iListeningSocketType.

Referenced by StartListeningL().

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

Definition at line 208 of file bluetoothcommunicator.cpp.

References iListeningSocketType, iRecord, iSdpDB, iSdpSession, and Log::Print().

Referenced by StartListeningL().

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

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
aListeningSocketType type of listeningt socket (either KRFCOMM or KL2CAP)
Returns:
listening connection

Definition at line 405 of file bluetoothcommunicator.cpp.

References iIsListening, iListeningConnection, iListeningSocketType, KErrBTCommAlreadyListening, KerrBTCommFailedToCreateListeningSocket, OpenListeningSocketL(), Log::Print(), SetAvailabilityL(), SetChannelSecurityL(), and StartAdvertisingL().

Referenced by CServerSession::StartListen().

void CBTCommunicator::StopListeningL  ) 
 

Stops listening for inbound connections.

Definition at line 186 of file bluetoothcommunicator.cpp.

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

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


Field Documentation

CSdpAgent* CBTCommunicator::iAgent [private]
 

Definition at line 142 of file bluetoothcommunicator.h.

CBTDiscoverer* CBTCommunicator::iDiscoverer [private]
 

Definition at line 128 of file bluetoothcommunicator.h.

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

TBool CBTCommunicator::iIsListening [private]
 

Definition at line 131 of file bluetoothcommunicator.h.

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

CConcreteConnection* CBTCommunicator::iListeningConnection [private]
 

Definition at line 139 of file bluetoothcommunicator.h.

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

RSocket CBTCommunicator::iListeningSocket [private]
 

Definition at line 138 of file bluetoothcommunicator.h.

Referenced by OpenListeningSocketL().

TInt CBTCommunicator::iListeningSocketType [private]
 

Definition at line 134 of file bluetoothcommunicator.h.

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

TSdpServRecordHandle CBTCommunicator::iRecord [private]
 

Definition at line 147 of file bluetoothcommunicator.h.

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

TInt CBTCommunicator::iRecordVersion [private]
 

Definition at line 150 of file bluetoothcommunicator.h.

Referenced by SetAvailabilityL().

RSdpDatabase CBTCommunicator::iSdpDB [private]
 

Definition at line 144 of file bluetoothcommunicator.h.

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

RSdp CBTCommunicator::iSdpSession [private]
 

Definition at line 143 of file bluetoothcommunicator.h.

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

CServerSession* CBTCommunicator::iServerSession [private]
 

Definition at line 125 of file bluetoothcommunicator.h.

Referenced by CBTCommunicator(), and OpenListeningSocketL().

RSocketServ CBTCommunicator::iSocketServ [private]
 

Definition at line 137 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 Tue Jan 13 15:47:08 2004 for CobainAPIImplementation by doxygen 1.3.5