File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1029,14 +1029,13 @@ bool NimBLEDevice::init(const std::string& deviceName) {
10291029bool NimBLEDevice::deinit (bool clearAll) {
10301030 int rc = 0 ;
10311031 if (m_initialized) {
1032- # if MYNEWT_VAL(BLE_ROLE_OBSERVER)
1033- if (NimBLEDevice::m_pScan != nullptr ) {
1034- NimBLEDevice::m_pScan->onHostDeinit ();
1035- }
1036- # endif
1037-
10381032 rc = nimble_port_stop ();
10391033 if (rc == 0 ) {
1034+ # if MYNEWT_VAL(BLE_ROLE_OBSERVER)
1035+ if (NimBLEDevice::m_pScan != nullptr ) {
1036+ NimBLEDevice::m_pScan->onHostDeinit ();
1037+ }
1038+ # endif
10401039 nimble_port_deinit ();
10411040# ifndef USING_NIMBLE_ARDUINO_HEADERS
10421041# if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
@@ -1048,6 +1047,9 @@ bool NimBLEDevice::deinit(bool clearAll) {
10481047# endif
10491048 m_initialized = false ;
10501049 m_synced = false ;
1050+ } else {
1051+ NIMBLE_LOGE (LOG_TAG , " nimble_port_stop() failed with error: %d" , rc);
1052+ return false ;
10511053 }
10521054 }
10531055
You can’t perform that action at this time.
0 commit comments