diff options
author | Sven Gothel <[email protected]> | 2022-04-15 17:11:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-04-15 17:11:23 +0200 |
commit | 1c2dfc287d4445c6dc19a31e1dcb6516928ead08 (patch) | |
tree | 1f1c591b34be4070892929dd28a62e14777ab0de /api/direct_bt/SMPHandler.hpp | |
parent | b3484f794a8ad22d3453d68acb4a3eb52323725b (diff) |
SMPHandler: Also use service_runner; Remove HCIHandler::pidSelf
Diffstat (limited to 'api/direct_bt/SMPHandler.hpp')
-rw-r--r-- | api/direct_bt/SMPHandler.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/api/direct_bt/SMPHandler.hpp b/api/direct_bt/SMPHandler.hpp index c29ae250..984c9168 100644 --- a/api/direct_bt/SMPHandler.hpp +++ b/api/direct_bt/SMPHandler.hpp @@ -40,6 +40,7 @@ #include <jau/darray.hpp> #include <jau/cow_darray.hpp> #include <jau/uuid.hpp> +#include <jau/service_runner.hpp> #include "BTTypes0.hpp" #include "L2CAPComm.hpp" @@ -188,13 +189,8 @@ namespace direct_bt { jau::sc_atomic_bool is_connected; // reflects state jau::relaxed_atomic_bool has_ioerror; // reflects state + jau::service_runner smp_reader_service; jau::ringbuffer<std::unique_ptr<const SMPPDUMsg>, jau::nsize_t> smpPDURing; - jau::sc_atomic_bool l2capReaderShallStop; - - std::mutex mtx_l2capReaderLifecycle; - std::condition_variable cv_l2capReaderInit; - pthread_t l2capReaderThreadId; - jau::sc_atomic_bool l2capReaderRunning; SMPSecurityReqCallbackList smpSecurityReqCallbackList; @@ -202,7 +198,8 @@ namespace direct_bt { bool validateConnected() noexcept; - void l2capReaderThreadImpl(); + void smpReaderWork(jau::service_runner& sr) noexcept; + void smpReaderEndLocked(jau::service_runner& sr) noexcept; void send(const SMPPDUMsg & msg); std::unique_ptr<const SMPPDUMsg> sendWithReply(const SMPPDUMsg & msg, const int timeout); |