From b41e73a1565ff9edd45f814a4b535020c04b1b15 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 17 Sep 2014 00:10:06 +0200 Subject: Bump version, add new GatoConnectionParameters class and ability to change connection parameters. --- gatoconnectionparameters.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 gatoconnectionparameters.h (limited to 'gatoconnectionparameters.h') 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 +#include + +#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 d; +}; + +#endif // GATOCONNECTIONPARAMETERS_H -- cgit v1.2.3