Direct-BT v3.3.0-1-gc2d430c
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 | addToProcessedDevices (const BDAddressAndType &a, const std::string &n) noexcept |
void | addToWaitForDevices (const std::string &addrOrNameSub) noexcept |
bool | areAllDevicesProcessed () noexcept |
Returns true if all addToWaitForDevices() awaited devices have been addToProcessedDevices() processed. More... | |
bool | areAllDevicesProcessed (DeviceQueryMatchFunc m) noexcept |
Returns true if all addToWaitForDevices() awaited devices have been addToProcessedDevices() processed. More... | |
void | clearProcessedDevices () noexcept |
Clears internal list. More... | |
void | clearWaitForDevices () noexcept |
Clears internal list. More... | |
size_t | getProcessedDeviceCount () noexcept |
jau::darray< DeviceID > | getProcessedDevices () noexcept |
Returns a copy of the current collection of processed DeviceID. More... | |
std::string | getProcessedDevicesString () noexcept |
jau::darray< DeviceQuery > & | getWaitForDevices () noexcept |
Returns the reference of the current list of DeviceQuery, not a copy. More... | |
size_t | getWaitForDevicesCount () noexcept |
std::string | getWaitForDevicesString () noexcept |
bool | isDeviceProcessed (const BDAddressAndType &a) noexcept |
bool | isWaitingForAnyDevice () noexcept |
bool | isWaitingForDevice (const EUI48 &address, const std::string &name) noexcept |
Returns true if the given address and/or name matches any of the BTDeviceRegistry::addToWaitForDevices() awaited devices. More... | |
bool | isWaitingForDevice (const EUI48 &address, const std::string &name, DeviceQueryMatchFunc m) noexcept |
Returns true if the given address and/or name matches any of the BTDeviceRegistry::addToWaitForDevices() awaited devices. More... | |
bool | operator!= (const DeviceID &lhs, const DeviceID &rhs) noexcept |
bool | operator== (const DeviceID &lhs, const DeviceID &rhs) noexcept |
Variables | |
static std::unordered_set< DeviceID > | devicesProcessed |
static std::recursive_mutex | mtx_devicesProcessed |
static jau::darray< DeviceQuery > | waitForDevices |
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 true
if the given address
and/or name
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 165 of file BTDeviceRegistry.hpp.
|
noexcept |
Definition at line 43 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 53 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 56 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 59 of file BTDeviceRegistry.cpp.
|
noexcept |
Returns the reference of the current list of DeviceQuery, not a copy.
Definition at line 70 of file BTDeviceRegistry.cpp.
|
noexcept |
Clears internal list.
Definition at line 73 of file BTDeviceRegistry.cpp.
|
inlinenoexcept |
Implementation simply tests the BDAddressAndType
fields for equality, name
is ignored.
Definition at line 125 of file BTDeviceRegistry.hpp.
|
inlinenoexcept |
Definition at line 131 of file BTDeviceRegistry.hpp.
|
noexcept |
Definition at line 77 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 81 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 85 of file BTDeviceRegistry.cpp.
|
noexcept |
Definition at line 89 of file BTDeviceRegistry.cpp.
|
noexcept |
Returns a copy of the current collection of processed DeviceID.
Definition at line 103 of file BTDeviceRegistry.cpp.
|
noexcept |
Clears internal list.
Definition at line 115 of file BTDeviceRegistry.cpp.
|
noexcept |
Returns true
if the given address
and/or name
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 |
Returns true
if the given address
and/or name
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 contains
pattern match, i.e. the given address
or name
contains the corresponding BTDeviceRegistry::DeviceQuery element.
Definition at line 190 of file BTDeviceRegistry.hpp.
|
noexcept |
Returns true
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.
|
inlinenoexcept |
Returns true
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 contains
pattern match, i.e. the processed BTDeviceRegistry::DeviceID contains one element of BTDeviceRegistry::DeviceQuery.
Definition at line 219 of file BTDeviceRegistry.hpp.
|
static |
Definition at line 38 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 40 of file BTDeviceRegistry.cpp.
|
static |
Definition at line 41 of file BTDeviceRegistry.cpp.