Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Application toolkit providing BT device registration of processed and awaited devices. More...
Classes | |
struct | DeviceID |
Specifies unique device identities, using BDAddressAndType as key. More... | |
struct | DeviceQuery |
Specifies devices queries to act upon. More... | |
Typedefs | |
typedef bool(* | DeviceQueryMatchFunc) (const EUI48 &address, const std::string &name, const DeviceQuery &q) |
Function for user defined BTDeviceRegistry::DeviceQuery matching criteria and algorithm. More... | |
Functions | |
void | addToWaitForDevices (const std::string &addrOrNameSub) noexcept |
bool | isWaitingForAnyDevice () noexcept |
size_t | getWaitForDevicesCount () noexcept |
std::string | getWaitForDevicesString () noexcept |
jau::darray< DeviceQuery > & | getWaitForDevices () noexcept |
Returns the reference of the current list of DeviceQuery, not a copy. More... | |
void | clearWaitForDevices () noexcept |
Clears internal list. More... | |
bool | operator== (const DeviceID &lhs, const DeviceID &rhs) noexcept |
bool | operator!= (const DeviceID &lhs, const DeviceID &rhs) noexcept |
void | addToProcessedDevices (const BDAddressAndType &a, const std::string &n) noexcept |
bool | isDeviceProcessed (const BDAddressAndType &a) noexcept |
size_t | getProcessedDeviceCount () noexcept |
std::string | getProcessedDevicesString () noexcept |
jau::darray< DeviceID > | getProcessedDevices () noexcept |
Returns a copy of the current collection of processed DeviceID. More... | |
void | clearProcessedDevices () noexcept |
Clears internal list. More... | |
bool | isWaitingForDevice (const EUI48 &address, const std::string &name, DeviceQueryMatchFunc m) noexcept |
Returns. More... | |
bool | isWaitingForDevice (const EUI48 &address, const std::string &name) noexcept |
Returns. More... | |
bool | areAllDevicesProcessed (DeviceQueryMatchFunc m) noexcept |
Returns. More... | |
bool | areAllDevicesProcessed () noexcept |
Returns. More... | |
void | addToProcessingDevices (const BDAddressAndType &a, const std::string &n) noexcept |
bool | removeFromProcessingDevices (const BDAddressAndType &a) noexcept |
bool | isDeviceProcessing (const BDAddressAndType &a) noexcept |
size_t | getProcessingDeviceCount () noexcept |
jau::darray< DeviceID > | getProcessingDevices () noexcept |
Returns a copy of the current collection of processing DeviceID. More... | |
void | clearProcessingDevices () noexcept |
Clears internal list. More... | |
Variables | |
static jau::darray< DeviceQuery > | waitForDevices |
static std::unordered_set< DeviceID > | devicesInProcessing |
static std::recursive_mutex | mtx_devicesProcessing |
static std::unordered_set< DeviceID > | devicesProcessed |
static std::recursive_mutex | mtx_devicesProcessed |
Application toolkit providing BT device registration of processed and awaited devices.
The latter on a pattern matching basis, i.e. EUI48Sub or name-sub.
typedef bool(* direct_bt::BTDeviceRegistry::DeviceQueryMatchFunc) (const EUI48 &address, const std::string &name, const DeviceQuery &q) |
Function for user defined BTDeviceRegistry::DeviceQuery matching criteria and algorithm.
Return
if the given
and/or
matches with the BTDeviceRegistry::DeviceQuery::addressSub and/or BTDeviceRegistry::DeviceQuery::nameSub.
Example (lambda):
[](const EUI48& a, const std::string& n, const DeviceQuery& q)->bool { return q.isEUI48Sub() ? a.contains(q.addressSub) : n.find(q.nameSub) != std::string::npos; });
Definition at line 160 of file BTDeviceRegistry.hpp.
|
noexcept |
Definition at line 80 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 145 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 46 of file BTDeviceRegistry.cpp.
|
inlinenoexcept |
Returns.
if all addToWaitForDevices() awaited devices have been addToProcessedDevices() processed.
Matching criteria is either the awaited device's BTDeviceRegistry::DeviceQuery::addressSub or BTDeviceRegistry::DeviceQuery::nameSub, whichever is set.
Matching algorithm is a simple
pattern match, i.e. the processed BTDeviceRegistry::DeviceID contains one element of BTDeviceRegistry::DeviceQuery.
Definition at line 214 of file BTDeviceRegistry.hpp.
|
noexcept |
Returns.
if all addToWaitForDevices() awaited devices have been addToProcessedDevices() processed.
Matching criteria and algorithm is defined by the given BTDeviceRegistry::DeviceQueryMatchFunc.
Definition at line 126 of file BTDeviceRegistry.cpp.
|
noexcept |
Clears internal list.
Definition at line 115 of file BTDeviceRegistry.cpp.
|
noexcept |
Clears internal list.
Definition at line 178 of file BTDeviceRegistry.cpp.
|
noexcept |
Clears internal list.
Definition at line 76 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 88 of file BTDeviceRegistry.cpp.
|
noexcept |
Returns a copy of the current collection of processed DeviceID.
Definition at line 103 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 92 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 162 of file BTDeviceRegistry.cpp.
|
noexcept |
Returns a copy of the current collection of processing DeviceID.
Definition at line 166 of file BTDeviceRegistry.cpp.
|
noexcept |
Returns the reference of the current list of DeviceQuery, not a copy.
Definition at line 73 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 59 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 62 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 84 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 158 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 56 of file BTDeviceRegistry.cpp.
|
inlinenoexcept |
Returns.
if the given
and/or
matches any of the BTDeviceRegistry::addToWaitForDevices() awaited devices.
Matching criteria is either the awaited device's BTDeviceRegistry::DeviceQuery::addressSub or BTDeviceRegistry::DeviceQuery::nameSub, whichever is set.
Matching algorithm is a simple
pattern match, i.e. the given
or
contains the corresponding BTDeviceRegistry::DeviceQuery element.
Definition at line 185 of file BTDeviceRegistry.hpp.
|
noexcept |
Returns.
if the given
and/or
matches any of the BTDeviceRegistry::addToWaitForDevices() awaited devices.
Matching criteria and algorithm is defined by the given BTDeviceRegistry::DeviceQueryMatchFunc.
Definition at line 120 of file BTDeviceRegistry.cpp.
|
inlinenoexcept |
Definition at line 126 of file BTDeviceRegistry.hpp.
|
inlinenoexcept |
Implementation simply tests the BDAddressAndType fields for equality, name
is ignored.
Definition at line 120 of file BTDeviceRegistry.hpp.
|
noexcept |
Definition at line 149 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 40 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 43 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 44 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 41 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 38 of file BTDeviceRegistry.cpp.