High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Diff: public/Gap.h
- Revision:
- 563:62cc3335df23
- Parent:
- 561:4122e5d0e043
- Child:
- 567:e4b38e43de7c
diff -r ad06c59db307 -r 62cc3335df23 public/Gap.h --- a/public/Gap.h Fri Jun 19 15:52:11 2015 +0100 +++ b/public/Gap.h Fri Jun 19 15:52:11 2015 +0100 @@ -74,7 +74,7 @@ unsigned connected : 1; /**< peripheral is connected to a central */ }; - typedef uint16_t Handle_t; + typedef uint16_t Handle_t; /* Type for connection handle. */ typedef struct { uint16_t minConnectionInterval; /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ @@ -230,6 +230,23 @@ * @param reason * The reason for disconnection to be sent back to the peer. */ + virtual ble_error_t disconnect(Handle_t connectionHandle, DisconnectionReason_t reason) { + return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ + } + + /** + * This call initiates the disconnection procedure, and its completion will + * be communicated to the application with an invocation of the + * disconnectionCallback. + * + * @param reason + * The reason for disconnection to be sent back to the peer. + * + * @note: this version of disconnect() doesn't take a connection handle. It + * will work reliably only for stacks which are limited to a single + * connection. This API should be considered *deprecated* in favour of the + * altertive which takes a connection handle. It will be dropped in the future. + */ virtual ble_error_t disconnect(DisconnectionReason_t reason) { return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ }