![](/media/cache/profiles/f0fcf351df4eb6786e9bb6fc4e2dee02.jpg.50x50_q85.jpg)
Pair function with BLE_Paired_Client. If missing BLE_Paired_Server side, Client side of BZ will ON for notice.
Dependencies: BLE_API mbed nRF51822 nRF51_LowPwr nRF51_Vdd
Fork of BLE_GATT_Example by
Diff: main.cpp
- Revision:
- 3:0fb60f81f693
- Parent:
- 2:e84c13abc479
- Child:
- 4:7ef90665b399
--- a/main.cpp Sat Feb 14 14:48:29 2015 +0000 +++ b/main.cpp Sat Feb 14 15:25:00 2015 +0000 @@ -33,6 +33,11 @@ ble.startAdvertising(); // restart advertising } +// This function is called whenever someone writes something to the writeCharacteristic +void writeCharCallback(//TODO, fill this in) +{ + //TODO: when character is written here change the LED, update the read characteristic, and print out to console +} int main(void) @@ -40,6 +45,7 @@ led = 0; // turn LED off ble.init(); ble.onDisconnection(disconnectionCallback); + ble.onDataWritten(customService.writeChar,writeCharCallback); //TODO: this is not correct, figure out correct syntax /* setup advertising */ ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);