diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 7b3eec0a6b96da..d342a47202df9c 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -105,7 +105,7 @@ void CommissioningWindowManager::OnSessionEstablishmentError(CHIP_ERROR err) ChipLogError(AppServer, "Commissioning failed (attempt %d): %s", mFailedCommissioningAttempts, ErrorStr(err)); #if CONFIG_NETWORK_LAYER_BLE - mServer->getBleLayerObject()->mBleEndPoint->ReleaseBleConnection(); + mServer->GetBleLayerObject()->CloseAllBleConnections(); #endif if (mFailedCommissioningAttempts < kMaxFailedCommissioningAttempts) { diff --git a/src/app/server/Server.h b/src/app/server/Server.h index 161fa579233459..e370eb57403dab 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -81,7 +81,7 @@ class Server TransportMgrBase & GetTransportManager() { return mTransports; } #if CONFIG_NETWORK_LAYER_BLE - Ble::BleLayer * getBleLayerObject() { return mBleLayer; } + Ble::BleLayer * GetBleLayerObject() { return mBleLayer; } #endif CommissioningWindowManager & GetCommissioningWindowManager() { return mCommissioningWindowManager; } diff --git a/src/ble/BLEEndPoint.h b/src/ble/BLEEndPoint.h index e5ed0232ce769a..feee860ecbd7a3 100644 --- a/src/ble/BLEEndPoint.h +++ b/src/ble/BLEEndPoint.h @@ -107,7 +107,6 @@ class DLL_EXPORT BLEEndPoint bool ConnectionObjectIs(BLE_CONNECTION_OBJECT connObj) { return connObj == mConnObj; } void Close(); void Abort(); - void ReleaseBleConnection(); private: BleLayer * mBle; ///< [READ-ONLY] Pointer to the BleLayer object that owns this object. @@ -224,6 +223,7 @@ class DLL_EXPORT BLEEndPoint // Close functions: void DoCloseCallback(uint8_t state, uint8_t flags, CHIP_ERROR err); void FinalizeClose(uint8_t state, uint8_t flags, CHIP_ERROR err); + void ReleaseBleConnection(); void Free(); void FreeBtpEngine(); diff --git a/src/ble/BleLayer.cpp b/src/ble/BleLayer.cpp index e927e99df7f7fb..50cf13ebe3e242 100644 --- a/src/ble/BleLayer.cpp +++ b/src/ble/BleLayer.cpp @@ -288,7 +288,6 @@ CHIP_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleConnectionD #if CHIP_ENABLE_CHIPOBLE_TEST mTestBleEndPoint = NULL; #endif - mBleEndPoint = NULL; return CHIP_NO_ERROR; } @@ -427,7 +426,6 @@ CHIP_ERROR BleLayer::NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_O #if CHIP_ENABLE_CHIPOBLE_TEST mTestBleEndPoint = *retEndPoint; #endif - mBleEndPoint = *retEndPoint; return CHIP_NO_ERROR; } diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index cbef971029a463..c7e21482efa059 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -320,8 +320,6 @@ class DLL_EXPORT BleLayer BLEEndPoint * mTestBleEndPoint; #endif - BLEEndPoint * mBleEndPoint; - private: // Private data members: diff --git a/src/transport/raw/BLE.h b/src/transport/raw/BLE.h index 070b3bf67a72fe..d54ecc2454d586 100644 --- a/src/transport/raw/BLE.h +++ b/src/transport/raw/BLE.h @@ -91,8 +91,6 @@ class DLL_EXPORT BLEBase : public Base, public Ble::BleLayerDelegate CHIP_ERROR SetEndPoint(Ble::BLEEndPoint * endPoint) override; - Ble::BLEEndPoint * GetEndPoint() { return mBleEndPoint; } - private: void ClearState();