
Simple example to demonstrate custom made BLE service and characteristics.
Fork of BLE_GATT_Example by
Revision 11:b59226338001, committed 2015-03-11
- Comitter:
- mbedAustin
- Date:
- Wed Mar 11 14:23:25 2015 +0000
- Parent:
- 10:6acaa9f0ef85
- Child:
- 12:6d1f77d0cb37
- Commit message:
- updated code with printf's for LED on / off
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Mar 10 15:11:10 2015 +0000 +++ b/main.cpp Wed Mar 11 14:23:25 2015 +0000 @@ -43,14 +43,14 @@ // toggle LED if only 1 byte is written if(params->len == 1) { led = params->data[0]; + (params->data[0] == 0x00) ? printf("\n\rled on ") : printf("\n\rled off "); // print led toggle } // print the data if more than 1 byte is written else { - printf("0x"); + printf("\n\r Data received: length = %d, data = 0x",params->len); for(int x=0; x < params->len; x++) { printf("%x",params->data[x]); } - printf("\n\r"); // print newline } // update the readChar with the value of writeChar ble.updateCharacteristicValue(readChar.getValueHandle(),params->data,params->len);