diff options
author | Sven Gothel <[email protected]> | 2022-05-09 01:50:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-05-09 01:50:30 +0200 |
commit | 57c8e5916dd8b83fc4fb720aee417a138a0d9e19 (patch) | |
tree | 0c2f828f65ac74ee6ce4c2f5ef0a2ef89ae249ba /src/direct_bt/BTDevice.cpp | |
parent | 9c5f25ccd1637728d6e79592279e4b38ecd32f59 (diff) |
Use typedef of shared_pre<T> 'TRef' and pass `const shared_pre<T>&` where possible
Diffstat (limited to 'src/direct_bt/BTDevice.cpp')
-rw-r--r-- | src/direct_bt/BTDevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/direct_bt/BTDevice.cpp b/src/direct_bt/BTDevice.cpp index efbabb4f..351184f8 100644 --- a/src/direct_bt/BTDevice.cpp +++ b/src/direct_bt/BTDevice.cpp @@ -116,17 +116,17 @@ std::string const BTDevice::getName() const noexcept { return res; } -std::shared_ptr<EInfoReport> BTDevice::getEIR() noexcept { +EInfoReportRef BTDevice::getEIR() noexcept { const std::lock_guard<std::mutex> lock(mtx_eir); // RAII-style acquire and relinquish via destructor return eir; } -std::shared_ptr<EInfoReport> BTDevice::getEIRInd() noexcept { +EInfoReportRef BTDevice::getEIRInd() noexcept { const std::lock_guard<std::mutex> lock(mtx_eir); // RAII-style acquire and relinquish via destructor return eir_ind; } -std::shared_ptr<EInfoReport> BTDevice::getEIRScanRsp() noexcept { +EInfoReportRef BTDevice::getEIRScanRsp() noexcept { const std::lock_guard<std::mutex> lock(mtx_eir); // RAII-style acquire and relinquish via destructor return eir_scan_rsp; } @@ -256,11 +256,11 @@ EIRDataType BTDevice::update(GattGenericAccessSvc const &data, const uint64_t ti return res; } -bool BTDevice::addStatusListener(std::shared_ptr<AdapterStatusListener> l) { +bool BTDevice::addStatusListener(const AdapterStatusListenerRef& l) { return adapter.addStatusListener(*this, l); } -bool BTDevice::removeStatusListener(std::shared_ptr<AdapterStatusListener> l) { +bool BTDevice::removeStatusListener(const AdapterStatusListenerRef& l) { return adapter.removeStatusListener(l); } |