summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-06-12 16:40:02 +0200
committerJavier <dev.git@javispedro.com>2016-06-12 16:40:02 +0200
commit153e1e8b46acca2e689773233cabb920030fca7b (patch)
treebef040cd6966dc4293abda6f6307edb5a3fedaaf
parent0104d4b1a13cb500a8b117ce745ffd7ca96ee79a (diff)
downloadlibgato-153e1e8b46acca2e689773233cabb920030fca7b.tar.gz
libgato-153e1e8b46acca2e689773233cabb920030fca7b.zip
fix broken scan window/interval unit conversionHEADmaster
-rw-r--r--gatosocket.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/gatosocket.cpp b/gatosocket.cpp
index fbad2f6..5039e5b 100644
--- a/gatosocket.cpp
+++ b/gatosocket.cpp
@@ -259,8 +259,8 @@ GatoConnectionParameters GatoSocket::connectionParameters() const
return desiredParams;
}
// Kernel uses "multiples of 0.625ms", we use µs
- params.setScanInterval(bt_params.scan_interval * 0625);
- params.setScanWindow(bt_params.scan_window * 0625);
+ params.setScanInterval(bt_params.scan_interval * 625);
+ params.setScanWindow(bt_params.scan_window * 625);
// Kernel uses "multiples of 1.25ms", we use µs, need to convert.
params.setConnectionInterval(bt_params.interval_min * 1250, bt_params.interval_max * 1250);
// Kernel units already in ms.
@@ -290,8 +290,8 @@ bool GatoSocket::setConnectionParameters(const GatoConnectionParameters &params)
memset(&bt_params, 0, len);
// Kernel uses "multiples of 0.625ms", we use µs
- bt_params.scan_interval = params.scanInterval() / 0625;
- bt_params.scan_window = params.scanWindow() / 0625;
+ bt_params.scan_interval = params.scanInterval() / 625;
+ bt_params.scan_window = params.scanWindow() / 625;
// Kernel uses "multiples of 1.25ms", we use µs, need to convert
bt_params.interval_min = params.connectionIntervalMin() / 1250;
bt_params.interval_max = params.connectionIntervalMax() / 1250;