diff options
author | Javier <maemo@javispedro.com> | 2014-09-17 00:10:06 +0200 |
---|---|---|
committer | Javier <maemo@javispedro.com> | 2014-09-17 00:10:06 +0200 |
commit | b41e73a1565ff9edd45f814a4b535020c04b1b15 (patch) | |
tree | 832c003e726815c1a284d5663bcf1f721ecc95ef /gatoconnectionparameters.cpp | |
parent | 52e67e59de9bc11cab6cd69e4e403dd9d34582b1 (diff) | |
download | libgato-b41e73a1565ff9edd45f814a4b535020c04b1b15.tar.gz libgato-b41e73a1565ff9edd45f814a4b535020c04b1b15.zip |
Bump version, add new GatoConnectionParameters class and ability to
change connection parameters.
Diffstat (limited to 'gatoconnectionparameters.cpp')
-rw-r--r-- | gatoconnectionparameters.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/gatoconnectionparameters.cpp b/gatoconnectionparameters.cpp new file mode 100644 index 0000000..29ec37b --- /dev/null +++ b/gatoconnectionparameters.cpp @@ -0,0 +1,77 @@ +#include "gatoconnectionparameters.h" +#include <QSharedData> + +struct GatoConnectionParametersPrivate : public QSharedData +{ + int connIntervalMin; + int connIntervalMax; + int slaveLatency; + int supervisionTimeout; +}; + +GatoConnectionParameters::GatoConnectionParameters() + : d(new GatoConnectionParametersPrivate) +{ +} + +GatoConnectionParameters::GatoConnectionParameters(const GatoConnectionParameters &o) + : d(o.d) +{ +} + +GatoConnectionParameters::~GatoConnectionParameters() +{ +} + +int GatoConnectionParameters::connectionIntervalMin() const +{ + return d->connIntervalMin; +} + +void GatoConnectionParameters::setConnectionIntervalMin(int interval) +{ + d->connIntervalMin = interval; +} + +int GatoConnectionParameters::connectionIntervalMax() const +{ + return d->connIntervalMax; +} + +void GatoConnectionParameters::setConnectionIntervalMax(int interval) +{ + d->connIntervalMax = interval; +} + +void GatoConnectionParameters::setConnectionInterval(int min, int max) +{ + d->connIntervalMin = min; + d->connIntervalMax = max; +} + +int GatoConnectionParameters::slaveLatency() const +{ + return d->slaveLatency; +} + +void GatoConnectionParameters::setSlaveLatency(int latency) +{ + d->slaveLatency = latency; +} + +int GatoConnectionParameters::supervisionTimeout() const +{ + return d->supervisionTimeout; +} + +void GatoConnectionParameters::setSupervisionTimeout(int timeout) +{ + d->supervisionTimeout = timeout; +} + +GatoConnectionParameters &GatoConnectionParameters::operator=(const GatoConnectionParameters &o) +{ + if (this != &o) + d.operator=(o.d); + return *this; +} |