summaryrefslogtreecommitdiffstats
path: root/api/direct_bt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-08-24 22:02:00 +0200
committerSven Gothel <[email protected]>2020-08-24 22:02:00 +0200
commitf80a628ef4279b9bf237981fc7aa2e9dbbae2915 (patch)
tree7e9650fb606a5d2b9286ab088b0f686770dc5b90 /api/direct_bt
parentab8676ae3fd865c89ab04c12861da388dbaebb46 (diff)
Adopt to exploding DEBUG value, implement 'hci.event,manager.event,adapter.event,gatt.data' for 'direct_bt.debug'
Explosion of 'hci.event,manager.event,adapter.event,gatt.data' will lead to - 'direct_bt.debug.hci.event' - 'direct_bt.debug.manager.event' - 'direct_bt.debug.adapter.event' - 'direct_bt.debug.gatt.data' and is being used in their respective modules using COND_PRINT(debug_state, ...).
Diffstat (limited to 'api/direct_bt')
-rw-r--r--api/direct_bt/DBTAdapter.hpp10
-rw-r--r--api/direct_bt/DBTManager.hpp8
-rw-r--r--api/direct_bt/GATTHandler.hpp8
-rw-r--r--api/direct_bt/HCIHandler.hpp7
4 files changed, 33 insertions, 0 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp
index d17362ee..f3c1fbe2 100644
--- a/api/direct_bt/DBTAdapter.hpp
+++ b/api/direct_bt/DBTAdapter.hpp
@@ -148,6 +148,15 @@ namespace direct_bt {
// *************************************************
// *************************************************
+ /**
+ * DBTAdapter represents one Bluetooth Controller.
+ * <p>
+ * Controlling Environment variables:
+ * <pre>
+ * - 'direct_bt.debug.adapter.event': Debug messages about events, see debug_events
+ * </pre>
+ * </p>
+ */
class DBTAdapter : public DBTObject
{
private:
@@ -156,6 +165,7 @@ namespace direct_bt {
static std::shared_ptr<DBTDevice> findDevice(std::vector<std::shared_ptr<DBTDevice>> & devices, EUI48 const & mac, const BDAddressType macType);
std::shared_ptr<DBTDevice> findDevice(std::vector<std::shared_ptr<DBTDevice>> & devices, DBTDevice const & device);
+ const bool debug_event;
DBTManager& mgmt;
std::shared_ptr<AdapterInfo> adapterInfo;
NameAndShortName localName;
diff --git a/api/direct_bt/DBTManager.hpp b/api/direct_bt/DBTManager.hpp
index cd6aa3b7..f5e75d7a 100644
--- a/api/direct_bt/DBTManager.hpp
+++ b/api/direct_bt/DBTManager.hpp
@@ -50,6 +50,12 @@ namespace direct_bt {
* <p>
* Implementation utilizes a lock free ringbuffer receiving data within its separate thread.
* </p>
+ * <p>
+ * Controlling Environment variables:
+ * <pre>
+ * - 'direct_bt.debug.manager.event': Debug messages about events, see debug_event
+ * </pre>
+ * </p>
*/
class DBTManager : public JavaUplink {
public:
@@ -78,6 +84,8 @@ namespace direct_bt {
};
std::vector<std::shared_ptr<WhitelistElem>> whitelist;
+ const bool debug_global; // only to trigger DBTEnv initialization first
+ const bool debug_event;
const BTMode btMode;
POctets rbuffer;
HCIComm comm;
diff --git a/api/direct_bt/GATTHandler.hpp b/api/direct_bt/GATTHandler.hpp
index 3f671fe8..25546f62 100644
--- a/api/direct_bt/GATTHandler.hpp
+++ b/api/direct_bt/GATTHandler.hpp
@@ -61,6 +61,12 @@ namespace direct_bt {
* <p>
* Implementation utilizes a lock free ringbuffer receiving data within its separate thread.
* </p>
+ * <p>
+ * Controlling Environment variables:
+ * <pre>
+ * - 'direct_bt.debug.gatt.data': Debug messages about detailed GATT data, see debug_data
+ * </pre>
+ * </p>
*/
class GATTHandler {
public:
@@ -84,6 +90,8 @@ namespace direct_bt {
static inline int number(const Defaults d) { return static_cast<int>(d); }
private:
+ const bool debug_data;
+
/** GATTHandle's device weak back-reference */
std::weak_ptr<DBTDevice> wbr_device;
diff --git a/api/direct_bt/HCIHandler.hpp b/api/direct_bt/HCIHandler.hpp
index 412c1345..f30f1fbb 100644
--- a/api/direct_bt/HCIHandler.hpp
+++ b/api/direct_bt/HCIHandler.hpp
@@ -95,6 +95,12 @@ namespace direct_bt {
* <p>
* Implementation utilizes a lock free ringbuffer receiving data within its separate thread.
* </p>
+ * <p>
+ * Controlling Environment variables:
+ * <pre>
+ * - 'direct_bt.debug.hci.event': Debug messages about events, see debug_event
+ * </pre>
+ * </p>
*/
class HCIHandler {
public:
@@ -118,6 +124,7 @@ namespace direct_bt {
private:
static MgmtEvent::Opcode translate(HCIEventType evt, HCIMetaEventType met);
+ const bool debug_event;
const BTMode btMode;
const uint16_t dev_id;
POctets rbuffer;