summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-11-08 06:11:00 +0100
committerSven Gothel <[email protected]>2020-11-08 06:11:00 +0100
commit28fd3a2ea5bdfcd9392f45b5760c0150dc8a7671 (patch)
tree1ee839e8dc692be6b93c0fc9260113358d2b56bd /api
parent6f3e08562f4f990b579ff2540d25dac06beea15a (diff)
SMPHandler: Add define SMP_SUPPORTED_BY_OS and have DBTDevice exclude compilation/usage if false, removing costs.
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/DBTDevice.hpp4
-rw-r--r--api/direct_bt/SMPHandler.hpp9
2 files changed, 12 insertions, 1 deletions
diff --git a/api/direct_bt/DBTDevice.hpp b/api/direct_bt/DBTDevice.hpp
index 83930a4d..49a68e2d 100644
--- a/api/direct_bt/DBTDevice.hpp
+++ b/api/direct_bt/DBTDevice.hpp
@@ -66,9 +66,11 @@ namespace direct_bt {
std::atomic<uint16_t> hciConnHandle;
std::shared_ptr<ManufactureSpecificData> advMSD = nullptr;
std::vector<std::shared_ptr<uuid_t>> advServices;
+#if SMP_SUPPORTED_BY_OS
std::shared_ptr<SMPHandler> smpHandler = nullptr;
- std::shared_ptr<GATTHandler> gattHandler = nullptr;
std::recursive_mutex mtx_smpHandler;
+#endif
+ std::shared_ptr<GATTHandler> gattHandler = nullptr;
std::recursive_mutex mtx_gattHandler;
std::recursive_mutex mtx_connect;
std::recursive_mutex mtx_data;
diff --git a/api/direct_bt/SMPHandler.hpp b/api/direct_bt/SMPHandler.hpp
index e1acfc28..814b2cd6 100644
--- a/api/direct_bt/SMPHandler.hpp
+++ b/api/direct_bt/SMPHandler.hpp
@@ -46,6 +46,15 @@
#include "SMPTypes.hpp"
/**
+ * Linux/BlueZ prohibits access to the existing SMP implementation via L2CAP (socket).
+ */
+#ifdef __linux__
+ #define SMP_SUPPORTED_BY_OS 0
+#else
+ #define SMP_SUPPORTED_BY_OS 1
+#endif
+
+/**
* - - - - - - - - - - - - - - -
*
* SMPHandler.hpp Module for SMPHandler using SMPPDUMsg types