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.
Fork of BLE_API by
Diff: public/Gap.h
- Revision:
- 543:4defb791aa94
- Parent:
- 542:d60f1c06fa33
- Child:
- 544:840f428d18c7
--- a/public/Gap.h Fri Jun 19 15:52:09 2015 +0100
+++ b/public/Gap.h Fri Jun 19 15:52:09 2015 +0100
@@ -255,7 +255,7 @@
* @param scanParams
* Paramters to be used while scanning for the peer.
* @return BLE_ERROR_NONE if connection establishment procedure is started
- * successfully. The onConnection callback (if set) will be invoked upon
+ * successfully. The connectionCallback (if set) will be invoked upon
* a connection event.
*/
virtual ble_error_t connect(const Address_t peerAddr,
@@ -760,7 +760,10 @@
*/
void onTimeout(TimeoutEventCallback_t callback) {timeoutCallback = callback;}
- void setOnConnection(ConnectionEventCallback_t callback) {onConnection = callback;}
+ /**
+ * Setup a callback for connection events. Refer to ConnectionEventCallback_t.
+ */
+ void onConnection(ConnectionEventCallback_t callback) {connectionCallback = callback;}
/**
* Set the application callback for disconnection events.
@@ -827,7 +830,7 @@
_scanResponse(),
state(),
timeoutCallback(NULL),
- onConnection(NULL),
+ connectionCallback(NULL),
onDisconnection(NULL),
onRadioNotification(),
onSecuritySetupInitiated(),
@@ -850,9 +853,9 @@
const Address_t ownAddr,
const ConnectionParams_t *connectionParams) {
state.connected = 1;
- if (onConnection) {
+ if (connectionCallback) {
ConnectionCallbackParams_t callbackParams(handle, role, peerAddrType, peerAddr, ownAddrType, ownAddr, connectionParams);
- onConnection(&callbackParams);
+ connectionCallback(&callbackParams);
}
}
@@ -926,7 +929,7 @@
protected:
TimeoutEventCallback_t timeoutCallback;
- ConnectionEventCallback_t onConnection;
+ ConnectionEventCallback_t connectionCallback;
DisconnectionEventCallback_t onDisconnection;
RadioNotificationEventCallback_t onRadioNotification;
SecuritySetupInitiatedCallback_t onSecuritySetupInitiated;
