An initial demo showcasing the GattClient APIs. Drives an LED service exported by a BLE_LED peripheral. Shows scanning, connections, service-discovery, and reads/writes.
Dependencies: BLE_API mbed nRF51822
Revision 7:61e2224ec9a0, committed 2015-07-02
- Comitter:
- rgrover1
- Date:
- Thu Jul 02 08:39:04 2015 +0000
- Parent:
- 6:1730f66fb14d
- Child:
- 8:b433a261072f
- Commit message:
- update to the latest of the underlying API
Changed in this revision
--- a/BLE_API.lib Mon Jun 29 06:23:09 2015 +0000 +++ b/BLE_API.lib Thu Jul 02 08:39:04 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#b04b5db36865 +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#6884e374e2eb
--- a/main.cpp Mon Jun 29 06:23:09 2015 +0000
+++ b/main.cpp Thu Jul 02 08:39:04 2015 +0000
@@ -18,6 +18,7 @@
#include "ble/BLE.h"
#include "ble/DiscoveredCharacteristic.h"
#include "ble/DiscoveredService.h"
+#include "ble/services/UARTService.h"
BLE ble;
@@ -107,8 +108,8 @@
/* Request for comments: should setupOnDataRead() be a static for DiscoveredCharacteristic?
* Or should it be passed in as a parameter to read()? */
- DiscoveredCharacteristic::setupOnDataRead(triggerToggledWrite);
- DiscoveredCharacteristic::setupOnDataWrite(triggerRead);
+ ble.gattClient().onDataRead(triggerToggledWrite);
+ ble.gattClient().onDataWrite(triggerRead);
ble.gap().setScanParams(500, 400);
ble.gap().startScan(advertisementCallback);
--- a/nRF51822.lib Mon Jun 29 06:23:09 2015 +0000 +++ b/nRF51822.lib Thu Jul 02 08:39:04 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#7c68c8d67e1f +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#7455428e5ddb