High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 265:a0504765a357, committed 2015-01-21
- Comitter:
- rgrover1
- Date:
- Wed Jan 21 09:32:50 2015 +0000
- Parent:
- 264:eea11cfb6753
- Child:
- 266:698e7d095195
- Commit message:
- Synchronized with git rev 4426616b
Author: Marcus Chang
Added optional data and length fields to the return struct for authorized reads so a new value can be provided for each individual authorization.
Changed in this revision
--- a/public/GattCharacteristic.h Wed Jan 21 09:32:50 2015 +0000 +++ b/public/GattCharacteristic.h Wed Jan 21 09:32:50 2015 +0000 @@ -383,7 +383,17 @@ /** * Helper function meant to be called from the guts of the BLE stack to * determine the authorization reply for a read request. - * @param params to capture the context of the read-auth request; and also contains an out-parameter for reply. + * @param params to capture the context of the read-auth request. + * + * @NOTE: To authorize/deny the read the params->authorizationReply field + * should be set to true/false. + * + * If the read is approved and params->data is unchanged (NULL), + * the current characteristic value will be used. + * + * If the read is approved, a new value can be provided by setting + * the params->data pointer and params->len fields. + * * @return true if the read is authorized to proceed. */ bool authorizeRead(GattCharacteristicReadAuthCBParams *params) {
--- a/public/GattCharacteristicCallbackParams.h Wed Jan 21 09:32:50 2015 +0000 +++ b/public/GattCharacteristicCallbackParams.h Wed Jan 21 09:32:50 2015 +0000 @@ -44,7 +44,9 @@ struct GattCharacteristicReadAuthCBParams { GattAttribute::Handle_t charHandle; - uint16_t offset; /**< Offset for the write operation. */ + uint16_t offset; /**< Offset for the read operation. */ + uint16_t len; /**< Optional: new length of the outgoing data. */ + uint8_t *data; /**< Optional: new outgoing data. Leave at NULL if data is unchanged. */ bool authorizationReply; /* This is the out parameter which needs to be set to true by the callback if the * request is to proceed; false otherwise. */ };