Odometry Pedometer using nRF51822 and ADXL345
Dependencies: ADXL345 BLE_API mbed nRF51822
Fork of BLE_CycleSpeedCadence by
Revision 65:cb76569f74f6, committed 2015-06-20
- Comitter:
- rgrover1
- Date:
- Sat Jun 20 00:03:36 2015 +0000
- Parent:
- 64:749d180e6a3d
- Child:
- 66:c09ddf226b9c
- Commit message:
- make use of the gap() accessor for ble
Changed in this revision
--- a/BLE_API.lib Mon Jun 08 10:02:17 2015 +0000 +++ b/BLE_API.lib Sat Jun 20 00:03:36 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#c4436674db7b +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#b04b5db36865
--- a/main.cpp Mon Jun 08 10:02:17 2015 +0000
+++ b/main.cpp Sat Jun 20 00:03:36 2015 +0000
@@ -15,7 +15,7 @@
*/
#include "mbed.h"
-#include "BLEDevice.h"
+#include "BLE.h"
#include "HeartRateService.h"
#include "DeviceInformationService.h"
@@ -54,7 +54,7 @@
ticker.attach(periodicCallback, 1); // blink LED every second
ble.init();
- ble.onDisconnection(disconnectionCallback);
+ ble.gap().onDisconnection(disconnectionCallback);
/* Setup primary service. */
uint8_t hrmCounter = 100; // init HRM to 100bps
@@ -64,13 +64,13 @@
DeviceInformationService deviceInfo(ble, "ARM", "Model1", "SN1", "hw-rev1", "fw-rev1", "soft-rev1");
/* Setup advertising. */
- ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
- ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list));
- ble.accumulateAdvertisingPayload(GapAdvertisingData::GENERIC_HEART_RATE_SENSOR);
- ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME));
- ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
- ble.setAdvertisingInterval(1000);
- ble.startAdvertising();
+ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
+ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list));
+ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::GENERIC_HEART_RATE_SENSOR);
+ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME));
+ ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
+ ble.gap().setAdvertisingInterval(1000);
+ ble.gap().startAdvertising();
// infinite loop
while (1) {
--- a/mbed.bld Mon Jun 08 10:02:17 2015 +0000 +++ b/mbed.bld Sat Jun 20 00:03:36 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file
--- a/nRF51822.lib Mon Jun 08 10:02:17 2015 +0000 +++ b/nRF51822.lib Sat Jun 20 00:03:36 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#d0fc349b9a1b +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#7c68c8d67e1f
