Bluetooth Framework C++ Edition
Public Member Functions | Protected Member Functions | List of all members
CwclBluetoothRadio Class Referenceabstract

The class represents a local Bluetooth radio module. More...

#include <wclBluetooth.h>

Public Member Functions

 CwclBluetoothRadio (CwclBluetoothManager *const Manager)
 Creates a new radio object.
 
virtual ~CwclBluetoothRadio ()
 Frees the Radio object.
 
int GetAddress (__int64 &Address)
 Reads the local Bluetooth Radio MAC address.
 
int GetCod (unsigned long &Cod)
 Reads the local Bluetooth Radio Class Of Device (COD).
 
int GetConnectable (bool &Connectable)
 Read the local Bluetooth Radio connectable state.
 
int GetDiscoverable (bool &Discoverable)
 Read the local Bluetooth Radio discoverable state.
 
int GetHciVersion (unsigned char &Version, unsigned short &Revision)
 Reads the HCI version of the local Radio module.
 
int GetLmpVersion (unsigned char &Version, unsigned short &Subversion)
 Reads the LMP version of the local Radio module.
 
int GetManufacturer (unsigned short &Manu)
 Reads the Bluetooth Radio manufacturer ID.
 
int GetName (tstring &Name)
 Reads the local Radio name.
 
int SetCod (const unsigned long Cod)
 Changes the local Bluetooth Radio Class Of Device (COD).
 
int SetConnectable (const bool Connectable)
 Changes the connectable state of the local Bluetooth Radio.
 
int SetDiscoverable (const bool Discoverable)
 Changes the discoverable state of the local Bluetooth Radio.
 
int SetName (const tstring &Name)
 Sets a new name for the local Bluetooth Radio module.
 
int TurnOn ()
 The method turns the local Bluetooth radio ON.
 
int TurnOff ()
 The method turns the local Bluetooth radio OFF.
 
int Discover (const unsigned char Timeout, const wclBluetoothDiscoverKind Kind, const bool IncludePaired=false)
 Starts discovering for a remote Bluetooth enabled devices.
 
int Terminate ()
 Terminates the discovering of remote Bluetooth enabled devices.
 
int EnumPairedDevices (wclBluetoothAddresses &Devices)
 The method enumerates already paired devices.
 
int EnumPairedDevices (const wclBluetoothDiscoverKind Kind, wclBluetoothAddresses &Devices)
 The method enumerates already paired devices.
 
int EnumConnectedDevices (wclBluetoothAddresses &Devices)
 The method enumerates connected devices.
 
int EnumRemoteServices (const __int64 Address, const GUID *const Uuid, wclBluetoothServices &Services)
 Reads the available services from a remote Bluetooth device.
 
int IsRemoteDeviceInRange (const __int64 Address, bool &InRange)
 Checks if a remote device is in range.
 
int RemoteDisconnect (const __int64 Address)
 Forces a remote device disconnection.
 
int GetRemoteAddressType (const __int64 Address, wclBluetoothAddressType &AddrType)
 Reads a remote device address type.
 
int GetRemoteCod (const __int64 Address, unsigned long &Cod)
 Reads a remote device COD (Class Of Device).
 
int GetRemoteDeviceType (const __int64 Address, wclBluetoothDeviceType &DevType)
 Read a remote Bluetooth device type.
 
int GetRemoteName (const __int64 Address, tstring &Name)
 Queries a remote device's name.
 
int GetRemotePaired (const __int64 Address, bool &Paired)
 Reads a remote Bluetooth device paired status.
 
int GetRemoteConnectedStatus (const __int64 Address, bool &Connected)
 The function checks if the specified remote device is currently connected.
 
int GetRemoteRssi (const __int64 Address, char &Rssi)
 Reads RSSI value from a remote device.
 
int RemotePair (const __int64 Address, const wclBluetoothPairingMethod Method=pmAuto)
 Starts pairing with a remote Bluetooth device.
 
int RemoteUnpair (const __int64 Address, const wclBluetoothPairingMethod Method=pmAuto, const bool Force=false)
 Unpair a remote Bluetooth device.
 
int GetSimplePairingMode (bool &Enabled)
 Gets the radio Secure Simple Pairing mode.
 
int SetSimplePairingMode (const bool Enable)
 Sets the radio Secure Simple Pairing mode.
 
int CreateComPort (const __int64 Address, const GUID &Service, unsigned short &Number)
 Creates new virtual COM port.
 
int DestroyComPort (const unsigned short Number)
 Destroys the virtual COM port.
 
int EnumComPorts (wclVirtualComPorts &ComPorts)
 Enumerates already installed Bluetooth virtual COM ports.
 
int EnumInstalledServices (const __int64 Address, wclBluetoothInstalledServices &Services)
 Enumerates services installed for specified Bluetooth device.
 
int InstallDevice (const __int64 Address, const GUID &Service)
 Install drivers for specified Bluetooth device.
 
int UninstallDevice (const __int64 Address, const GUID &Service)
 Uninstall drivers for specified Bluetooth device.
 
wclBluetoothApi GetApi () const
 Gets a Bluetooth driver (API) supported by this Bluetooth object.
 
 __declspec (property(get=GetApi)) wclBluetoothApi Api
 Gets a Bluetooth driver (API) supported by this Bluetooth object.
 
tstring GetApiName () const
 Gets a supported Bluetooth API name.
 
 __declspec (property(get=GetApiName)) tstring ApiName
 Gets a supported Bluetooth API name.
 
bool GetAvailable () const
 Gets a Radio hardware state.
 
 __declspec (property(get=GetAvailable)) bool Available
 Gets a Radio hardware state.
 
bool GetClassicSupported () const
 Gets the Classic Bluetooth support status.
 
 __declspec (property(get=GetClassicSupported)) bool ClassicSupported
 Gets the Classic Bluetooth support status.
 
wclVirtualComPorts GetComPorts () const
 Gets the array of the created virtual COM ports.
 
 __declspec (property(get=GetComPorts)) wclVirtualComPorts ComPorts
 Gets the array of the created virtual COM ports.
 
bool GetDiscovering () const
 Gets discovering state.
 
 __declspec (property(get=GetDiscovering)) bool Discovering
 Gets discovering state.
 
bool GetLeSupported () const
 Gets the Bluetooth Low Energy support status.
 
 __declspec (property(get=GetLeSupported)) bool LeSupported
 Gets the Bluetooth Low Energy support status.
 
CwclBluetoothManagerGetManager () const
 Gets the CwclBluetoothManager object that owns the Radio.
 
 __declspec (property(get=GetManager)) CwclBluetoothManager *Manager
 Gets the CwclBluetoothManager object that owns the Radio.
 
bool GetPairing () const
 Gets a manual pairing state.
 
 __declspec (property(get=GetPairing)) bool Pairing
 Gets a manual pairing state.
 
bool GetPlugged () const
 Gets a Radio hardware physical state.
 
 __declspec (property(get=GetPlugged)) bool Plugged
 Gets a Radio hardware physical state.
 

Protected Member Functions

virtual void MessageReceived (const CwclMessage *const Message)
 The method called when a new notification message received.
 
virtual void DoAuthenticationCompleted (const __int64 Address, const int Error)
 Fires the OnAuthenticationCompleted event.
 
virtual void DoConfirm (const __int64 Address, bool &Confirm)
 Fires the OnConfirm event.
 
virtual void DoDeviceFound (const __int64 Address)
 Fires the OnDeviceFound event.
 
virtual void DoDiscoveringCompleted (const int Error)
 Fires the OnDiscoveringCompleted event.
 
virtual void DoDiscoveringStarted ()
 Fires the OnDiscoveringStarted event.
 
virtual void DoIoCapabilityRequest (const __int64 Address, wclBluetoothMitmProtection &Mitm, wclBluetoothIoCapability &IoCapability, bool &OobPresent)
 Fires the OnIoCapabilityRequest event.
 
virtual void DoNumericComparison (const __int64 Address, const unsigned long Number, bool &Confirm)
 Fires the OnNumericComparison event.
 
virtual void DoOobDataRequest (const __int64 Address, wclBluetoothOobData &OobData)
 Fires the OnOobDataRequest event.
 
virtual void DoPasskeyNotification (const __int64 Address, const unsigned long Passkey)
 Fores the OnPasskeyNotification event.
 
virtual void DoPasskeyRequest (const __int64 Address, unsigned long &Passkey)
 Fires the OnPasskeyRequest event.
 
virtual void DoPinRequest (const __int64 Address, tstring &Pin)
 Fires the OnPinRequest event.
 
virtual void DoProtectionLevelRequest (const __int64 Address, wclBluetoothLeProtectionLevel &Protection)
 Fires the OnProtectionLevelRequest event.
 
virtual void DoStatusChanged ()
 Fires the OnStatusChanged event.
 
virtual int HalGetFunctions ()=0
 Implements a driver-dependent code for getting API functions pointers.
 
virtual int HalInitialize ()=0
 Implements a driver-dependent code for API initialization.
 
virtual int HalLoadApi ()=0
 Implements a driver-dependent code for loading API DLLs.
 
virtual int HalRegisterCallbacks ()=0
 Implements a driver-dependent code for callback registration.
 
virtual int HalSetGlobalInstance ()=0
 Implements a driver-dependent code for setting the Radio object global instance variable.
 
virtual void HalClearFunctions ()=0
 Implements a driver-dependent code for API functions clearing.
 
virtual void HalClearGlobalInstance ()=0
 Implements a driver-dependent code for clearing the global instance of the Radio object.
 
virtual void HalTerminateOperations ()=0
 Implements a driver-dependent code for pending operation termination.
 
virtual void HalUninitialize ()=0
 Implements a driver-dependent code for driver uninitialization.
 
virtual void HalUnloadApi ()=0
 Implements a driver-dependent code for API unloading.
 
virtual void HalUnregisterCallbacks ()=0
 Implements a driver-dependent code for callbacks unregistering.
 
virtual int HalGetAddress (__int64 &Address)=0
 Implements a hardware-dependent code for Local Bluetooth Radio module MAC address reading.
 
virtual int HalGetCod (unsigned long &Cod)=0
 Implements a hardware-dependent code for Local Bluetooth Radio module Class Of Device (COD) reading.
 
virtual int HalGetConnectable (bool &Connectable)=0
 Implements a hardware-dependent code for reading the local Bluetooth Radio connectable state.
 
virtual int HalGetDiscoverable (bool &Discoverable)=0
 Implements a hardware-dependent code to read the local Bluetooth Radio discoverable state.
 
virtual int HalGetHciVersion (unsigned char &Version, unsigned short &Revision)=0
 Implements a hardware-dependent code to reads the HCI version of the local Radio module.
 
virtual int HalGetLmpVersion (unsigned char &Version, unsigned short &Subversion)=0
 Implements a hardware-dependent code to reading the LMP version of the local Radio module.
 
virtual int HalGetManufacturer (unsigned short &Manu)=0
 Implements a hardware-dependent code to read the Bluetooth Radio manufacturer ID.
 
virtual int HalGetName (tstring &Name)=0
 Implements a hardware-dependent code for reading the local Radio name.
 
virtual int HalSetCod (const unsigned long Cod)=0
 Implements a hardware-dependent code to changing the local Bluetooth Radio Class Of Device (COD).
 
virtual int HalSetConnectable (const bool Connectable)=0
 Implements a hardware-dependent code to changing the connectable state of the local Bluetooth Radio.
 
virtual int HalSetDiscoverable (const bool Discoverable)=0
 Implements a hardware-dependent code for changing the discoverable state of the local Bluetooth Radio.
 
virtual int HalSetName (const tstring &Name)=0
 Implements a hardware-dependent code for changing the local Bluetooth Radio module name.
 
virtual int HalTurnOn ()=0
 The method turns the local Bluetooth radio ON.
 
virtual int HalTurnOff ()=0
 The method turns the local Bluetooth radio OFF.
 
virtual int HalDiscoverClassic (const unsigned char Timeout)=0
 Implements a hardware-dependent code to start discovering for a remote Classic Bluetooth devices.
 
virtual int HalDiscoverBle (const unsigned char Timeout)=0
 Implements a hardware-dependent code to start discovering for a remote Low Energy Bluetooth devices.
 
virtual int HalTerminate ()=0
 Implements a hardware-dependent code for discovering termination.
 
virtual int HalEnumPairedDevices (wclBluetoothAddresses &Devices)=0
 Implements a hardware-dependent code for paired devices enumerating.
 
virtual int HalEnumConnectedDevices (wclBluetoothAddresses &Devices)=0
 Implements a hardware-dependent code for connected devices enumerating.
 
virtual int HalEnumRemoteServices (const __int64 Address, const GUID *const Uuid, wclBluetoothServices &Services)=0
 Implements a hardware-dependent code for reading the available services from a remote Bluetooth device.
 
virtual int HalIsRemoteDeviceInRange (const __int64 Address, bool &InRange)=0
 Implements a hardware-dependent code to check if a remote device is in range.
 
virtual int HalRemoteDisconnect (const __int64 Address)=0
 Implements a hardware-dependent code to disconnect a remote device.
 
virtual int HalGetRemoteAddressType (const __int64 Address, wclBluetoothAddressType &AddrType)=0
 Implements a hardware-dependent code for reading a remote device address type.
 
virtual int HalGetRemoteCod (const __int64 Address, unsigned long &Cod)=0
 Implements a hardware-dependent code for reading a remote device COD (Class Of Device).
 
virtual int HalGetRemoteDeviceType (const __int64 Address, wclBluetoothDeviceType &DevType)=0
 Implements a hardware-dependent code to reading a remote Bluetooth device type.
 
virtual int HalGetRemoteName (const __int64 Address, tstring &Name)=0
 Implements a hardware-dependent code for querying a remote device's name.
 
virtual int HalGetRemotePaired (const __int64 Address, bool &Paired)=0
 Implements a hardware-dependent code for reading a remote Bluetooth device paired status.
 
virtual int HalGetRemoteConnectedStatus (const __int64 Address, bool &Connected)=0
 The function checks if the specified remote device is currently connected.
 
virtual int HalGetRemoteRssi (const __int64 Address, char &Rssi)=0
 Reads RSSI value from a remote device.
 
virtual int HalConfirmReply (const __int64 Address, const bool Confirm)=0
 Implements a hardware-dependent code to reply on a confirm only pairing request.
 
virtual int HalIoCapabilityReply (const __int64 Address, const wclBluetoothMitmProtection Mitm, const wclBluetoothIoCapability IoCapability, const bool OobPresent)=0
 Implements a hardware-dependent code to reply on an IO capability request.
 
virtual int HalNumericComparisonReply (const __int64 Address, const unsigned long Value, const bool Confirm)=0
 Implements a hardware-dependent code to reply on a numeric comparison request.
 
virtual int HalOobDataReply (const __int64 Address, const wclBluetoothOobData &OobData)=0
 Implements a hardware-dependent code to reply on a Out Of Band pairing request.
 
virtual int HalPasskeyReply (const __int64 Address, const unsigned long Passkey)=0
 Implements a hardware-dependent code to reply for a passkey request event.
 
virtual int HalPinReply (const __int64 Address, const tstring &Pin)=0
 Implements a hardware-dependent code to reply for a PIN request event.
 
virtual int HalProtectionLevelReply (const __int64 Address, const wclBluetoothLeProtectionLevel Protection)=0
 Implements a hardware-dependent code to reply for a pairing protection level request event.
 
virtual int HalRemotePair (const __int64 Address, const wclBluetoothPairingMethod Method)=0
 Implements a hardware-dependent code for pairing with a remote Bluetooth device.
 
virtual int HalRemoteUnpair (const __int64 Address, const wclBluetoothPairingMethod Method)=0
 Implements a hardware-dependent code to unpair a remote Bluetooth device.
 
virtual int HalGetSimplePairingMode (bool &Enabled)=0
 Implements a hardware-dependent code that reads a radio Secure Simple Pairing mode.
 
virtual int HalSetSimplePairingMode (const bool Enable)=0
 Implements a hardware-dependent code that writes a radio Secure Simple Pairing mode.
 
virtual int HalCreateConnection (const wclBluetoothConnectionType ConnectionType, CwclCustomConnection *&Connection)=0
 Creates a hardware-dependent connection object based on connection type.
 
virtual int HalCreateComPort (const __int64 Address, const GUID &Service, unsigned short &Number)=0
 Creates new virtual COM port.
 
virtual int HalDestroyComPort (const unsigned short Number)=0
 Destroys the virtual COM port.
 
virtual int HalEnumComPorts (wclVirtualComPorts &ComPorts)=0
 Enumerates already installed Bluetooth virtual COM ports.
 
virtual int HalEnumInstalledServices (const __int64 Address, wclBluetoothInstalledServices &Services)=0
 Enumerates services installed for specified Bluetooth device.
 
virtual int HalInstallDevice (const __int64 Address, const GUID &Service)=0
 Install drivers for specified Bluetooth device.
 
virtual int HalUninstallDevice (const __int64 Address, const GUID &Service)=0
 Uninstall drivers for specified Bluetooth device.
 
virtual wclBluetoothApi HalGetApi () const =0
 Returns a Bluetooth API supported by the Radio object.
 
virtual tstring HalGetApiName () const =0
 Returns a supported Bluetooth API name.
 
virtual bool HalGetAvailable () const =0
 Implements a hardware-dependent code to check a Bluetooth hardware state.
 
virtual bool HalGetPlugged () const =0
 Implements a hardware-dependent code to check a Bluetooth hardware physical state.
 
int CheckAvailable () const
 The method checks that a Bluetooth driver and a hardware is available.
 
bool GetIncludePaired () const
 Gets the devices discovering modification flag.
 
 __declspec (property(get=GetIncludePaired)) bool IncludePaired
 Gets the devices discovering modification flag.
 
bool GetLeDiscovering () const
 Gets the discovering type flag.
 
 __declspec (property(get=GetLeDiscovering)) bool LeDiscovering
 Gets the discovering type flag.
 
CwclMessageReceiverGetReceiver () const
 Gets the message receiver object.
 
 __declspec (property(get=GetReceiver)) CwclMessageReceiver *Receiver
 Gets the message receiver object.
 
__int64 GetPairAddress () const
 Gets the pairing device address for manual pairing.
 
 __declspec (property(get=GetPairAddress)) __int64 PairAddress
 Gets the pairing device address for manual pairing.
 

Detailed Description

The class represents a local Bluetooth radio module.

An application must never create or destroy this class directly. Instead of that an application must use methods of the CwclBluetoothManager component.

The class is thread safe.

The only single instance of the class for each supported Bluetooth driver can be created.

See also
CwclBluetoothManager