wersion 1.9

Fork of BLE_API by Bluetooth Low Energy

Revision:
766:03f1a26f132f
Parent:
710:b2e1a2660ec2
Child:
900:1e6785897fbd
diff -r 4cd91998cd48 -r 03f1a26f132f ble/GapScanningParams.h
--- a/ble/GapScanningParams.h	Fri Aug 07 15:53:50 2015 +0100
+++ b/ble/GapScanningParams.h	Fri Aug 07 15:53:50 2015 +0100
@@ -32,6 +32,11 @@
                       uint16_t timeout        = 0,
                       bool     activeScanning = false);
 
+    static const uint16_t UNIT_0_625_MS = 625;  /**< Number of microseconds in 0.625 milliseconds. */
+    static uint16_t MSEC_TO_SCAN_DURATION_UNITS(uint32_t durationInMillis) {
+        return (durationInMillis * 1000) / UNIT_0_625_MS;
+    }
+
     ble_error_t setInterval(uint16_t newIntervalInMS);
 
     ble_error_t setWindow(uint16_t newWindowInMS);