summaryrefslogtreecommitdiffstats
path: root/src/direct_bt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-05-16 14:55:04 +0200
committerSven Gothel <[email protected]>2022-05-16 14:56:04 +0200
commit7af9bafddf73ef4f127693178dab976c3492b70f (patch)
treeeb29de3670351c3469ed6e8524d8f567bbef6c6a /src/direct_bt
parentcc53af990263bfa09947ad3127e0de6a6ffcb493 (diff)
Remove BTDeviceRegistry's 'device processing' list
See commits - cc53af990263bfa09947ad3127e0de6a6ffcb493 - ca228cd0512be4642a41468ff92e688dbf296fcd
Diffstat (limited to 'src/direct_bt')
-rw-r--r--src/direct_bt/BTDeviceRegistry.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/direct_bt/BTDeviceRegistry.cpp b/src/direct_bt/BTDeviceRegistry.cpp
index f9d7f43e..de1a62ea 100644
--- a/src/direct_bt/BTDeviceRegistry.cpp
+++ b/src/direct_bt/BTDeviceRegistry.cpp
@@ -37,9 +37,6 @@ using namespace direct_bt;
namespace direct_bt::BTDeviceRegistry {
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;
@@ -141,43 +138,4 @@ namespace direct_bt::BTDeviceRegistry {
}
return true;
}
-
- void addToProcessingDevices(const BDAddressAndType &a, const std::string& n) noexcept {
- const std::lock_guard<std::recursive_mutex> lock(mtx_devicesProcessing); // RAII-style acquire and relinquish via destructor
- devicesInProcessing.emplace_hint(devicesInProcessing.end(), a, n);
- }
- bool removeFromProcessingDevices(const BDAddressAndType &a) noexcept {
- const std::lock_guard<std::recursive_mutex> lock(mtx_devicesProcessing); // RAII-style acquire and relinquish via destructor
- auto it = devicesInProcessing.find( DeviceID(a, "") );
- if( devicesInProcessing.end() != it ) {
- devicesInProcessing.erase(it);
- return true;
- }
- return false;
- }
- bool isDeviceProcessing(const BDAddressAndType & a) noexcept {
- const std::lock_guard<std::recursive_mutex> lock(mtx_devicesProcessing); // RAII-style acquire and relinquish via destructor
- return devicesInProcessing.end() != devicesInProcessing.find( DeviceID(a, "") );
- }
- size_t getProcessingDeviceCount() noexcept {
- const std::lock_guard<std::recursive_mutex> lock(mtx_devicesProcessing); // RAII-style acquire and relinquish via destructor
- return devicesInProcessing.size();
- }
- jau::darray<DeviceID> getProcessingDevices() noexcept {
- const std::lock_guard<std::recursive_mutex> lock(mtx_devicesProcessing); // RAII-style acquire and relinquish via destructor
- // std::unordered_set<DeviceID>::iterator is not suitable for:
- // return jau::darray<DeviceID>(devicesInProcessing.size(), devicesInProcessing.begin(), devicesInProcessing.end());
- jau::darray<DeviceID> res(devicesInProcessing.size());
- auto first = devicesInProcessing.cbegin();
- auto last = devicesInProcessing.cend();
- for(; first != last; ++first) {
- res.push_back(*first);
- }
- return res;
- }
- void clearProcessingDevices() noexcept {
- const std::lock_guard<std::recursive_mutex> lock(mtx_devicesProcessing); // RAII-style acquire and relinquish via destructor
- devicesInProcessing.clear();
- }
-
} // namespace direct_bt::BTDeviceRegistry