8000 Update example "BLE_SimplePeripheral" · RedBearLab/nRF51822-Arduino@fcbafd3 · GitHub
[go: up one dir, main page]

Skip to content

Commit fcbafd3

Browse files
author
jixing.zou
committed
Update example "BLE_SimplePeripheral"
1 parent ccbbfcf commit fcbafd3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arduino-1.6.x/hardware/RBL/RBL_nRF51822/libraries/BLE_Examples/examples/BLE_SimplePeripheral/BLE_SimplePeripheral.ino

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ void gattServerWriteCallBack(const GattWriteCallbackParams *Handler) {
167167
}
168168
}
169169

170+
/** @brief Helper function that notifies all registered handlers of an occurrence of a data sent event.
171+
* This function is meant to be called from the BLE stack specific implementation when a data sent event occurs(event: BLE_EVT_TX_COMPLETE).
172+
*
173+
* @param[in] count Number of packets sent.
174+
*/
175+
void gattServerSentCallBack(unsigned int count)
176+
{
177+
Serial.print("The count : ");
178+
Serial.println(count, DEC);
179+
}
180+
170181
/**
171182
* @brief Timer task callback handle
172183
*/
@@ -235,6 +246,7 @@ void setup() {
235246
ble.onConnection(connectionCallBack);
236247
ble.onDisconnection(disconnectionCallBack);
237248
ble.onDataWritten(gattServerWriteCallBack);
249+
ble.onDataSent(gattServerSentCallBack);
238250
// set advertisement
239251
setAdvertisement();
240252
// set adv_type(enum from 0)

0 commit comments

Comments
 (0)
0