Bluetooth Framework C++ Edition
|
The Bluetooth Manager component. More...
#include <wclBluetooth.h>
Public Member Functions | |
CwclBluetoothManager () | |
Creates a new Bluetooth Manager component. | |
virtual | ~CwclBluetoothManager () |
Frees the component. | |
int | Close () |
Closes the Bluetooth Manager and releases all allocated resources. | |
int | Open (const wclBluetoothApis Apis, const bool HandlePairing=true) |
Opens the Bluetooth Manager and allocated required hardware resources. | |
int | Open (const bool HandlePairing=true) |
Opens the Bluetooth Manager and allocated required hardware resources. | |
int | GetRadio (CwclBluetoothRadio *&Radio) const |
Gets the first available Radio object. | |
int | GetLeRadio (CwclBluetoothRadio *&Radio) const |
Gets the first available Radio object that supports Bluetooth Low Energy features. | |
int | GetClassicRadio (CwclBluetoothRadio *&Radio) const |
Gets the first available Radio object that supports Classic Bluetooth features. | |
bool | GetActive () const |
Gets the Bluetooth Manager state. | |
__declspec (property(get=GetActive)) bool Active | |
Gets the Bluetooth Manager state. | |
size_t | GetCount () const |
Gets the number of available Bluetooth Radios. | |
__declspec (property(get=GetCount)) size_t Count | |
Gets the number of available Bluetooth Radios. | |
bool | GetDiscovering () |
Gets the discovering state. | |
__declspec (property(get=GetDiscovering)) bool Discovering | |
Gets the discovering state. | |
bool | GetHandlePairing () const |
Gets the pairing handling flag. | |
__declspec (property(get=GetHandlePairing)) bool HandlePairing | |
Gets the pairing handling flag. | |
CwclBluetoothRadio * | GetRadios (const size_t Index) const |
Gets the Bluetooth Radio by its index. | |
__declspec (property(get=GetRadios)) CwclBluetoothRadio *Radios[] | |
Gets the Bluetooth Radio by its index. | |
__event void | AfterOpen (void *Sender) |
The event fires after the Bluetooth Manager has been successfully opened. | |
__event void | BeforeClose (void *Sender) |
The event fires before the Bluetooth Manager will be closed. | |
__event void | OnAuthenticationCompleted (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, const int Error) |
The event fires when authentication (pairing) with a remote Bluetooth device has completed. | |
__event void | OnConfirm (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, bool &Confirm) |
The event fires when a remote Bluetooth device requires a pairing confirmation. | |
__event void | OnClosed (void *Sender) |
The event fires when the Bluetooth Manager has completely been closed. | |
__event void | OnDeviceFound (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address) |
The event fires when a new remote Bluetooth device found during discovering. | |
__event void | OnDiscoveringCompleted (void *Sender, CwclBluetoothRadio *const Radio, const int Error) |
The event fires when discovering for remote Bluetooth devices has been completed. | |
__event void | OnDiscoveringStarted (void *Sender, CwclBluetoothRadio *const Radio) |
The event fires when discovering for remote Bluetooth devices has been started. | |
__event void | OnIoCapabilityRequest (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, wclBluetoothMitmProtection &Mitm, wclBluetoothIoCapability &IoCapability, bool &OobPresent) |
The event fires when a remote device requests an IO capability of the local Bluetooth device. | |
__event void | OnNumericComparison (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, const unsigned long Number, bool &Confirm) |
The event fires when a remote Bluetooth device requires a numeric comparison pairing. | |
__event void | OnOobDataRequest (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, wclBluetoothOobData &OobData) |
The event fires when a remote device requests an Out Of Band pairing data. | |
__event void | OnPasskeyNotification (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, const unsigned long Passkey) |
The event fires when a remote Bluetooth device notifies an application about its passkey. | |
__event void | OnPasskeyRequest (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, unsigned long &Passkey) |
The event fires when a remote Bluetooth device requires a passkey for pairing. | |
__event void | OnPinRequest (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, tstring &Pin) |
The event fires when a remote Bluetooth device requires a legacy PIN pairing. | |
__event void | OnProtectionLevelRequest (void *Sender, CwclBluetoothRadio *const Radio, const __int64 Address, wclBluetoothLeProtectionLevel &Protection) |
The event fires during BLE pairing to request required pairing protection level. | |
__event void | OnStatusChanged (void *Sender, CwclBluetoothRadio *const Radio) |
The event fires when a status of a Bluetooth hardware or driver has been changed. | |
Protected Member Functions | |
virtual void | DoAfterOpen () |
Fires the AfterOpen event. | |
virtual void | DoAuthenticationCompleted (CwclBluetoothRadio *const Radio, const __int64 Address, const int Error) |
Fires the OnAuthenticationCompleted event. | |
virtual void | DoBeforeClose () |
Fires the BeforeClose event. | |
virtual void | DoClosed () |
Fires the OnClosed event. | |
virtual void | DoConfirm (CwclBluetoothRadio *const Radio, const __int64 Address, bool &Confirm) |
Fires the OnConfirm event. | |
virtual void | DoDeviceFound (CwclBluetoothRadio *const Radio, const __int64 Address) |
Fires the OnDeviceFound event. | |
virtual void | DoDiscoveringCompleted (CwclBluetoothRadio *const Radio, const int Error) |
Fires the OnDiscoveringCompleted event. | |
virtual void | DoDiscoveringStarted (CwclBluetoothRadio *const Radio) |
Fires the OnDiscoveringStarted event. | |
virtual void | DoIoCapabilityRequest (CwclBluetoothRadio *const Radio, const __int64 Address, wclBluetoothMitmProtection &Mitm, wclBluetoothIoCapability &IoCapability, bool &OobPresent) |
Fires the OnIoCapabilityRequest event. | |
virtual void | DoNumericComparison (CwclBluetoothRadio *const Radio, const __int64 Address, const unsigned long Number, bool &Confirm) |
Fires the OnNumericComparison event. | |
virtual void | DoOobDataRequest (CwclBluetoothRadio *const Radio, const __int64 Address, wclBluetoothOobData &OobData) |
Fires the OnOobDataRequest event. | |
virtual void | DoPasskeyNotification (CwclBluetoothRadio *const Radio, const __int64 Address, const unsigned long Passkey) |
Fores the OnPasskeyNotification event. | |
virtual void | DoPasskeyRequest (CwclBluetoothRadio *const Radio, const __int64 Address, unsigned long &Passkey) |
Fires the OnPasskeyRequest event. | |
virtual void | DoPinRequest (CwclBluetoothRadio *const Radio, const __int64 Address, tstring &Pin) |
Fires the OnPinRequest event. | |
virtual void | DoProtectionLevelRequest (CwclBluetoothRadio *const Radio, const __int64 Address, wclBluetoothLeProtectionLevel &Protection) |
Fires the OnProtectionLevelRequest event. | |
virtual void | DoStatusChanged (CwclBluetoothRadio *const Radio) |
Fires the OnStatusChanged event. | |
The Bluetooth Manager component.
The CwclBluetoothManager
is the main component of the Bluetooth Framework. Each application that uses the Bluetooth Framework must have one and only one active instance of the Bluetooth Manager.
This component must be created and opened in an application's main thread only.