diff options
author | Sven Gothel <[email protected]> | 2020-10-17 01:54:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-17 01:54:48 +0200 |
commit | 2b848e814f624d306980e7cfa9a133541bdf5cb2 (patch) | |
tree | 97c7e4cb98b3e3f3dde55fb971848cc90d0ba8be /src | |
parent | 8461947da0ff33dca53eb78bbe99e72c8177a428 (diff) |
DBTManager's MgmtEnv ctor: Use root_prefix_domain "direct_bt"; DBTAdapter: Add missing 'jau::' namespace usage on bind* and *print*
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/DBTAdapter.cpp | 22 | ||||
-rw-r--r-- | src/direct_bt/DBTManager.cpp | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/direct_bt/DBTAdapter.cpp b/src/direct_bt/DBTAdapter.cpp index c56603b0..3c63580b 100644 --- a/src/direct_bt/DBTAdapter.cpp +++ b/src/direct_bt/DBTAdapter.cpp @@ -172,9 +172,9 @@ bool DBTAdapter::validateDevInfo() noexcept { WORDY_PRINT("DBTAdapter::validateDevInfo: Adapter[%d]: Not POWERED: %s", dev_id, adapterInfo->toString().c_str()); } bool ok = true; - ok = mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::DISCOVERING, bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDiscoveringMgmt)) && ok; - ok = mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::NEW_SETTINGS, bindMemberFunc(this, &DBTAdapter::mgmtEvNewSettingsMgmt)) && ok; - ok = mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::LOCAL_NAME_CHANGED, bindMemberFunc(this, &DBTAdapter::mgmtEvLocalNameChangedMgmt)) && ok; + ok = mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::DISCOVERING, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDiscoveringMgmt)) && ok; + ok = mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::NEW_SETTINGS, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvNewSettingsMgmt)) && ok; + ok = mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::LOCAL_NAME_CHANGED, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvLocalNameChangedMgmt)) && ok; if( !ok ) { ERR_PRINT("Could not add all required MgmtEventCallbacks to DBTManager: %s", toString().c_str()); return false; @@ -184,11 +184,11 @@ bool DBTAdapter::validateDevInfo() noexcept { mgmt.addMgmtEventCallback(dev_id, MgmtEvent::Opcode::DEVICE_DISCONNECTED, bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDisconnectedMgmt)); #endif - ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DISCOVERING, bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDiscoveringHCI)) && ok; - ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DEVICE_CONNECTED, bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceConnectedHCI)) && ok; - ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::CONNECT_FAILED, bindMemberFunc(this, &DBTAdapter::mgmtEvConnectFailedHCI)) && ok; - ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DEVICE_DISCONNECTED, bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDisconnectedHCI)) && ok; - ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DEVICE_FOUND, bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceFoundHCI)) && ok; + ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DISCOVERING, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDiscoveringHCI)) && ok; + ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DEVICE_CONNECTED, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceConnectedHCI)) && ok; + ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::CONNECT_FAILED, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvConnectFailedHCI)) && ok; + ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DEVICE_DISCONNECTED, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceDisconnectedHCI)) && ok; + ok = hci.addMgmtEventCallback(MgmtEvent::Opcode::DEVICE_FOUND, jau::bindMemberFunc(this, &DBTAdapter::mgmtEvDeviceFoundHCI)) && ok; if( !ok ) { ERR_PRINT("Could not add all required MgmtEventCallbacks to HCIHandler: %s of %s", hci.toString().c_str(), toString().c_str()); return false; // dtor local HCIHandler w/ closing @@ -275,15 +275,15 @@ void DBTAdapter::poweredOff() noexcept { void DBTAdapter::printSharedPtrListOfDevices() noexcept { { const std::lock_guard<std::recursive_mutex> lock0(mtx_sharedDevices); - printSharedPtrList("SharedDevices", sharedDevices); + jau::printSharedPtrList("SharedDevices", sharedDevices); } { const std::lock_guard<std::mutex> lock0(mtx_discoveredDevices); - printSharedPtrList("DiscoveredDevices", discoveredDevices); + jau::printSharedPtrList("DiscoveredDevices", discoveredDevices); } { const std::lock_guard<std::mutex> lock0(mtx_connectedDevices); - printSharedPtrList("ConnectedDevices", connectedDevices); + jau::printSharedPtrList("ConnectedDevices", connectedDevices); } } diff --git a/src/direct_bt/DBTManager.cpp b/src/direct_bt/DBTManager.cpp index e0ab67d6..454e6f6f 100644 --- a/src/direct_bt/DBTManager.cpp +++ b/src/direct_bt/DBTManager.cpp @@ -65,7 +65,7 @@ BTMode MgmtEnv::getEnvBTMode() { } MgmtEnv::MgmtEnv() noexcept -: DEBUG_GLOBAL( jau::environment::get().DEBUG ), +: DEBUG_GLOBAL( jau::environment::get("direct_bt").debug ), exploding( jau::environment::getExplodingProperties("direct_bt.mgmt") ), MGMT_READER_THREAD_POLL_TIMEOUT( jau::environment::getInt32Property("direct_bt.mgmt.reader.timeout", 10000, 1500 /* min */, INT32_MAX /* max */) ), MGMT_COMMAND_REPLY_TIMEOUT( jau::environment::getInt32Property("direct_bt.mgmt.cmd.timeout", 3000, 1500 /* min */, INT32_MAX /* max */) ), |