From c971f2531863dbb2307974a6057f96323356ddc9 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk <66371704+kkasperczyk-no@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:45:46 +0200 Subject: [PATCH] [nrfconnect] Fixed light switch example build (#20099) Light switch build was broken due to Disconnect() API changes. Fixed BindingHandler implementation to not expect Disconnect() to return CHIP_ERROR. --- .../nrfconnect/main/BindingHandler.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp b/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp index 678e48df31b674..2d36217681dda0 100644 --- a/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp +++ b/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp @@ -46,13 +46,7 @@ void BindingHandler::OnInvokeCommandFailure(DeviceProxy * aDevice, BindingData & return; // Release current CASE session. - error = aDevice->Disconnect(); - - if (CHIP_NO_ERROR != error) - { - LOG_ERR("Disconnecting from CASE session failed due to: %" CHIP_ERROR_FORMAT, error.Format()); - return; - } + aDevice->Disconnect(); // Set flag to not try recover session multiple times. BindingHandler::GetInstance().mCaseSessionRecovered = true; @@ -64,6 +58,12 @@ void BindingHandler::OnInvokeCommandFailure(DeviceProxy * aDevice, BindingData & // Establish new CASE session and retrasmit command that was not applied. error = BindingManager::GetInstance().NotifyBoundClusterChanged(aBindingData.EndpointId, aBindingData.ClusterId, static_cast(data)); + + if (CHIP_NO_ERROR != error) + { + LOG_ERR("NotifyBoundClusterChanged failed due to: %" CHIP_ERROR_FORMAT, error.Format()); + return; + } } else {