diff options
author | Sven Gothel <[email protected]> | 2022-01-12 05:59:44 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-01-12 05:59:44 +0100 |
commit | 3c73bd3a8c8bc3489d25a9eabd18ac2a08dc4501 (patch) | |
tree | 17ada096be487a78eb89cc8183857dc7c6b5de34 /api | |
parent | bfc463decc485cd597c0c3b51c01a1b7ac7a786d (diff) |
BTAdapter: Use L2CapServer jau::service_runner if running as GATT server (Slave) ...
Only when listening and catching the L2CAPComm channel via accept,
we can guarantee no loss of skipped GATT request.
Before using L2CAPServer, the manual connect might occur too late
and hence skipped initial fast GATT requests.
The L2CAPServer service is started and stopped on start/stop advertising.
The opened L2CAPComm is waited upon within BTAdapter::mgmtEvDeviceConnectedHCI(..).
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/BTAdapter.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/api/direct_bt/BTAdapter.hpp b/api/direct_bt/BTAdapter.hpp index 4177709e..deaaba21 100644 --- a/api/direct_bt/BTAdapter.hpp +++ b/api/direct_bt/BTAdapter.hpp @@ -486,6 +486,13 @@ namespace direct_bt { bool addSMPKeyBin(const SMPKeyBinRef& key, const bool write_file) noexcept; bool removeSMPKeyBin(BDAddressAndType const & remoteAddress, const bool remove_file) noexcept; + jau::service_runner l2cap_service; + L2CAPServer l2cap_att_srv; + std::unique_ptr<L2CAPComm> l2cap_att; + std::mutex mtx_l2cap_att; + std::condition_variable cv_l2cap_att; + void l2capServerWork(jau::service_runner& sr); + bool mgmtEvNewSettingsMgmt(const MgmtEvent& e) noexcept; void updateAdapterSettings(const bool off_thread, const AdapterSetting new_settings, const bool sendEvent, const uint64_t timestamp) noexcept; bool mgmtEvDeviceDiscoveringMgmt(const MgmtEvent& e) noexcept; @@ -498,6 +505,7 @@ namespace direct_bt { bool mgmtEvHCIAnyHCI(const MgmtEvent& e) noexcept; bool mgmtEvDeviceDiscoveringHCI(const MgmtEvent& e) noexcept; bool mgmtEvDeviceConnectedHCI(const MgmtEvent& e) noexcept; + bool mgmtEvConnectFailedHCI(const MgmtEvent& e) noexcept; bool mgmtEvHCILERemoteUserFeaturesHCI(const MgmtEvent& e) noexcept; bool mgmtEvHCILEPhyUpdateCompleteHCI(const MgmtEvent& e) noexcept; |