summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-08-28 04:46:07 +0200
committerSven Gothel <[email protected]>2020-08-28 04:46:07 +0200
commit764c96515f3d0339ec486d8659db25016336fdbe (patch)
treeba5bf66bfa4fb739390f1e3338792f574bf6c99f /api
parent021331fc0a37d2deaa9e1e62e75114af223bc522 (diff)
Inherit all *Env classes from DBTEnvironment, having them grouped for documentation. Also document the actual environment variable name for each entry.
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/DBTEnv.hpp17
-rw-r--r--api/direct_bt/DBTManager.hpp35
-rw-r--r--api/direct_bt/GATTHandler.hpp51
-rw-r--r--api/direct_bt/HCIHandler.hpp44
4 files changed, 128 insertions, 19 deletions
diff --git a/api/direct_bt/DBTEnv.hpp b/api/direct_bt/DBTEnv.hpp
index da1985fe..c2542169 100644
--- a/api/direct_bt/DBTEnv.hpp
+++ b/api/direct_bt/DBTEnv.hpp
@@ -40,7 +40,22 @@ extern "C" {
namespace direct_bt {
- class DBTEnv {
+ /**
+ * Base direct_bt environment class,
+ * merely to tag all environment settings by inheritance and hence documentation.
+ * <p>
+ * See main direct_bt environment {@link DBTEnv} and
+ * {@link DBTEnv::getExplodingProperties(const std::string & prefixDomain)}.
+ * </p>
+ */
+ class DBTEnvrionment {
+ };
+
+ /**
+ * Main direct_bt environment class,
+ * supporting environment variable access and fetching elapsed time using its stored startup-time.
+ */
+ class DBTEnv : public DBTEnvrionment {
private:
DBTEnv();
diff --git a/api/direct_bt/DBTManager.hpp b/api/direct_bt/DBTManager.hpp
index 038750bf..d2a3af3b 100644
--- a/api/direct_bt/DBTManager.hpp
+++ b/api/direct_bt/DBTManager.hpp
@@ -35,6 +35,7 @@
#include <atomic>
#include <thread>
+#include "DBTEnv.hpp"
#include "BTTypes.hpp"
#include "BTIoctl.hpp"
#include "OctetTypes.hpp"
@@ -49,8 +50,11 @@ namespace direct_bt {
/**
* Managment Singleton runtime environment properties
+ * <p>
+ * Also see {@link DBTEnv::getExplodingProperties(const std::string & prefixDomain)}.
+ * </p>
*/
- class MgmtEnv {
+ class MgmtEnv : public DBTEnvrionment {
friend class DBTManager;
private:
@@ -64,15 +68,36 @@ namespace direct_bt {
const bool exploding; // just to trigger exploding properties
public:
- /** Poll timeout for mgmt reader thread, defaults to 10s. */
+ /**
+ * Poll timeout for mgmt reader thread, defaults to 10s.
+ * <p>
+ * Environment variable is 'direct_bt.mgmt.reader.timeout'.
+ * </p>
+ */
const int32_t MGMT_READER_THREAD_POLL_TIMEOUT;
- /** Timeout for mgmt command replies, defaults to 3s. */
+
+ /**
+ * Timeout for mgmt command replies, defaults to 3s.
+ * <p>
+ * Environment variable is 'direct_bt.mgmt.cmd.timeout'.
+ * </p>
+ */
const int32_t MGMT_COMMAND_REPLY_TIMEOUT;
- /** Small ringbuffer capacity for synchronized commands, defaults to 64 messages. */
+ /**
+ * Small ringbuffer capacity for synchronized commands, defaults to 64 messages.
+ * <p>
+ * Environment variable is 'direct_bt.mgmt.ringsize'.
+ * </p>
+ */
const int32_t MGMT_EVT_RING_CAPACITY;
- /** Debug all Mgmt event communication */
+ /**
+ * Debug all Mgmt event communication
+ * <p>
+ * Environment variable is 'direct_bt.debug.manager.event'.
+ * </p>
+ */
const bool DEBUG_EVENT;
private:
diff --git a/api/direct_bt/GATTHandler.hpp b/api/direct_bt/GATTHandler.hpp
index 91eb4a25..baa1f545 100644
--- a/api/direct_bt/GATTHandler.hpp
+++ b/api/direct_bt/GATTHandler.hpp
@@ -36,6 +36,7 @@
#include <atomic>
#include <thread>
+#include "DBTEnv.hpp"
#include "UUID.hpp"
#include "BTTypes.hpp"
#include "L2CAPComm.hpp"
@@ -58,27 +59,63 @@ namespace direct_bt {
/**
* GATT Singleton runtime environment properties
+ * <p>
+ * Also see {@link DBTEnv::getExplodingProperties(const std::string & prefixDomain)}.
+ * </p>
*/
- class GATTEnv {
+ class GATTEnv : public DBTEnvrionment {
private:
GATTEnv();
const bool exploding; // just to trigger exploding properties
public:
- /** L2CAP poll timeout for reader thread, defaults to 10s. */
+ /**
+ * L2CAP poll timeout for reader thread, defaults to 10s.
+ * <p>
+ * Environment variable is 'direct_bt.gatt.reader.timeout'.
+ * </p>
+ */
const int32_t L2CAP_READER_THREAD_POLL_TIMEOUT;
- /** Timeout for GATT read command replies, defaults to 500ms. */
+
+ /**
+ * Timeout for GATT read command replies, defaults to 500ms.
+ * <p>
+ * Environment variable is 'direct_bt.gatt.read.timeout'.
+ * </p>
+ */
const int32_t GATT_READ_COMMAND_REPLY_TIMEOUT;
- /** Timeout for GATT write command replies, defaults to 500ms. */
+
+ /**
+ * Timeout for GATT write command replies, defaults to 500ms.
+ * <p>
+ * Environment variable is 'direct_bt.gatt.write.timeout'.
+ * </p>
+ */
const int32_t GATT_WRITE_COMMAND_REPLY_TIMEOUT;
- /** Timeout for l2cap _initial_ command reply, defaults to 2500ms. */
+
+ /**
+ * Timeout for l2cap _initial_ command reply, defaults to 2500ms.
+ * <p>
+ * Environment variable is 'direct_bt.gatt.init.timeout'.
+ * </p>
+ */
const int32_t GATT_INITIAL_COMMAND_REPLY_TIMEOUT;
- /** Medium ringbuffer capacity, defaults to 128 messages. */
+ /**
+ * Medium ringbuffer capacity, defaults to 128 messages.
+ * <p>
+ * Environment variable is 'direct_bt.gatt.ringsize'.
+ * </p>
+ */
const int32_t ATTPDU_RING_CAPACITY;
- /** Debug all GATT Data communication */
+ /**
+ * Debug all GATT Data communication
+ * <p>
+ * Environment variable is 'direct_bt.debug.gatt.data'.
+ * </p>
+ */
const bool DEBUG_DATA;
public:
diff --git a/api/direct_bt/HCIHandler.hpp b/api/direct_bt/HCIHandler.hpp
index 0c02887b..5aee317c 100644
--- a/api/direct_bt/HCIHandler.hpp
+++ b/api/direct_bt/HCIHandler.hpp
@@ -35,6 +35,7 @@
#include <atomic>
#include <thread>
+#include "DBTEnv.hpp"
#include "BTTypes.hpp"
#include "BTIoctl.hpp"
#include "OctetTypes.hpp"
@@ -94,8 +95,11 @@ namespace direct_bt {
/**
* HCI Singleton runtime environment properties
+ * <p>
+ * Also see {@link DBTEnv::getExplodingProperties(const std::string & prefixDomain)}.
+ * </p>
*/
- class HCIEnv {
+ class HCIEnv : public DBTEnvrionment {
friend class HCIHandler;
private:
@@ -104,17 +108,45 @@ namespace direct_bt {
const bool exploding; // just to trigger exploding properties
public:
- /** Poll timeout for HCI reader thread, defaults to 10s */
+ /**
+ * Poll timeout for HCI reader thread, defaults to 10s.
+ * <p>
+ * Environment variable is 'direct_bt.hci.reader.timeout'.
+ * </p>
+ */
const int32_t HCI_READER_THREAD_POLL_TIMEOUT;
- /** Timeout for HCI command status replies, excluding command complete, defaults to 3s. */
+
+ /**
+ * Timeout for HCI command status replies, excluding command complete, defaults to 3s.
+ * <p>
+ * Environment variable is 'direct_bt.hci.cmd.status.timeout'.
+ * </p>
+ */
const int32_t HCI_COMMAND_STATUS_REPLY_TIMEOUT;
- /** Timeout for HCI command complete replies, defaults to 10s. This timeout is rather longer, as it may include waiting for pending command complete. */
+
+ /**
+ * Timeout for HCI command complete replies, defaults to 10s.
+ * This timeout is rather longer, as it may include waiting for pending command complete.
+ * <p>
+ * Environment variable is 'direct_bt.hci.cmd.complete.timeout'.
+ * </p>
+ */
const int32_t HCI_COMMAND_COMPLETE_REPLY_TIMEOUT;
- /** Small ringbuffer capacity for synchronized commands, defaults to 64 messages. */
+ /**
+ * Small ringbuffer capacity for synchronized commands, defaults to 64 messages.
+ * <p>
+ * Environment variable is 'direct_bt.hci.ringsize'.
+ * </p>
+ */
const int32_t HCI_EVT_RING_CAPACITY;
- /** Debug all HCI event communication */
+ /**
+ * Debug all HCI event communication
+ * <p>
+ * Environment variable is 'direct_bt.debug.hci.event'.
+ * </p>
+ */
const bool DEBUG_EVENT;
private: