From 6a5d142f0386c24b48f6dc17585e17537d4184e7 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Fri, 14 Aug 2015 09:04:18 +0100 Subject: [PATCH] initialize the member authorizationReply when posting authorization callbacks to the application. This is a nice-to-do. --- source/nRF5xGattServer.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/source/nRF5xGattServer.cpp b/source/nRF5xGattServer.cpp index 82168a5..d5e7151 100644 --- a/source/nRF5xGattServer.cpp +++ b/source/nRF5xGattServer.cpp @@ -392,6 +392,9 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt) .offset = gattsEventP->params.authorize_request.request.write.offset, .len = gattsEventP->params.authorize_request.request.write.len, .data = gattsEventP->params.authorize_request.request.write.data, + .authorizationReply = AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member + * set to AUTH_CALLBACK_REPLY_SUCCESS if the client + * request is to proceed. */ }; ble_gatts_rw_authorize_reply_params_t reply = { .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE, @@ -425,11 +428,14 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt) } case GattServerEvents::GATT_EVENT_READ_AUTHORIZATION_REQ: { GattReadAuthCallbackParams cbParams = { - .connHandle = gattsEventP->conn_handle, - .handle = handle_value, - .offset = gattsEventP->params.authorize_request.request.read.offset, - .len = 0, - .data = NULL + .connHandle = gattsEventP->conn_handle, + .handle = handle_value, + .offset = gattsEventP->params.authorize_request.request.read.offset, + .len = 0, + .data = NULL, + .authorizationReply = AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member + * set to AUTH_CALLBACK_REPLY_SUCCESS if the client + * request is to proceed. */ }; ble_gatts_rw_authorize_reply_params_t reply = {