Direct-BT v3.2.3-1-g688f983
Direct-BT - Direct Bluetooth Programming.
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
direct_bt::BTManager Class Reference

A thread safe singleton handler of the BTAdapter manager, e.g. More...

#include <BTManager.hpp>

Inheritance diagram for direct_bt::BTManager:
Collaboration diagram for direct_bt::BTManager:

Public Types

enum  Defaults : int32_t { ClientMaxMTU = 512 }
 
typedef jau::nsize_t size_type
 

Public Member Functions

 BTManager (const BTManager &)=delete
 
 ~BTManager () noexcept override
 
void addChangedAdapterSetCallback (ChangedAdapterSetFunc f)
 Adds the given ChangedAdapterSetFunc to this manager. More...
 
void addChangedAdapterSetCallback (const ChangedAdapterSetCallback &l)
 ChangedAdapterSetCallback handling. More...
 
bool addDeviceToWhitelist (const uint16_t dev_id, const BDAddressAndType &addressAndType, const HCIWhitelistConnectType ctype) noexcept
 Add the given device to the adapter's autoconnect whitelist. More...
 
bool addMgmtEventCallback (const int dev_id, const MgmtEvent::Opcode opc, const MgmtEventCallback &cb) noexcept
 MgmtEventCallback handling
More...
 
void clearAllCallbacks () noexcept
 Removes all MgmtEventCallbacks from all MgmtEvent::Opcode lists. More...
 
HCIStatusCode clearIdentityResolvingKeys (const uint16_t dev_id) noexcept
 
void clearMgmtEventCallbacks (const MgmtEvent::Opcode opc) noexcept
 Removes all MgmtEventCallbacks from the to the named MgmtEvent::Opcode list. More...
 
void close () noexcept
 
std::string get_java_class () const noexcept override
 
std::shared_ptr< BTAdaptergetAdapter (const uint16_t dev_id) const noexcept
 Returns the DBTAdapter with the given dev_id, or nullptr if not found. More...
 
size_type getAdapterCount () const noexcept
 retrieve information gathered at startup More...
 
jau::darray< std::shared_ptr< BTAdapter > > getAdapters ()
 Returns a list of currently added DBTAdapter. More...
 
std::shared_ptr< ConnectionInfogetConnectionInfo (const uint16_t dev_id, const BDAddressAndType &addressAndType) noexcept
 
std::shared_ptr< BTAdaptergetDefaultAdapter () const noexcept
 Returns the default AdapterInfo. More...
 
SMPIOCapability getIOCapability (const uint16_t dev_id) const noexcept
 
HCIStatusCode initializeAdapter (AdapterInfo &adapterInfo, const uint16_t dev_id, const BTMode btMode, const bool powerOn) noexcept
 Initialize the adapter with default values, including power-on. More...
 
bool isDeviceWhitelisted (const uint16_t dev_id, const BDAddressAndType &addressAndType) noexcept
 Returns true, if the adapter's device is already whitelisted. More...
 
bool isOpen () const noexcept
 Returns true if this mgmt instance is open and hence valid, otherwise false. More...
 
bool isValidLongTermKeyAddressAndType (const EUI48 &address, const BDAddressType &address_type) const noexcept
 Security commands. More...
 
void operator= (const BTManager &)=delete
 
std::vector< MgmtDefaultParamreadDefaultSysParam (const uint16_t dev_id) noexcept
 Read default connection parameter for given adapter to the kernel. More...
 
size_type removeAllChangedAdapterSetCallbacks () noexcept
 Remove all added ChangedAdapterSetCallback entries from this manager. More...
 
size_type removeAllDevicesFromWhitelist () noexcept
 Remove all previously added devices from the autoconnect whitelist. More...
 
size_type removeChangedAdapterSetCallback (ChangedAdapterSetFunc f)
 Remove the given ChangedAdapterSetFunc from this manager. More...
 
size_type removeChangedAdapterSetCallback (const ChangedAdapterSetCallback &l)
 Remove the given ChangedAdapterSetCallback from this manager. More...
 
bool removeDeviceFromWhitelist (const uint16_t dev_id, const BDAddressAndType &addressAndType) noexcept
 Remove the given device from the adapter's autoconnect whitelist. More...
 
size_type removeMgmtEventCallback (const int dev_id) noexcept
 Returns count of removed MgmtEventCallback from the named MgmtEvent::Opcode list matching the given adapter dev_id . More...
 
size_type removeMgmtEventCallback (const MgmtEvent::Opcode opc, const MgmtEventCallback &cb) noexcept
 Returns count of removed given MgmtEventCallback from the named MgmtEvent::Opcode list. More...
 
void sendMgmtEvent (const MgmtEvent &event) noexcept
 Manually send a MgmtEvent to all of its listeners. More...
 
HCIStatusCode setDefaultConnParam (const uint16_t dev_id, const uint16_t conn_interval_min=8, const uint16_t conn_interval_max=40, const uint16_t conn_latency=0, const uint16_t supervision_timeout=getHCIConnSupervisorTimeout(0, 50)) noexcept
 Set default connection parameter for given adapter to the kernel. More...
 
MgmtStatus setDiscoverable (const uint16_t dev_id, const uint8_t state, const uint16_t timeout, AdapterSetting &current_settings) noexcept
 
bool setIOCapability (const uint16_t dev_id, const SMPIOCapability io_cap, SMPIOCapability &pre_io_cap) noexcept
 
std::shared_ptr< NameAndShortNamesetLocalName (const uint16_t dev_id, const std::string &name, const std::string &short_name) noexcept
 
bool setMode (const uint16_t dev_id, const MgmtCommand::Opcode opc, const uint8_t mode, AdapterSetting &current_settings) noexcept
 
HCIStatusCode setPrivacy (const uint16_t dev_id, const uint8_t privacy, const jau::uint128_t &irk, AdapterSetting &current_settings) noexcept
 
std::string toString () const noexcept override
 
HCIStatusCode unpairDevice (const uint16_t dev_id, const BDAddressAndType &addressAndType, const bool disconnect) noexcept
 
HCIStatusCode uploadConnParam (const uint16_t dev_id, const BDAddressAndType &addressAndType, const uint16_t conn_interval_min=12, const uint16_t conn_interval_max=12, const uint16_t conn_latency=0, const uint16_t supervision_timeout=getHCIConnSupervisorTimeout(0, 15)) noexcept
 Uploads given connection parameter for given device to the kernel. More...
 
HCIStatusCode uploadIdentityResolvingKey (const uint16_t dev_id, const jau::darray< MgmtIdentityResolvingKey > &keys) noexcept
 
HCIStatusCode uploadIdentityResolvingKey (const uint16_t dev_id, const jau::darray< SMPIdentityResolvingKey > &irks) noexcept
 
HCIStatusCode uploadLinkKey (const uint16_t dev_id, const BDAddressAndType &addressAndType, const SMPLinkKey &lk) noexcept
 
HCIStatusCode uploadLinkKey (const uint16_t dev_id, const MgmtLinkKeyInfo &key) noexcept
 
HCIStatusCode uploadLongTermKey (const BTRole adapterRole, const uint16_t dev_id, const BDAddressAndType &addressAndType, const jau::darray< SMPLongTermKey > &ltks) noexcept
 
HCIStatusCode uploadLongTermKey (const uint16_t dev_id, const jau::darray< MgmtLongTermKey > &keys) noexcept
 
MgmtStatus userConfirmReply (const uint16_t dev_id, const BDAddressAndType &addressAndType, const bool positive) noexcept
 
MgmtStatus userPasskeyNegativeReply (const uint16_t dev_id, const BDAddressAndType &addressAndType) noexcept
 
MgmtStatus userPasskeyReply (const uint16_t dev_id, const BDAddressAndType &addressAndType, const uint32_t passkey) noexcept
 
MgmtStatus userPINCodeNegativeReply (const uint16_t dev_id, const BDAddressAndType &addressAndType) noexcept
 
MgmtStatus userPINCodeReply (const uint16_t dev_id, const BDAddressAndType &addressAndType, const std::string &pinCode) noexcept
 

Static Public Member Functions

static const std::shared_ptr< BTManager > & get () noexcept
 Retrieves the singleton instance. More...
 
static std::string java_class () noexcept
 

Detailed Description

A thread safe singleton handler of the BTAdapter manager, e.g.

Linux Kernel's BlueZ manager control channel.

Implementation utilizes a lock free ringbuffer receiving data within its separate thread.

Controlling Environment variables, see MgmtEnv.

See also
Direct-BT Overview

Definition at line 204 of file BTManager.hpp.

Member Typedef Documentation

◆ size_type

Definition at line 211 of file BTManager.hpp.

Member Enumeration Documentation

◆ Defaults

Enumerator
ClientMaxMTU 

Definition at line 206 of file BTManager.hpp.

Constructor & Destructor Documentation

◆ BTManager()

direct_bt::BTManager::BTManager ( const BTManager )
delete

◆ ~BTManager()

BTManager::~BTManager ( )
overridenoexcept

Definition at line 524 of file BTManager.cpp.

Member Function Documentation

◆ operator=()

void direct_bt::BTManager::operator= ( const BTManager )
delete

◆ get()

static const std::shared_ptr< BTManager > & direct_bt::BTManager::get ( )
inlinestaticnoexcept

Retrieves the singleton instance.

First call will open and initialize the bluetooth kernel.

Returns
singleton instance.

Definition at line 339 of file BTManager.hpp.

◆ close()

void BTManager::close ( )
noexcept

Definition at line 529 of file BTManager.cpp.

Here is the caller graph for this function:

◆ get_java_class()

std::string direct_bt::BTManager::get_java_class ( ) const
inlineoverridevirtualnoexcept

Implements jau::jni::JavaUplink.

Definition at line 358 of file BTManager.hpp.

◆ java_class()

static std::string direct_bt::BTManager::java_class ( )
inlinestaticnoexcept

Definition at line 361 of file BTManager.hpp.

Here is the caller graph for this function:

◆ isOpen()

bool direct_bt::BTManager::isOpen ( ) const
inlinenoexcept

Returns true if this mgmt instance is open and hence valid, otherwise false.

Definition at line 366 of file BTManager.hpp.

◆ toString()

std::string direct_bt::BTManager::toString ( ) const
inlineoverridevirtualnoexcept

Reimplemented from jau::jni::JavaUplink.

Definition at line 370 of file BTManager.hpp.

Here is the caller graph for this function:

◆ getAdapterCount()

size_type direct_bt::BTManager::getAdapterCount ( ) const
inlinenoexcept

retrieve information gathered at startup

Returns AdapterInfo count in list

Definition at line 379 of file BTManager.hpp.

◆ getAdapters()

jau::darray< std::shared_ptr< BTAdapter > > direct_bt::BTManager::getAdapters ( )
inline

Returns a list of currently added DBTAdapter.

Definition at line 384 of file BTManager.hpp.

◆ getAdapter()

std::shared_ptr< BTAdapter > BTManager::getAdapter ( const uint16_t  dev_id) const
noexcept

Returns the DBTAdapter with the given dev_id, or nullptr if not found.

Definition at line 581 of file BTManager.cpp.

◆ getDefaultAdapter()

std::shared_ptr< BTAdapter > BTManager::getDefaultAdapter ( ) const
noexcept

Returns the default AdapterInfo.

The default adapter is either the first AdapterSetting::POWERED adapter, or function returns nullptr if none is AdapterSetting::POWERED.

Definition at line 571 of file BTManager.cpp.

◆ setIOCapability()

bool BTManager::setIOCapability ( const uint16_t  dev_id,
const SMPIOCapability  io_cap,
SMPIOCapability pre_io_cap 
)
noexcept

Definition at line 648 of file BTManager.cpp.

◆ getIOCapability()

SMPIOCapability BTManager::getIOCapability ( const uint16_t  dev_id) const
noexcept

Definition at line 671 of file BTManager.cpp.

◆ setMode()

bool BTManager::setMode ( const uint16_t  dev_id,
const MgmtCommand::Opcode  opc,
const uint8_t  mode,
AdapterSetting current_settings 
)
noexcept

Definition at line 701 of file BTManager.cpp.

◆ setDiscoverable()

MgmtStatus BTManager::setDiscoverable ( const uint16_t  dev_id,
const uint8_t  state,
const uint16_t  timeout,
AdapterSetting current_settings 
)
noexcept

Definition at line 711 of file BTManager.cpp.

◆ initializeAdapter()

HCIStatusCode BTManager::initializeAdapter ( AdapterInfo adapterInfo,
const uint16_t  dev_id,
const BTMode  btMode,
const bool  powerOn 
)
noexcept

Initialize the adapter with default values, including power-on.

Method shall be issued on the desired adapter found via ChangedAdapterSetFunc.

While initialization, the adapter is first powered-off, setup and then powered-on.

Parameters
adapterInforeference for the AdapterInfo, updated to reflect the new initialized values.
dev_idthe adapter's device id
btModethe desired adapter's BTMode
powerOntrue to leave adapter powered-on, otherwise leave it off
Returns
HCIStatusCode::SUCCESS or an error state on failure (e.g. power-on)
Since
3.2.0

Definition at line 225 of file BTManager.cpp.

◆ setPrivacy()

HCIStatusCode BTManager::setPrivacy ( const uint16_t  dev_id,
const uint8_t  privacy,
const jau::uint128_t irk,
AdapterSetting current_settings 
)
noexcept

Definition at line 733 of file BTManager.cpp.

◆ readDefaultSysParam()

std::vector< MgmtDefaultParam > BTManager::readDefaultSysParam ( const uint16_t  dev_id)
noexcept

Read default connection parameter for given adapter to the kernel.

Parameters
dev_id
Returns
list of MgmtDefaultParam if successful, empty if command failed.
Since
2.6.3

Definition at line 719 of file BTManager.cpp.

◆ setDefaultConnParam()

HCIStatusCode BTManager::setDefaultConnParam ( const uint16_t  dev_id,
const uint16_t  conn_interval_min = 8,
const uint16_t  conn_interval_max = 40,
const uint16_t  conn_latency = 0,
const uint16_t  supervision_timeout = getHCIConnSupervisorTimeout(0, 50) 
)
noexcept

Set default connection parameter for given adapter to the kernel.

Parameters
dev_id
conn_interval_minin units of 1.25ms, default value 8 for 10ms; Value range [6 .. 3200] for [7.5ms .. 4000ms].
conn_interval_maxin units of 1.25ms, default value 40 for 50ms; Value range [6 .. 3200] for [7.5ms .. 4000ms]
conn_latencyslave latency in units of connection events, default value 0; Value range [0 .. 0x01F3].
supervision_timeoutin units of 10ms, default value 500ms >= 10 x conn_interval_max, we use HCIConstInt::LE_CONN_MIN_TIMEOUT_MS minimum; Value range [0xA-0x0C80] for [100ms - 32s].
Returns
Since
2.5.3

Definition at line 741 of file BTManager.cpp.

◆ uploadConnParam()

HCIStatusCode BTManager::uploadConnParam ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const uint16_t  conn_interval_min = 12,
const uint16_t  conn_interval_max = 12,
const uint16_t  conn_latency = 0,
const uint16_t  supervision_timeout = getHCIConnSupervisorTimeout(0, 15) 
)
noexcept

Uploads given connection parameter for given device to the kernel.

Parameters
dev_id
address
address_type
conn_interval_minin units of 1.25ms, default value 12 for 15ms; Value range [6 .. 3200] for [7.5ms .. 4000ms]
conn_interval_maxin units of 1.25ms, default value 12 for 15ms; Value range [6 .. 3200] for [7.5ms .. 4000ms]
conn_latencyslave latency in units of connection events, default value 0; Value range [0 .. 0x01F3].
supervision_timeoutin units of 10ms, default value >= 10 x conn_interval_max, we use HCIConstInt::LE_CONN_MIN_TIMEOUT_MS minimum; Value range [0xA-0x0C80] for [100ms - 32s].
Returns

Definition at line 762 of file BTManager.cpp.

◆ isDeviceWhitelisted()

bool BTManager::isDeviceWhitelisted ( const uint16_t  dev_id,
const BDAddressAndType addressAndType 
)
noexcept

Returns true, if the adapter's device is already whitelisted.

Definition at line 1035 of file BTManager.cpp.

◆ addDeviceToWhitelist()

bool BTManager::addDeviceToWhitelist ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const HCIWhitelistConnectType  ctype 
)
noexcept

Add the given device to the adapter's autoconnect whitelist.

Make sure uploadConnParam(..) is invoked first, otherwise performance will lack.

Method will reject duplicate devices, in which case it should be removed first.

Definition at line 1046 of file BTManager.cpp.

◆ removeDeviceFromWhitelist()

bool BTManager::removeDeviceFromWhitelist ( const uint16_t  dev_id,
const BDAddressAndType addressAndType 
)
noexcept

Remove the given device from the adapter's autoconnect whitelist.

Definition at line 1092 of file BTManager.cpp.

Here is the caller graph for this function:

◆ removeAllDevicesFromWhitelist()

BTManager::size_type BTManager::removeAllDevicesFromWhitelist ( )
noexcept

Remove all previously added devices from the autoconnect whitelist.

Returns number of removed devices.

Definition at line 1065 of file BTManager.cpp.

Here is the caller graph for this function:

◆ getConnectionInfo()

std::shared_ptr< ConnectionInfo > BTManager::getConnectionInfo ( const uint16_t  dev_id,
const BDAddressAndType addressAndType 
)
noexcept

Definition at line 1118 of file BTManager.cpp.

◆ setLocalName()

std::shared_ptr< NameAndShortName > BTManager::setLocalName ( const uint16_t  dev_id,
const std::string &  name,
const std::string &  short_name 
)
noexcept

Definition at line 1131 of file BTManager.cpp.

◆ isValidLongTermKeyAddressAndType()

bool BTManager::isValidLongTermKeyAddressAndType ( const EUI48 address,
const BDAddressType address_type 
) const
noexcept

Security commands.

Linux Kernel load_long_term_keys(..) (mgmt.c) require either BDAddressType::BDADDR_LE_PUBLIC or BDAddressType::BDADDR_LE_RANDOM and BLERandomAddressType::STATIC_PUBLIC in ltk_is_valid(..) (mgmt.c).

The Linux kernel will reject unresolvable random addresses and resolvable random addresses.

Returns
true if complying to above address-and-type requirements or if not using LINUX, otherwise false.

Definition at line 780 of file BTManager.cpp.

◆ uploadLongTermKey() [1/2]

HCIStatusCode BTManager::uploadLongTermKey ( const uint16_t  dev_id,
const jau::darray< MgmtLongTermKey > &  keys 
)
noexcept

Definition at line 798 of file BTManager.cpp.

◆ uploadLongTermKey() [2/2]

HCIStatusCode BTManager::uploadLongTermKey ( const BTRole  adapterRole,
const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const jau::darray< SMPLongTermKey > &  ltks 
)
noexcept

Definition at line 828 of file BTManager.cpp.

◆ uploadIdentityResolvingKey() [1/2]

HCIStatusCode BTManager::uploadIdentityResolvingKey ( const uint16_t  dev_id,
const jau::darray< MgmtIdentityResolvingKey > &  keys 
)
noexcept

Definition at line 846 of file BTManager.cpp.

◆ uploadIdentityResolvingKey() [2/2]

HCIStatusCode BTManager::uploadIdentityResolvingKey ( const uint16_t  dev_id,
const jau::darray< SMPIdentityResolvingKey > &  irks 
)
noexcept

Definition at line 875 of file BTManager.cpp.

◆ clearIdentityResolvingKeys()

HCIStatusCode BTManager::clearIdentityResolvingKeys ( const uint16_t  dev_id)
noexcept

Definition at line 888 of file BTManager.cpp.

◆ uploadLinkKey() [1/2]

HCIStatusCode BTManager::uploadLinkKey ( const uint16_t  dev_id,
const MgmtLinkKeyInfo key 
)
noexcept

Definition at line 899 of file BTManager.cpp.

◆ uploadLinkKey() [2/2]

HCIStatusCode BTManager::uploadLinkKey ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const SMPLinkKey lk 
)
noexcept

Definition at line 928 of file BTManager.cpp.

◆ userPINCodeReply()

MgmtStatus BTManager::userPINCodeReply ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const std::string &  pinCode 
)
noexcept

Definition at line 938 of file BTManager.cpp.

◆ userPINCodeNegativeReply()

MgmtStatus BTManager::userPINCodeNegativeReply ( const uint16_t  dev_id,
const BDAddressAndType addressAndType 
)
noexcept

Definition at line 953 of file BTManager.cpp.

◆ userPasskeyReply()

MgmtStatus BTManager::userPasskeyReply ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const uint32_t  passkey 
)
noexcept

Definition at line 968 of file BTManager.cpp.

◆ userPasskeyNegativeReply()

MgmtStatus BTManager::userPasskeyNegativeReply ( const uint16_t  dev_id,
const BDAddressAndType addressAndType 
)
noexcept

Definition at line 983 of file BTManager.cpp.

◆ userConfirmReply()

MgmtStatus BTManager::userConfirmReply ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const bool  positive 
)
noexcept

Definition at line 998 of file BTManager.cpp.

◆ unpairDevice()

HCIStatusCode BTManager::unpairDevice ( const uint16_t  dev_id,
const BDAddressAndType addressAndType,
const bool  disconnect 
)
noexcept

Definition at line 1019 of file BTManager.cpp.

◆ addMgmtEventCallback()

bool BTManager::addMgmtEventCallback ( const int  dev_id,
const MgmtEvent::Opcode  opc,
const MgmtEventCallback cb 
)
noexcept

MgmtEventCallback handling

Appends the given MgmtEventCallback for the given adapter dev_id to the named MgmtEvent::Opcode list, if it is not present already (dev_id + opcode + callback).

The adapter dev_id allows filtering the events only directed to the given adapter. Use dev_id -1 to receive the event for all adapter.

Parameters
dev_idthe associated adapter dev_id
opcopcode index for callback list, the callback shall be added to
cbthe to be added callback
Returns
true if newly added or already existing, false if given MgmtEvent::Opcode is out of supported range.

Definition at line 1163 of file BTManager.cpp.

Here is the caller graph for this function:

◆ removeMgmtEventCallback() [1/2]

BTManager::size_type BTManager::removeMgmtEventCallback ( const MgmtEvent::Opcode  opc,
const MgmtEventCallback cb 
)
noexcept

Returns count of removed given MgmtEventCallback from the named MgmtEvent::Opcode list.

Definition at line 1172 of file BTManager.cpp.

◆ removeMgmtEventCallback() [2/2]

BTManager::size_type BTManager::removeMgmtEventCallback ( const int  dev_id)
noexcept

Returns count of removed MgmtEventCallback from the named MgmtEvent::Opcode list matching the given adapter dev_id .

Definition at line 1181 of file BTManager.cpp.

◆ clearMgmtEventCallbacks()

void BTManager::clearMgmtEventCallbacks ( const MgmtEvent::Opcode  opc)
noexcept

Removes all MgmtEventCallbacks from the to the named MgmtEvent::Opcode list.

Definition at line 1193 of file BTManager.cpp.

◆ clearAllCallbacks()

void BTManager::clearAllCallbacks ( )
noexcept

Removes all MgmtEventCallbacks from all MgmtEvent::Opcode lists.

Definition at line 1200 of file BTManager.cpp.

Here is the caller graph for this function:

◆ sendMgmtEvent()

void BTManager::sendMgmtEvent ( const MgmtEvent event)
noexcept

Manually send a MgmtEvent to all of its listeners.

Definition at line 139 of file BTManager.cpp.

◆ addChangedAdapterSetCallback() [1/2]

void BTManager::addChangedAdapterSetCallback ( const ChangedAdapterSetCallback l)

ChangedAdapterSetCallback handling.

Adds the given ChangedAdapterSetCallback to this manager.

When a new callback is added, all available adapter's will be reported as added, this allows a fully event driven workflow.

The callback is performed on a dedicated thread, allowing the user to perform complex operations.

Definition at line 1273 of file BTManager.cpp.

Here is the caller graph for this function:

◆ removeChangedAdapterSetCallback() [1/2]

BTManager::size_type BTManager::removeChangedAdapterSetCallback ( const ChangedAdapterSetCallback l)

Remove the given ChangedAdapterSetCallback from this manager.

Parameters
lthe to be removed element
Returns
the number of removed elements

Definition at line 1281 of file BTManager.cpp.

◆ addChangedAdapterSetCallback() [2/2]

void BTManager::addChangedAdapterSetCallback ( ChangedAdapterSetFunc  f)

Adds the given ChangedAdapterSetFunc to this manager.

When a new callback is added, all available adapter's will be reported as added, this allows a fully event driven workflow.

The callback is performed on a dedicated thread, allowing the user to perform complex operations.

Definition at line 1285 of file BTManager.cpp.

◆ removeChangedAdapterSetCallback() [2/2]

BTManager::size_type BTManager::removeChangedAdapterSetCallback ( ChangedAdapterSetFunc  f)

Remove the given ChangedAdapterSetFunc from this manager.

Parameters
lthe to be removed element
Returns
the number of removed elements

Definition at line 1289 of file BTManager.cpp.

◆ removeAllChangedAdapterSetCallbacks()

BTManager::size_type BTManager::removeAllChangedAdapterSetCallbacks ( )
noexcept

Remove all added ChangedAdapterSetCallback entries from this manager.

Returns
the number of removed elements
Since
2.7.0

Definition at line 1294 of file BTManager.cpp.


The documentation for this class was generated from the following files: