diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/DBTAdapter.hpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp index 48585a81..17bb9e43 100644 --- a/api/direct_bt/DBTAdapter.hpp +++ b/api/direct_bt/DBTAdapter.hpp @@ -155,7 +155,8 @@ namespace direct_bt { DBTManager& mgmt; std::shared_ptr<AdapterInfo> adapterInfo; NameAndShortName localName; - ScanType currentScanType = ScanType::SCAN_TYPE_NONE; + std::atomic<ScanType> currentScanType; // = ScanType::SCAN_TYPE_NONE + std::atomic<bool> keepDiscoveringAlive; // = false; std::shared_ptr<HCIHandler> hci; std::vector<std::shared_ptr<DBTDevice>> connectedDevices; @@ -167,7 +168,6 @@ namespace direct_bt { std::recursive_mutex mtx_discoveredDevices; std::recursive_mutex mtx_sharedDevices; std::recursive_mutex mtx_statusListenerList; - std::atomic<bool> keepDiscoveringAlive; // = false; bool validateDevInfo(); @@ -417,6 +417,20 @@ namespace direct_bt { void stopDiscovery(); /** + * Returns the discovering state the adapter. It can be modified through startDiscovery(..) and stopDiscovery(). + */ + ScanType getDiscoveringScanType() const { + return currentScanType; + } + + /** + * Returns the discovering state the adapter. It can be modified through startDiscovery(..) and stopDiscovery(). + */ + bool getDiscovering() const { + return ScanType::SCAN_TYPE_NONE != currentScanType; + } + + /** * Returns discovered devices from the last discovery. * <p> * Note that this list will be cleared when a new discovery is started over via startDiscovery(). |