HW layer for the Nucleo board, it only work with old BLE_API

Dependents:   Hello_BLE F446RE-BLE

Fork of X_NUCLEO_IDB0XA1 by ST

Revision:
36:f3d80a236beb
Parent:
35:c4e176e085ec
Child:
41:95b8d531628c
--- a/BlueNRGGap.cpp	Mon Aug 25 12:32:22 2014 +0000
+++ b/BlueNRGGap.cpp	Mon Aug 25 12:36:48 2014 +0000
@@ -305,6 +305,7 @@
 {
     tBleStatus ret;
     
+    if(state.advertising == 1) {
     //Set non-discoverable to stop advertising
     ret = aci_gap_set_non_discoverable();
     
@@ -316,6 +317,7 @@
     DEBUG("Advertisement stopped!!\n\r") ;
     //Set GapState_t::advertising state
     state.advertising = 0;
+    }
     
     return BLE_ERROR_NONE;
 }
@@ -341,7 +343,7 @@
     tBleStatus ret;
     //For Reason codes check BlueTooth HCI Spec
     
-    if(m_connectionHandle != BLE_CONN_HANDLE_INVALID)
+    if(m_connectionHandle != BLE_CONN_HANDLE_INVALID) {
         ret = aci_gap_terminate(m_connectionHandle, 0x16);//0x16 Connection Terminated by Local Host. 
 
     if (ret != BLE_STATUS_SUCCESS){
@@ -352,6 +354,7 @@
     
     //DEBUG("Disconnected from localhost!!\n\r") ;
     m_connectionHandle = BLE_CONN_HANDLE_INVALID;
+    }
     
     return BLE_ERROR_NONE;
 }