Zachary Newman / Mbed 2 deprecated zach_thresholding

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_notifications_with_orig_mbed by Nicholas Kosarek

Files at this revision

API Documentation at this revision

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 {