BluetoothDiscoveryPrivate Class Reference

Inherits MListenerObserver, MConnectorObserver, MDeviceDiscoObserver, MServiceDiscoObserver, MListenerObserver, MConnectorObserver, MDeviceDiscoObserver, and MServiceDiscoObserver.

List of all members.

Public Types

enum  TBluetoothDiscoveryMode {
  EStopDeviceDiscovery = 0, EDeviceDiscoveryComplete, EHasDevices, EHasServices,
  EHasConnections, EStopSlave, ESendMessage, EStopDeviceDiscovery = 0,
  EStartSlave, EHasDevices, EHasServices, EHasConnections,
  EStopSlave, ESendMessage
}
enum  TBluetoothDiscoveryMode {
  EStopDeviceDiscovery = 0, EDeviceDiscoveryComplete, EHasDevices, EHasServices,
  EHasConnections, EStopSlave, ESendMessage, EStopDeviceDiscovery = 0,
  EStartSlave, 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 ()
 BluetoothDiscoveryPrivate (BluetoothDiscovery *aPublicAPI)
void TurnBtOnL ()
void DiscoverDevicesL ()
void DiscoverServicesL ()
void StopDiscovery ()
void SendMessageL ()
void StartSlaveL ()
void ConnectDevicesL ()
void StopSlaveL ()
void DisconnectDevices ()
void ShowConnectedDevicesL ()
 ~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)
static BluetoothDiscoveryPrivateNewL (BluetoothDiscovery *aPublicAPI=0)
static BluetoothDiscoveryPrivateNewLC (BluetoothDiscovery *aPublicAPI)

Public Attributes

CListeneriListener
CDeviceDiscovereriDeviceDiscoverer
CServiceAdvertiseriServiceAdvertiser
CServiceDiscovereriServiceDiscoverer
TBool iIsSlave
TBool iIsMaster

Detailed Description

CBluetoothPMPExampleEngine application engine class.

Definition at line 108 of file bluetoothdiscovery_symbian.h.


Constructor & Destructor Documentation

BluetoothDiscoveryPrivate::~BluetoothDiscoveryPrivate (  ) 

~CBluetoothPMPExampleContainer()

Destroy the object and release all memory objects

CBluetoothPMPExampleEngine::~CBluetoothPMPExampleEngine() destructor

Definition at line 93 of file bluetoothdiscovery_symbian.cpp.

BluetoothDiscoveryPrivate::~BluetoothDiscoveryPrivate (  ) 

~CBluetoothPMPExampleContainer()

Destroy the object and release all memory objects


Member Function Documentation

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

NewL()

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]

NewLC()

Definition at line 43 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::DiscoverDevicesL (  ) 

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

StartServiceDiscovery()

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

StartSlaveL()

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

CBluetoothPMPExampleEngine::StartSlaveL()

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

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

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

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

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]

HandleListenerDataReceivedL()

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]

HandleConnectedDataReceivedL()

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]

HandleListenerConnectedL()

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]

HandleListenerDisconnectedL()

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]

HandleDeviceDiscoveryComplete()

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]

DeviceDiscovered()

discussion nofify observer that a new device was found.

Implements MDeviceDiscoObserver.

Definition at line 558 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::HandleServiceDiscoveryCompleteL (  )  [virtual]

HandleServiceDiscoveryCompleteL()

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]

ReportServiceDiscoveryErrorL()

An error has occured during service discovery

Implements MServiceDiscoObserver.

Definition at line 580 of file bluetoothdiscovery_symbian.cpp.

TBool BluetoothDiscoveryPrivate::HasConnections (  ) 

HasConnection()

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

IsDiscoveryActive()

It returns ETrue if there is an ongoing device discovery

Definition at line 613 of file bluetoothdiscovery_symbian.cpp.

void BluetoothDiscoveryPrivate::StopDiscovery (  ) 

StopDiscovery()

It stops device discovery if there is any ongoing

Definition at line 621 of file bluetoothdiscovery_symbian.cpp.

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

NewL()

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

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

DiscoverDevicesL()

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

void BluetoothDiscoveryPrivate::DiscoverServicesL (  ) 

StartServiceDiscovery()

Starts service discovery for services on remote devices.

void BluetoothDiscoveryPrivate::StartSlaveL (  ) 

StartSlaveL()

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

void BluetoothDiscoveryPrivate::SendMessageL (  ) 

SendMessageL()

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

void BluetoothDiscoveryPrivate::ConnectDevicesL (  ) 

ConnectDevicesL()

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

void BluetoothDiscoveryPrivate::DisconnectDevices (  ) 

DisconnectDevices()

Disconnects from connected remote devices.

void BluetoothDiscoveryPrivate::ShowConnectedDevicesL (  ) 

ShowConnectedDevicesL()

Displays the connected remote devices.

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

HandleListenerDataReceivedL()

Handles the data slave received from a master.

param aData the data received.

Implements MListenerObserver.

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

HandleConnectedDataReceivedL()

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.

Implements MConnectorObserver.

void BluetoothDiscoveryPrivate::HandleListenerConnectedL (  )  [virtual]

HandleListenerConnectedL()

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

Implements MListenerObserver.

void BluetoothDiscoveryPrivate::HandleListenerDisconnectedL (  )  [virtual]

HandleListenerDisconnectedL()

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

Implements MListenerObserver.

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

HandleDeviceDiscoveryComplete()

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

Implements MDeviceDiscoObserver.

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

DeviceDiscovered()

discussion nofify observer that a new device was found.

Implements MDeviceDiscoObserver.

void BluetoothDiscoveryPrivate::HandleServiceDiscoveryCompleteL (  )  [virtual]

HandleServiceDiscoveryCompleteL()

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

Implements MServiceDiscoObserver.

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

ReportServiceDiscoveryErrorL()

An error has occured during service discovery

Implements MServiceDiscoObserver.

TBool BluetoothDiscoveryPrivate::HasConnections (  ) 

HasConnection()

discussion Returns true if master has any slave connections.

TBool BluetoothDiscoveryPrivate::IsDiscoveryActive (  ) 

IsDiscoveryActive()

It returns ETrue if there is an ongoing device discovery

void BluetoothDiscoveryPrivate::StopDiscovery (  ) 

StopDiscovery()

It stops device discovery if there is any ongoing


Generated by  doxygen 1.6.2