From f0d521f04c892259189bd71349265fa67cc93edd Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Mon, 2 Nov 2015 17:04:47 +0000 Subject: [PATCH] Ensure that the initialization flags is set to false if the BLE stack is shutdown properly. --- source/nRF5xn.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/nRF5xn.cpp b/source/nRF5xn.cpp index de7e707..d505753 100644 --- a/source/nRF5xn.cpp +++ b/source/nRF5xn.cpp @@ -104,7 +104,12 @@ ble_error_t nRF5xn::shutdown(void) return BLE_ERROR_INITIALIZATION_INCOMPLETE; } - return (softdevice_handler_sd_disable() == NRF_SUCCESS) ? BLE_ERROR_NONE : BLE_STACK_BUSY; + if(softdevice_handler_sd_disable() != NRF_SUCCESS) { + return BLE_STACK_BUSY; + } + + initialized = false; + return BLE_ERROR_NONE; } void