High level Bluetooth Low Energy API and radio abstraction layer

Dependents:   BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate BLE_ANCS_SDAPI_IRC ... more

Overview

The BLE_API is a high level abstraction for using Bluetooth Low Energy on multiple platforms. For details and examples using the BLE_API please see the BLE_API Summary Page. Or click on the API Documentation tab above.

Supported Services

Supported services can be found in the BLE_API/services folder.

Revision:
766:03f1a26f132f
Parent:
710:b2e1a2660ec2
Child:
778:04488024e560
--- a/ble/GapAdvertisingParams.h	Fri Aug 07 15:53:50 2015 +0100
+++ b/ble/GapAdvertisingParams.h	Fri Aug 07 15:53:50 2015 +0100
@@ -86,8 +86,16 @@
         }
     }
 
+    static const uint16_t UNIT_0_625_MS = 625;  /**< Number of microseconds in 0.625 milliseconds. */
+    static uint16_t MSEC_TO_ADVERTISEMENT_DURATION_UNITS(uint32_t durationInMillis) {
+        return (durationInMillis * 1000) / UNIT_0_625_MS;
+    }
+    static uint16_t ADVERTISEMENT_DURATION_UNITS_TO_MS(uint16_t gapUnits) {
+        return (gapUnits * UNIT_0_625_MS) / 1000;
+    }
+
     AdvertisingType_t getAdvertisingType(void) const {return _advType; }
-    uint16_t          getInterval(void)        const {return _interval;}
+    uint16_t          getInterval(void)        const {return ADVERTISEMENT_DURATION_UNITS_TO_MS(_interval);}
     uint16_t          getTimeout(void)         const {return _timeout; }
 
     void setAdvertisingType(AdvertisingType_t newAdvType) {_advType = newAdvType;  }