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.

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Mon Aug 10 15:19:43 2015 +0100
Parent:
777:835fc08df403
Child:
779:6fd9004bc4b7
Commit message:
Synchronized with git rev caadd8c6
Author: Joshua Slater
added getIntervalInAdvUnits

Changed in this revision

ble/Gap.h Show annotated file Show diff for this revision Revisions of this file
ble/GapAdvertisingParams.h Show annotated file Show diff for this revision Revisions of this file
--- a/ble/Gap.h	Mon Aug 10 15:19:43 2015 +0100
+++ b/ble/Gap.h	Mon Aug 10 15:19:43 2015 +0100
@@ -465,7 +465,7 @@
         } else if (interval < getMinAdvertisingInterval()) {
             interval = getMinAdvertisingInterval();
         }
-        _advParams.setInterval(GapAdvertisingParams::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(interval));
+        _advParams.setInterval(interval);
     }
 
     /**
--- a/ble/GapAdvertisingParams.h	Mon Aug 10 15:19:43 2015 +0100
+++ b/ble/GapAdvertisingParams.h	Mon Aug 10 15:19:43 2015 +0100
@@ -17,6 +17,8 @@
 #ifndef __GAP_ADVERTISING_PARAMS_H__
 #define __GAP_ADVERTISING_PARAMS_H__
 
+ #include "mbed.h"
+
 /**************************************************************************/
 /*!
     \brief
@@ -96,10 +98,11 @@
 
     AdvertisingType_t getAdvertisingType(void) const {return _advType; }
     uint16_t          getInterval(void)        const {return ADVERTISEMENT_DURATION_UNITS_TO_MS(_interval);}
+    uint16_t          getIntervalInAdvUnits(void) const {return _interval;}
     uint16_t          getTimeout(void)         const {return _timeout; }
 
     void setAdvertisingType(AdvertisingType_t newAdvType) {_advType = newAdvType;  }
-    void setInterval(uint16_t newInterval)                {_interval = newInterval;}
+    void setInterval(uint16_t newInterval)                {_interval = MSEC_TO_ADVERTISEMENT_DURATION_UNITS(newInterval);}
     void setTimeout(uint16_t newTimeout)                  {_timeout = newTimeout;  }
 
 private: