Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_HeartRate by
Diff: main.cpp
- Revision:
- 64:4ced7a1586b0
- Parent:
- 63:3c5ca3832415
- Child:
- 65:5a78321ef3d3
diff -r 3c5ca3832415 -r 4ced7a1586b0 main.cpp
--- a/main.cpp Fri Jun 12 08:23:05 2015 +0000
+++ b/main.cpp Fri Jun 12 08:30:07 2015 +0000
@@ -25,42 +25,42 @@
* interval.*/
#define UPDATE_PARAMS_FOR_LONGER_CONNECTION_INTERVAL 0
-BLEDevice ble;
+//BLEDevice ble;
DigitalOut led1(LED1);
Serial pc(USBTX, USBRX); // tx, rx
static volatile bool triggerSensorPolling = false;
-void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
+/*void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
{
ble.startAdvertising(); // restart advertising
-}
-
+}*/
+/*
void periodicCallback(void)
{
led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */
/* Note that the periodicCallback() executes in interrupt context, so it is safer to do
* heavy-weight sensor polling from the main thread. */
- triggerSensorPolling = true;
-}
+ //triggerSensorPolling = true;
+//}
int main(void)
{
- led1 = 1;
- Ticker ticker;
- ticker.attach(periodicCallback, 1); // blink LED every second
+ //led1 = 1;
+ //Ticker ticker;
+ //ticker.attach(periodicCallback, 1); // blink LED every second
- ble.onDisconnection(disconnectionCallback);
+ //ble.onDisconnection(disconnectionCallback);
/* Setup primary service. */
- uint8_t battery = 100;
- FeedbackService FService(ble);
+ //uint8_t battery = 100;
+ FeedbackService FService();
// infinite loop
- while (1) {
- // check for trigger from periodicCallback()
- if (triggerSensorPolling && ble.getGapState().connected) {
+ /* while (1) {
+ // check for trigger from periodicCallback()
+ if ( ble.getGapState().connected) {
triggerSensorPolling = false;
battery--;
@@ -73,5 +73,5 @@
} else {
ble.waitForEvent(); // low power wait for event
}
- }
+ }*/
}
