Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Jan 11, 2022
1 parent a4b0aaa commit d110ac7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/controller/CommissioneeDeviceProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,17 @@ CHIP_ERROR CommissioneeDeviceProxy::UpdateDeviceData(const Transport::PeerAddres

CHIP_ERROR CommissioneeDeviceProxy::SetConnected()
{
mState = ConnectionState::SecureConnected;
bool didLoad;
return LoadSecureSessionParametersIfNeeded(didLoad);
if (mState != ConnectionState::Connecting)
{
return CHIP_ERROR_INCORRECT_STATE;
}
bool _didLoad;
CHIP_ERROR err = LoadSecureSessionParametersIfNeeded(_didLoad);
if (err == CHIP_NO_ERROR)
{
mState = ConnectionState::SecureConnected;
}
return err;
}

void CommissioneeDeviceProxy::Reset()
Expand Down
2 changes: 1 addition & 1 deletion src/controller/CommissioneeDeviceProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class CommissioneeDeviceProxy : public DeviceProxy, public SessionReleaseDelegat

/**
* @brief
* Should be called when the pairing completes.
* Called to indicate this proxy has been paired successfully.
*
* This causes the secure session parameters to be loaded and stores the session details in the session manager.
*/
Expand Down

0 comments on commit d110ac7

Please sign in to comment.