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 nRF51822 by
Revision 92:8c1553b39b03, committed 2015-01-21
- Comitter:
- rgrover1
- Date:
- Wed Jan 21 10:01:16 2015 +0000
- Parent:
- 91:112921e467db
- Child:
- 93:0e7a9efee6d7
- Commit message:
- Synchronized with git rev d24bfdb5
Author: Rohit Grover
When the write-authorization attribute is enabled for a characteristic, AUTHORIZATION_REQ event (if replied with true) is *not* followed by another DATA_WRITTEN event; so we still need to invoke handleDataWritten().
Changed in this revision
| nRF51GattServer.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/nRF51GattServer.cpp Wed Jan 21 10:01:16 2015 +0000
+++ b/nRF51GattServer.cpp Wed Jan 21 10:01:16 2015 +0000
@@ -335,6 +335,24 @@
}
};
sd_ble_gatts_rw_authorize_reply(gattsEventP->conn_handle, &reply);
+
+ /*
+ * If write-authorization is enabled for a characteristic,
+ * AUTHORIZATION_REQ event (if replied with true) is *not*
+ * followed by another DATA_WRITTEN event; so we still need
+ * to invoke handleDataWritten(), much the same as we would
+ * have done if write-authorization had not been enabled.
+ */
+ if (reply.params.write.gatt_status == BLE_GATT_STATUS_SUCCESS) {
+ GattCharacteristicWriteCBParams cbParams = {
+ .charHandle = i,
+ .op = static_cast<GattCharacteristicWriteCBParams::Type>(gattsEventP->params.authorize_request.request.write.op),
+ .offset = gattsEventP->params.authorize_request.request.write.offset,
+ .len = gattsEventP->params.authorize_request.request.write.len,
+ .data = gattsEventP->params.authorize_request.request.write.data,
+ };
+ handleDataWrittenEvent(&cbParams);
+ }
break;
}
case GattServerEvents::GATT_EVENT_READ_AUTHORIZATION_REQ: {
