Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Diff: public/Gap.h
- Revision:
- 133:1f1d7324f5be
- Parent:
- 132:69dada1321ab
- Child:
- 134:49321f76753e
diff -r 69dada1321ab -r 1f1d7324f5be public/Gap.h
--- a/public/Gap.h	Fri Nov 21 09:23:23 2014 +0000
+++ b/public/Gap.h	Fri Nov 21 09:23:23 2014 +0000
@@ -71,6 +71,11 @@
         uint16_t connectionSupervisionTimeout; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/
     } ConnectionParams_t;
 
+    static const uint16_t UNIT_1_25_MS = 1250; /**< Number of microseconds in 1.25 milliseconds. */
+    static uint16_t MSEC_TO_GAP_DURATION_UNITS(uint32_t durationInMillis) {
+        return (durationInMillis * 1000) / UNIT_1_25_MS;
+    }
+
 public:
     /* These functions must be defined in the sub-class */
     virtual ble_error_t setAddress(addr_type_t type,   const address_t address)                    = 0;
    