diff options
author | Sven Gothel <[email protected]> | 2020-05-27 05:42:03 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-05-27 05:42:03 +0200 |
commit | f39fe119896d43435d408cd1d3582d3ed3d77745 (patch) | |
tree | 156f621b00d7412248dfe4c9127dd2d94b1c009d /src/direct_bt | |
parent | f78fad20a0e8ea7b864af645ec2caa7f936fce08 (diff) |
DBTDevice.cpp: Use openHCI() instead of getHCI(), i.e. implicit open if required - soothing API usage and JNI binding as well
Diffstat (limited to 'src/direct_bt')
-rw-r--r-- | src/direct_bt/DBTDevice.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/direct_bt/DBTDevice.cpp b/src/direct_bt/DBTDevice.cpp index 94031294..b20d32c5 100644 --- a/src/direct_bt/DBTDevice.cpp +++ b/src/direct_bt/DBTDevice.cpp @@ -252,9 +252,9 @@ uint16_t DBTDevice::connectLE(HCIAddressType peer_mac_type, HCIAddressType own_m throw InternalError("DBTDevice::connectLE: Device unknown to adapter and not tracked: "+toString(), E_FILE_LINE); } const std::lock_guard<std::recursive_mutex> lock(adapter.mtx_hci); // RAII-style acquire and relinquish via destructor - std::shared_ptr<HCIComm> hciComm = adapter.getHCI(); + std::shared_ptr<HCIComm> hciComm = adapter.openHCI(); if( nullptr == hciComm || !hciComm->isOpen() ) { - ERR_PRINT("DBTDevice::le_connect: Adapter's HCIComm not opened: %s", toString().c_str()); + ERR_PRINT("DBTDevice::connectLE: Opening adapter's HCIComm failed: %s", toString().c_str()); return 0; } if( !isLEAddressType() ) { @@ -292,9 +292,9 @@ uint16_t DBTDevice::connectBREDR(const uint16_t pkt_type, const uint16_t clock_o throw InternalError("DBTDevice::connectBREDR: Device unknown to adapter and not tracked: "+toString(), E_FILE_LINE); } const std::lock_guard<std::recursive_mutex> lock(adapter.mtx_hci); // RAII-style acquire and relinquish via destructor - std::shared_ptr<HCIComm> hciComm = adapter.getHCI(); + std::shared_ptr<HCIComm> hciComm = adapter.openHCI(); if( nullptr == hciComm || !hciComm->isOpen() ) { - ERR_PRINT("DBTDevice::le_connect: Adapter's HCIComm not opened: %s", toString().c_str()); + ERR_PRINT("DBTDevice::connectBREDR: Opening adapter's HCIComm failed: %s", toString().c_str()); return 0; } if( !isBREDRAddressType() ) { |