From 3248278d485409bd17aacc011cfa6a2a2051f509 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 11 Jan 2022 21:24:29 -0500 Subject: [PATCH] CommissioneeDeviceProxy fix. (#13482) Added a review comment fix, but the logic is not correct due to an early exit on the load function. This didn't show up when testing because the python tool caches the proxy and doesn't need to re-look up the pairing. --- src/controller/CommissioneeDeviceProxy.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controller/CommissioneeDeviceProxy.cpp b/src/controller/CommissioneeDeviceProxy.cpp index 024a7c5167d8f9..74b0231e3a7401 100644 --- a/src/controller/CommissioneeDeviceProxy.cpp +++ b/src/controller/CommissioneeDeviceProxy.cpp @@ -138,11 +138,12 @@ CHIP_ERROR CommissioneeDeviceProxy::SetConnected() { return CHIP_ERROR_INCORRECT_STATE; } + mState = ConnectionState::SecureConnected; bool _didLoad; CHIP_ERROR err = LoadSecureSessionParametersIfNeeded(_didLoad); - if (err == CHIP_NO_ERROR) + if (err != CHIP_NO_ERROR) { - mState = ConnectionState::SecureConnected; + mState = ConnectionState::NotConnected; } return err; }