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_notifications_with_orig_mbed by
Revision 13:d4448d59ab69, committed 2017-04-19
- Comitter:
- nkosarek
- Date:
- Wed Apr 19 01:22:46 2017 +0000
- Parent:
- 12:e38bb61023ed
- Child:
- 14:700ba072d1a0
- Commit message:
- Byte-sized notification to pi working properly
Changed in this revision
| ButtonService.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ButtonService.h Tue Apr 18 21:11:05 2017 +0000
+++ b/ButtonService.h Wed Apr 19 01:22:46 2017 +0000
@@ -30,8 +30,8 @@
ble.gattServer().addService(buttonService);
}
- void updateButtonState(bool newState) {
- ble.gattServer().write(buttonState.getValueHandle(), (uint8_t *)&newState, sizeof(bool));
+ void updateButtonState(uint8_t newState) {
+ ble.gattServer().write(buttonState.getValueHandle(), (uint8_t *)&newState, sizeof(uint8_t));
}
private:
--- a/main.cpp Tue Apr 18 21:11:05 2017 +0000
+++ b/main.cpp Wed Apr 19 01:22:46 2017 +0000
@@ -106,7 +106,7 @@
while (true) {
pc.printf("loop!\r\n");
if(isThereAConnection) {
- pc.printf("sending Notification\r\n");
+ pc.printf("sending Notification: %d\r\n", counter);
buttonServicePtr->updateButtonState(counter);
counter++;
} else {
