A template for applications where some small amount of data needs to be notified to a phone app over BLE. It is a good starting point for notifications.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_Button by
Revision 12:e38bb61023ed, committed 2017-04-18
- Comitter:
- znew711
- Date:
- Tue Apr 18 21:11:05 2017 +0000
- Parent:
- 11:fd1cf9dbf3a4
- Commit message:
- it's hanging.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r fd1cf9dbf3a4 -r e38bb61023ed main.cpp --- a/main.cpp Tue Apr 18 17:05:04 2017 +0000 +++ b/main.cpp Tue Apr 18 21:11:05 2017 +0000 @@ -87,7 +87,6 @@ ble.gap().setAdvertisingInterval(1000); /* 1000ms. */ pc.printf("start advertising now \r\n"); ble.gap().startAdvertising(); - } int main(void) @@ -98,7 +97,7 @@ BLE &ble = BLE::Instance(); ble.init(bleInitComplete); - pc.printf("entereing spin loop\r\n"); + pc.printf("entering spin loop\r\n"); /* SpinWait for initialization to complete. This is necessary because the * BLE object is used in the main loop below. */ while (ble.hasInitialized() == false) { /* spin loop */ } @@ -110,10 +109,10 @@ pc.printf("sending Notification\r\n"); buttonServicePtr->updateButtonState(counter); counter++; - //sleep(1000); } else { // } - ble.waitForEvent(); + //ble.waitForEvent(); + sleep(1000); } }