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 Nov 02 09:09:08 2015 +0000
Parent:
866:a2a40c69eec0
Child:
868:bbc33d099e5e
Commit message:
Synchronized with git rev 2f92904f
Author: Rohit Grover
Release 2.0.0
=============

* Major change to the APIs around stack initialization. BLE::init() is now
meant to only trigger the initialization of the underlying BLE stack. init()
now takes a completion callback as an optional parameter; this callback gets
invoked when initialization completes.

- There's a new type: BLE::InitializationCompleteCallback_t

- There's a new API: BLEInstanceBase::hasInitialized() which transports
need to implement.

- If no init-completion callback is setup, the application can still
determine the status of initialization using BLE::hasInitialized().

!This update may require in a minor change to existing apps!

mbed-classic demos would look something like:

```
main() {
BLE::Instance().init();
while (!BLE::Instance().hasInitialized()) {
/* spin wait */
}

/* rest of the initialization ending in the waitForEvent loop */

}
```

whereas mbedOS demos would look like:

```
void bleInitComplete(BLE &ble, ble_error_t error)
{
WsfTrace("bleInitComplete");

if (error != BLE_ERROR_NONE) {
WsfTrace("initailization failed with error: %u", error);
return;
}

if (ble.getInstanceID() == BLE::DEFAULT_INSTANCE) {
/* use the BLE instance */
}
}

extern "C" void app_start(int argc, char *argv[])
{
BLE::Instance().init(bleInitComplete);
}
```

The Nordic stack initializes right-away, and so existing demos based on Nordic should continue to work.

* There's a new API: BLE::getInstanceID(), which simply returns the ID of an
instance.

* Reduce the memory footprint consumed by a FunctionPointerWithContext to 20
bytes (originally, it was 32 bytes !). Also enforce alignment constraints
of the embedded pointer to member function. This should help with the size
of a GattCharacteristic.

* Add EnvironmentalService.h under services/.

* There have been minor improvements to EddystoneService and EddystoneConfigService.

* We've added a CONTRIBUTING.md to help guide user contributions.

Changed in this revision

CONTRIBUTING.md Show annotated file Show diff for this revision Revisions of this file
module.json Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CONTRIBUTING.md	Mon Nov 02 09:09:08 2015 +0000
@@ -0,0 +1,7 @@
+# Hello!
+We are an open source project of [ARM mbed](www.mbed.com). Contributions via [pull request](https://github.com/armmbed/yotta/pulls), and [bug reports](https://github.com/armmbed/yotta/issues) are welcome!
+
+Please submit your pull request to the 'develop' branch of this module. Commits to develop will merge into master at the time of the next release.
+
+# Contributor agreement
+For your pull request to be accepted, we will need you to agree to our [contributor agreement](http://developer.mbed.org/contributor_agreement/) to give us the necessary rights to use and distribute your contributions. (To click through the agreement create an account on mbed.com and log in.)
\ No newline at end of file
--- a/module.json	Mon Nov 02 09:09:08 2015 +0000
+++ b/module.json	Mon Nov 02 09:09:08 2015 +0000
@@ -1,6 +1,6 @@
 {
   "name": "ble",
-  "version": "1.1.0",
+  "version": "2.0.0",
   "description": "The BLE module offers a high level abstraction for using Bluetooth Low Energy on multiple platforms.",
   "keywords": [
     "Bluetooth",
@@ -26,10 +26,10 @@
       "x-nucleo-idb0xa1": "ARMmbed/ble-x-nucleo-idb0xa1"
     },
     "nrf51822": {
-      "ble-nrf51822": "^1.0.0"
+      "ble-nrf51822": "^2.0.0"
     },
     "cordio": {
-      "ble-wicentric": "~0.0.0"
+      "ble-wicentric": "~0.0.4"
     },
     "mbed-classic": {
       "mbed-classic": "~0.0.1"