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: ble/GapScanningParams.h
- 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);