Lancaster University's fork of the mbed BLE API. Lives on github, https://github.com/lancaster-university/BLE_API

Dependents:   microbit-dal microbit-dal microbit-ble-open microbit-dal ... more

Fork of BLE_API by Bluetooth Low Energy

Revision:
766:03f1a26f132f
Parent:
712:b04b5db36865
Child:
767:d6a79c77d1c3
diff -r 4cd91998cd48 -r 03f1a26f132f source/GapScanningParams.cpp
--- a/source/GapScanningParams.cpp	Fri Aug 07 15:53:50 2015 +0100
+++ b/source/GapScanningParams.cpp	Fri Aug 07 15:53:50 2015 +0100
@@ -18,8 +18,8 @@
 #include "ble/GapScanningParams.h"
 
 GapScanningParams::GapScanningParams(uint16_t interval, uint16_t window, uint16_t timeout, bool activeScanning) :
-    _interval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(interval)),
-    _window(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(window)),
+    _interval(Gap::MSEC_TO_SCAN_DURATION_UNITS(interval)),
+    _window(Gap::MSEC_TO_SCAN_DURATION_UNITS(window)),
     _timeout(timeout),
     _activeScanning(activeScanning) {
     /* stay within limits */
@@ -40,7 +40,7 @@
 ble_error_t
 GapScanningParams::setInterval(uint16_t newIntervalInMS)
 {
-    uint16_t newInterval = Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(newIntervalInMS);
+    uint16_t newInterval = Gap::MSEC_TO_SCAN_DURATION_UNITS(newIntervalInMS);
     if ((newInterval >= SCAN_INTERVAL_MIN) && (newInterval < SCAN_INTERVAL_MAX)) {
         _interval = newInterval;
         return BLE_ERROR_NONE;
@@ -52,7 +52,7 @@
 ble_error_t
 GapScanningParams::setWindow(uint16_t newWindowInMS)
 {
-    uint16_t newWindow = Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(newWindowInMS);
+    uint16_t newWindow = Gap::MSEC_TO_SCAN_DURATION_UNITS(newWindowInMS);
     if ((newWindow >= SCAN_WINDOW_MIN) && (newWindow < SCAN_WINDOW_MAX)) {
         _window   = newWindow;
         return BLE_ERROR_NONE;