BLE Library with custom services for the tortuga bike

Dependents:   TORTUGA_BLE

Fork of BLE_API by aapje monkey

Committer:
rgrover1
Date:
Mon Nov 02 09:09:08 2015 +0000
Revision:
867:b099c28e8e28
Parent:
861:2afa79e3ed0a
Child:
870:097a9f627432
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.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 712:b04b5db36865 1 {
rgrover1 712:b04b5db36865 2 "name": "ble",
rgrover1 867:b099c28e8e28 3 "version": "2.0.0",
rgrover1 712:b04b5db36865 4 "description": "The BLE module offers a high level abstraction for using Bluetooth Low Energy on multiple platforms.",
rgrover1 712:b04b5db36865 5 "keywords": [
rgrover1 712:b04b5db36865 6 "Bluetooth",
rgrover1 853:2e829bcda785 7 "BLE",
rgrover1 853:2e829bcda785 8 "mbed",
rgrover1 853:2e829bcda785 9 "mbed-official"
rgrover1 712:b04b5db36865 10 ],
rgrover1 712:b04b5db36865 11 "author": "Rohit Grover",
rgrover1 712:b04b5db36865 12 "repository": {
rgrover1 860:0d41e4eb3d0a 13 "url": "https://github.com/ARMmbed/ble.git",
rgrover1 712:b04b5db36865 14 "type": "git"
rgrover1 712:b04b5db36865 15 },
rgrover1 712:b04b5db36865 16 "homepage": "http://mbed.org/ble",
rgrover1 712:b04b5db36865 17 "licenses": [
rgrover1 712:b04b5db36865 18 {
rgrover1 712:b04b5db36865 19 "url": "https://spdx.org/licenses/Apache-2.0",
rgrover1 712:b04b5db36865 20 "type": "Apache-2.0"
rgrover1 712:b04b5db36865 21 }
rgrover1 712:b04b5db36865 22 ],
rgrover1 761:612103f2faf6 23 "dependencies": {},
rgrover1 712:b04b5db36865 24 "targetDependencies": {
rgrover1 853:2e829bcda785 25 "st-ble-shield": {
rgrover1 853:2e829bcda785 26 "x-nucleo-idb0xa1": "ARMmbed/ble-x-nucleo-idb0xa1"
rgrover1 853:2e829bcda785 27 },
rgrover1 712:b04b5db36865 28 "nrf51822": {
rgrover1 867:b099c28e8e28 29 "ble-nrf51822": "^2.0.0"
rgrover1 853:2e829bcda785 30 },
rgrover1 861:2afa79e3ed0a 31 "cordio": {
rgrover1 867:b099c28e8e28 32 "ble-wicentric": "~0.0.4"
rgrover1 861:2afa79e3ed0a 33 },
rgrover1 746:e2c7eb0f8b26 34 "mbed-classic": {
rgrover1 761:612103f2faf6 35 "mbed-classic": "~0.0.1"
rgrover1 775:8e6aa638f8d9 36 },
rgrover1 812:aba49f3176a2 37 "mbed-os": {
rgrover1 786:d6d7087d8377 38 "mbed-drivers": "*"
rgrover1 712:b04b5db36865 39 }
rgrover1 712:b04b5db36865 40 }
rgrover1 712:b04b5db36865 41 }