From 1cb1a49752a90f6ba6307086cc2caad22e687ceb Mon Sep 17 00:00:00 2001 From: Desmond Chen Date: Tue, 18 Dec 2018 15:20:52 -0800 Subject: [PATCH] Fix BLE long write execution failure --- .../TARGET_NRF51/source/nRF5xGattServer.cpp | 1 + .../TARGET_NRF52/source/nRF5xGattServer.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.cpp index 4963145059..619e199896 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.cpp @@ -664,6 +664,7 @@ void nRF5xGattServer::hwCallback(const ble_evt_t *p_ble_evt) * set to AUTH_CALLBACK_REPLY_SUCCESS if the client * request is to proceed. */ }; + characteristicIndex = resolveValueHandleToCharIndex(req->attr_handle); uint16_t write_authorization = p_characteristics[characteristicIndex]->authorizeWrite(&cbParams); // the user code didn't provide the write authorization, diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.cpp index 8c93ac118c..821ee59e54 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.cpp @@ -670,6 +670,7 @@ void nRF5xGattServer::hwCallback(const ble_evt_t *p_ble_evt) * set to AUTH_CALLBACK_REPLY_SUCCESS if the client * request is to proceed. */ }; + characteristicIndex = resolveValueHandleToCharIndex(req->attr_handle); uint16_t write_authorization = p_characteristics[characteristicIndex]->authorizeWrite(&cbParams); // the user code didn't provide the write authorization,