Introduce GattServer API to determine notification status for a characteristic.

follow up from https://github.com/mbedmicro/BLE_API/pull/41.
@jeremybrodt did a lovely job submitting that pull request, but there had been too many changes in the neighbouring code recently to merge his work directly. I didn't take the trouble of preseving his submission in the history; my apologies--credit for this API goes entirely to him.
This commit is contained in:
Rohit Grover 2015-07-01 14:52:17 +01:00
parent 453681182a
commit 9a0be47794
1 changed files with 31 additions and 0 deletions

View File

@ -148,6 +148,37 @@ public:
return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */
}
/**
* Determine the updates-enabled status (notification/indication) for the current connection from a characteristic's CCCD.
*
* @param characteristic
* The characteristic
* @param[out] enabledP
* Upon return, *enabledP is true if updates are enabled, else false.
*
* @return BLE_ERROR_NONE if the connection and handle are found. false otherwise.
*/
virtual ble_error_t areUpdatesEnabled(const GattCharacteristic &characteristic, bool *enabledP) {
return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */
}
/**
* Determine the connection-specific updates-enabled status (notification/indication) from a characteristic's CCCD.
*
* @param connectionHandle
* The connection handle
* @param[out] enabledP
* Upon return, *enabledP is true if updates are enabled, else false.
*
* @param characteristic
* The characteristic
*
* @return BLE_ERROR_NONE if the connection and handle are found. false otherwise.
*/
virtual ble_error_t areUpdatesEnabled(Gap::Handle_t connectionHandle, const GattCharacteristic &characteristic, bool *enabledP) {
return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */
}
/**
* A virtual function to allow underlying stacks to indicate if they support
* onDataRead(). It should be overridden to return true as applicable.