summaryrefslogtreecommitdiff
path: root/gatoconnectionparameters.h
diff options
context:
space:
mode:
Diffstat (limited to 'gatoconnectionparameters.h')
-rw-r--r--gatoconnectionparameters.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/gatoconnectionparameters.h b/gatoconnectionparameters.h
new file mode 100644
index 0000000..1441020
--- /dev/null
+++ b/gatoconnectionparameters.h
@@ -0,0 +1,52 @@
+#ifndef GATOCONNECTIONPARAMETERS_H
+#define GATOCONNECTIONPARAMETERS_H
+
+#include <QtCore/QObject>
+#include <QtCore/QSharedDataPointer>
+
+#include "libgato_global.h"
+
+class GatoConnectionParametersPrivate;
+
+/** These parameters determine the effective throughput of a Low Energy link,
+ * enabling custom balancing between power usage, bandwidth, and latency. */
+
+class LIBGATO_EXPORT GatoConnectionParameters
+{
+ Q_GADGET
+
+public:
+ GatoConnectionParameters();
+ GatoConnectionParameters(const GatoConnectionParameters &o);
+ ~GatoConnectionParameters();
+
+ // Units for all of this: milliseconds
+ // TODO Need to document
+
+ // Connection interval: generally, lower connection interval increases throughput.
+ // Units: microseconds (µs!)
+
+ int connectionIntervalMin() const;
+ void setConnectionIntervalMin(int interval);
+
+ int connectionIntervalMax() const;
+ void setConnectionIntervalMax(int interval);
+
+ void setConnectionInterval(int min, int max);
+
+ // TODO Document
+ // Units: miliseconds (ms!)
+ int slaveLatency() const;
+ void setSlaveLatency(int latency);
+
+ // Units: miliseconds
+ int supervisionTimeout() const;
+ void setSupervisionTimeout(int timeout);
+
+ GatoConnectionParameters &operator=(const GatoConnectionParameters &o);
+
+private:
+ QSharedDataPointer<GatoConnectionParametersPrivate> d;
+};
+
+#endif // GATOCONNECTIONPARAMETERS_H