Skip to content

Commit

Permalink
[nrfconnect] Fixed light switch example build (#20099)
Browse files Browse the repository at this point in the history
Light switch build was broken due to Disconnect() API changes.

Fixed BindingHandler implementation to not expect Disconnect()
to return CHIP_ERROR.
  • Loading branch information
kkasperczyk-no authored and pull[bot] committed Jul 9, 2022
1 parent fb40c73 commit c00aa41
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/light-switch-app/nrfconnect/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<void *>(data));

if (CHIP_NO_ERROR != error)
{
LOG_ERR("NotifyBoundClusterChanged failed due to: %" CHIP_ERROR_FORMAT, error.Format());
return;
}
}
else
{
Expand Down

0 comments on commit c00aa41

Please sign in to comment.