Bluetooth Framework C++ Edition
Public Member Functions | Protected Member Functions | List of all members
CwclRfCommClientConnection Class Reference

The base class for all Classic Bluetooth (RFCOMM) client connections. More...

#include <wclBluetooth.h>

Inheritance diagram for CwclRfCommClientConnection:
CwclClientDataConnection CwclClientConnection CwclCustomConnection

Public Member Functions

 CwclRfCommClientConnection (CwclBluetoothRadio *const Radio)
 Create new Classic Bluetooth client connection.
 
int Connect (const __int64 Address, const GUID &Service, const unsigned char Channel=0, const bool Authentication=true, const bool Encryption=false, const unsigned long Timeout=10000)
 Connects to a remote device.
 
__int64 GetAddress () const
 Gets a remote device MAC address.
 
 __declspec (property(get=GetAddress)) __int64 Address
 Gets a remote device MAC address.
 
bool GetAuthentication () const
 Gets the authentication value.
 
 __declspec (property(get=GetAuthentication)) bool Authentication
 Gets the authentication value.
 
unsigned char GetChannel () const
 Gets the target service RFCOMM channel number. 0 to auto detection.
 
 __declspec (property(get=GetChannel)) unsigned char Channel
 Gets the target service RFCOMM channel number. 0 to auto detection.
 
bool GetEncryption () const
 Gets the encryption state of the connection.
 
 __declspec (property(get=GetEncryption)) bool Encryption
 Gets the encryption state of the connection.
 
CwclBluetoothRadioGetRadio () const
 Gets the connection owner.
 
 __declspec (property(get=GetRadio)) CwclBluetoothRadio *Radio
 Gets the connection owner.
 
GUID GetService () const
 Gets the target Bluetooth service UUID used for connection.
 
 __declspec (property(get=GetService)) GUID Service
 Gets the target Bluetooth service UUID used for connection.
 
- Public Member Functions inherited from CwclClientDataConnection
 CwclClientDataConnection ()
 Creates a new client data connection.
 
int GetReadBufferSize (unsigned long &Size)
 Reads the read buffer size.
 
int GetWriteBufferSize (unsigned long &Size)
 Reads the write buffer size.
 
int SetReadBufferSize (const unsigned long Size)
 Sets the read buffer size.
 
int SetWriteBufferSize (const unsigned long Size)
 Sets the write buffer size.
 
int Write (const void *const Data, const unsigned long Size, unsigned long &Written)
 Sends data to the connected device.
 
CwclCustomClientDataProcessorGetProcessor () const
 Gets the current Data Processor object assigned to the Connection.
 
 __declspec (property(get=GetProcessor)) CwclCustomClientDataProcessor *Processor
 
__event void OnData (void *Sender, const void *const Data, const unsigned long Size)
 The event fires when new data is received from the connected remote device.
 
- Public Member Functions inherited from CwclClientConnection
 CwclClientConnection ()
 Creates a new client connection.
 
virtual ~CwclClientConnection ()
 Frees the connection.
 
int Connect (const unsigned long Timeout=10000)
 Connects to a remote device.
 
int Disconnect ()
 Disconnects from the connected remote device.
 
wclClientState GetState () const
 Gets the connection state.
 
 __declspec (property(get=GetState)) wclClientState State
 Gets the connection state.
 
unsigned long GetTimeout () const
 Gets the connect timeout value.
 
 __declspec (property(get=GetTimeout)) unsigned long Timeout
 Gets the connect timeout value.
 
__event void OnConnect (void *Sender, const int Error)
 The event fires when a connection to a remote device has been completed (with or without success).
 
__event void OnDisconnect (void *Sender, const int Reason)
 The event fires when the remote connected device has been disconnected.
 
- Public Member Functions inherited from CwclCustomConnection
 CwclCustomConnection ()
 Creates a new connection.
 
virtual ~CwclCustomConnection ()
 Frees the connection.
 
CwclMessageReceiverGetReceiver () const
 Gets the connection message receiver object.
 
 __declspec (property(get=GetReceiver)) CwclMessageReceiver *Receiver
 Gets the connection message receiver object.
 
DWORD GetThreadId () const
 Gets the connection's thread ID.
 
 __declspec (property(get=GetThreadId)) DWORD ThreadId
 Gets the connection's thread ID.
 

Protected Member Functions

virtual void MessageReceived (const CwclMessage *const Message) override
 The method called when a new notification message received.
 
- Protected Member Functions inherited from CwclClientDataConnection
void NotifyDataReceived (const void *const Data, const unsigned long Size)
 Send a data notification message.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The message receiver calls this method when a new notification message has been received.
 
virtual void DoData (const void *const Data, const unsigned long Size)
 Fires the OnData event.
 
virtual int HalGetReadBufferSize (unsigned long &Size)=0
 Reads the read buffer size.
 
virtual int HalGetWriteBufferSize (unsigned long &Size)=0
 Reads the write buffer size.
 
virtual int HalSetReadBufferSize (const unsigned long Size)=0
 Sets the read buffer size.
 
virtual int HalSetWriteBufferSize (const unsigned long Size)=0
 Sets the write buffer size.
 
virtual int HalWrite (const void *const Data, const unsigned long Size, unsigned long &Written)=0
 Implements a hardware-dependent code that sends data to the connected device.
 
- Protected Member Functions inherited from CwclClientConnection
void InternalDisconnect (const int Reason)
 The internal disconnect method. Disconnects from a connected remote device.
 
void NotifyClosed (const int Reason)
 Send a Disconnect notification message.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The message receiver calls this method when a new notification message has been received.
 
virtual void DoConnect (const int Error)
 Fires the OnConnect event.
 
virtual void DoDisconnect (const int Reason)
 Fires the OnDisconnect event.
 
virtual int HalCommunicate (const HANDLE Event)
 Implements a hardware-dependent code that communicate with the connected remote device.
 
virtual int HalConnect (const HANDLE Event)=0
 Implements a hardware-dependent code that connects to a remote device.
 
virtual int HalDisconnect ()=0
 Implements a hardware-dependent code that disconnects from the connected remote device.
 
- Protected Member Functions inherited from CwclCustomConnection
virtual void MessageReceived (const CwclMessage *const Message)
 The message receiver calls this method when a new notification message has been received.
 
void Enter ()
 Enters the connection's critical section.
 
void Leave ()
 Exists *leaves) the connection's critical section.
 

Detailed Description

The base class for all Classic Bluetooth (RFCOMM) client connections.

An application must never create instances of this class directly. Instead of that an application must use related methods from the CwclBluetoothRadio object.

See also
CwclBluetoothRadio, CwclClientDataConnection