BluetoothDiscoveryPrivate Class Reference

Inherits MListenerObserver, MConnectorObserver, MDeviceDiscoObserver, and MServiceDiscoObserver.

List of all members.

Public Types

enum  TBluetoothDiscoveryMode {
  EStopDeviceDiscovery = 0, EDeviceDiscoveryComplete, EHasDevices, EHasServices,
  EHasConnections, EStopSlave, ESendMessage

Public Member Functions

 ~BluetoothDiscoveryPrivate ()
void DiscoverDevicesL ()
void DiscoverServicesL ()
void StartSlaveL ()
void StopSlaveL ()
void SendMessageL ()
void ConnectDevicesL ()
void DisconnectDevices ()
void ShowConnectedDevicesL ()
void HandleListenerDataReceivedL (const TDesC &aData)
void HandleConnectorDataReceivedL (THostName aName, const TDesC &aData)
void HandleConnectorErrorL (THostName aName, TInt aError)
void HandleListenerConnectedL ()
void HandleListenerDisconnectedL ()
void HandleDeviceDiscoveryComplete (TInt aError)
void DeviceDiscovered (const TDeviceData &aDevice)
void HandleServiceDiscoveryCompleteL ()
void ReportServiceDiscoveryErrorL (TInt aError)
TBool HasConnections ()
void TurnBtOnL ()
TBool IsDiscoveryActive ()
void StopDiscovery ()

Static Public Member Functions

static BluetoothDiscoveryPrivateNewL (BluetoothDiscovery *aPublicAPI=0)
static BluetoothDiscoveryPrivateNewLC (BluetoothDiscovery *aPublicAPI)

Public Attributes

TBool iIsSlave
TBool iIsMaster

Detailed Description

CBluetoothPMPExampleEngine application engine class.

Definition at line 108 of file bluetoothdiscovery_symbian.h.

Constructor & Destructor Documentation

BluetoothDiscoveryPrivate::~BluetoothDiscoveryPrivate (  ) 


Destroy the object and release all memory objects

CBluetoothPMPExampleEngine::~CBluetoothPMPExampleEngine() destructor

Definition at line 93 of file bluetoothdiscovery_symbian.cpp.

Member Function Documentation

BluetoothDiscoveryPrivate * BluetoothDiscoveryPrivate::NewL ( BluetoothDiscovery aPublicAPI = 0  )  [static]


Create new CBluetoothPMPExampleEngine object return a pointer to the created instance of CBluetoothPMPExampleEngine

Definition at line 34 of file bluetoothdiscovery_symbian.cpp.

BluetoothDiscoveryPrivate * BluetoothDiscoveryPrivate::NewLC ( BluetoothDiscovery aPublicAPI  )  [static]


Definition at line 43 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::DiscoverDevicesL (  ) 


Discovers bluetooth devices within range. the discovered devices will be displayed to user.

CBluetoothPMPExampleEngine::DiscoverDevicesL() discover bluetooth devices within range.

Definition at line 126 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::DiscoverServicesL (  ) 


Starts service discovery for services on remote devices.

CBluetoothPMPExampleEngine::DiscoverServicesL() discover services provided by the discovered devices.

Definition at line 144 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::StartSlaveL (  ) 


Starts the application in slave more. the application will open listening socket to listen to incoming connection request, and advertise its services.


set application in slave mode. the device will be set to listen to a bluetooth channel, and advertise its service on the channel.

Definition at line 159 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::StopSlaveL (  ) 

CBluetoothPMPExampleEngine::StopSlaveL() Stop slave mode

Definition at line 186 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::SendMessageL (  ) 


Send a message to all connected slaves. the user will be prompted to enter the message text he/she wishes to send.

CBluetoothPMPExampleEngine::SendMessageL() send a message to all connected devices. user will send some default text.

Definition at line 301 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::ConnectDevicesL (  ) 


Connects to the remote devices that were discovered to offer the service we require.

CBluetoothPMPExampleEngine::ConnectDevicesL() attempt to connect on all discovered devices (up to 7)

Definition at line 226 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::DisconnectDevices (  ) 


Disconnects from connected remote devices.

CBluetoothPMPExampleEngine::DisconnectDevices() disconnect connected devices and clean up connections table

Definition at line 205 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::ShowConnectedDevicesL (  ) 


Displays the connected remote devices.

CBluetoothPMPExampleEngine::ShowConnectedDevicesL() display the devices we are connected to

Definition at line 270 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleListenerDataReceivedL ( const TDesC &  aData  )  [virtual]


Handles the data slave received from a master.

param aData the data received.

CBluetoothPMPExampleEngine::HandleListenerDataReceivedL(TDesC& aData) display data the slave listener receives from the master. this is a callback that CListener class will invoke when it receives new data.

Implements MListenerObserver.

Definition at line 336 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleConnectorDataReceivedL ( THostName  aName,
const TDesC &  aData 
) [virtual]


Handles the data a master received from a slave.

param aName the name of the slave that sent the data. param aData the data received.

CBluetoothPMPExampleEngine::HandleConnectorDataReceivedL (THostName aName, TDesC& aData) display data the master receives from a connected slave. this is a callback that CConnector class will invoke when it receives data from slave. Also echo the message to other slaves.

Implements MConnectorObserver.

Definition at line 377 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleConnectorErrorL ( THostName  aName,
TInt  aError 
) [virtual]

CBluetoothPMPExampleEngine::HandleConnectorErrorL(THostName aName,TInt aError)

Implements MConnectorObserver.

Definition at line 419 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleListenerConnectedL (  )  [virtual]


Handles the event of slave connection (slave was connected to by master). user will be notified of connection.

CBluetoothPMPExampleEngine::HandleListenerConnectedL() a callback received from CListener to indicate that it has been connected to

Implements MListenerObserver.

Definition at line 349 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleListenerDisconnectedL (  )  [virtual]


Handles the event of slave disconnection, the master connection to slave was terminated. user will be notitied of disconnection.

CBluetoothPMPExampleEngine::HandleListenerDisconnectedL() a callback received from CListener to indicate that it has been disconnected

Implements MListenerObserver.

Definition at line 359 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleDeviceDiscoveryComplete ( TInt  aError  )  [virtual]


Handles the event of device discovery completion. the discovered devices will be displayed to user.

CBluetoothPMPExampleEngine::HandleDeviceDiscoveryComplete() a callback received from device discoverer to indicate that the device discovery has completed.

Implements MDeviceDiscoObserver.

Definition at line 451 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::DeviceDiscovered ( const TDeviceData aDevice  )  [virtual]


discussion nofify observer that a new device was found.

Implements MDeviceDiscoObserver.

Definition at line 558 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleServiceDiscoveryCompleteL (  )  [virtual]


Handles the event of service discovery completion. the discovered services will be displayed to user.

CBluetoothPMPExampleEngine::HandleServiceDiscoveryCompleteL() a callback received from service discoverer to indicate that the service discovery has completed.

Implements MServiceDiscoObserver.

Definition at line 495 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::ReportServiceDiscoveryErrorL ( TInt  aError  )  [virtual]


An error has occured during service discovery

Implements MServiceDiscoObserver.

Definition at line 580 of file bluetoothdiscovery_symbian.cpp.

TBool BluetoothDiscoveryPrivate::HasConnections (  ) 


discussion Returns true if master has any slave connections.

CBluetoothPMPExampleEngine::HasConnections() returns true if master has any connections to slave(s)

Definition at line 537 of file bluetoothdiscovery_symbian.cpp.

TBool BluetoothDiscoveryPrivate::IsDiscoveryActive (  ) 


It returns ETrue if there is an ongoing device discovery

Definition at line 613 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::StopDiscovery (  ) 


It stops device discovery if there is any ongoing

Definition at line 621 of file bluetoothdiscovery_symbian.cpp.

Generated by  doxygen 1.6.2