From e9ac83a92c36a92ac6fc51518b798827c3632ed6 Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Fri, 2 Oct 2020 16:14:20 +0100 Subject: [PATCH] reset transport last and reset the default chars in gatt server --- .../source/cordio/source/BLEInstanceBaseImpl.cpp | 6 +++--- .../FEATURE_BLE/source/cordio/source/GattServerImpl.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.cpp b/connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.cpp index 48df9f9b1ca..f8010ef3905 100644 --- a/connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.cpp +++ b/connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.cpp @@ -171,9 +171,6 @@ ble_error_t BLEInstanceBase::shutdown() return BLE_ERROR_INITIALIZATION_INCOMPLETE; } - initialization_status = NOT_INITIALIZED; - _hci_driver->terminate(); - #if BLE_FEATURE_GATT_SERVER getGattServer().reset(); #endif @@ -185,6 +182,9 @@ ble_error_t BLEInstanceBase::shutdown() getGap().reset(); _event_queue.clear(); + initialization_status = NOT_INITIALIZED; + _hci_driver->terminate(); + return BLE_ERROR_NONE; } diff --git a/connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp b/connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp index a7ca14d5674..c72524ebba7 100644 --- a/connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp +++ b/connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp @@ -883,6 +883,7 @@ ble_error_t GattServer::reset(ble::GattServer* server) serviceCount = 0; characteristicCount = 0; + default_services_added = false; dataSentCallChain.clear(); dataWrittenCallChain.clear();