-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DevicePairingDelegate::OnPairingComplete is not called if pairing code is wrong #36139
base: master
Are you sure you want to change the base?
Fix DevicePairingDelegate::OnPairingComplete is not called if pairing code is wrong #36139
Conversation
Review changes with SemanticDiff. |
Evgeny Trushkin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
PR #36139: Size comparison from 2574847 to 9607577 Full report (79 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
mPairingDelegate->OnPairingComplete(status); | ||
} | ||
} | ||
if (CHIP_NO_ERROR != status && mPairingDelegate != nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual behavior here is very complicated (e.g. if your pairing code is right but the device is not advertising that's the same situation as wrong pairing code!), and worse yet existing clients depend on it, so probably cannot be changed without breaking lots of shipping software.
The right answer here is that we should have a sane error reporting API, not what we have right now, but we should be extremely careful about any changes to the existing behavior.
Only the
DevicePairingDelegate::OnStatusUpdate(Status::SecurePairingFailed)
callback will be called in case of pairing device with wrong manual code. The signature of OnStatusUpdate() does not include CHIP_ERROR.Seems that the correct behavior is to call DevicePairingDelegate::OnPairingComplete(error) as well.
Error will likely hold
CHIP Error 0x00000032: Timeout
.This way looking at
OnPairingComplete
,OnCommissioningSuccess
andOnCommissioningFailure
is enough to keep track on commissioning process. And all of them provide CHIP_ERROR for diagnostics.