You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Controller] Preserve granular commissioning-failure context in CompletionStatus (#72228)
* Preserve granular commissioning-failure context in CompletionStatus
Today OnCommissioningFailure collapses several distinguishable failure
modes into a single CHIP_ERROR, leaving controllers unable to
disambiguate without parsing logs. This change threads structured
failure context through the commissioning pipeline so consumers can
branch on the device-reported cause.
DevicePairingDelegate:
- New OnCommissioningFailure(PeerId, const CompletionStatus &) overload
whose default implementation forwards to the legacy 4-arg form.
Existing subclasses keep working unchanged.
CompletionStatus widened with optional structured fields:
- commissioningError - GeneralCommissioning::CommissioningErrorEnum
- networkCommissioningStatus + connectNetworkErrorValue
- operationalCertStatus - NodeOperationalCertStatusEnum from NOCResponse
- commissioningDebugText, networkCommissioningDebugText - owned
std::string copies of device-supplied debug text
Three report variants updated to carry the additional data:
- CommissioningErrorInfo gains std::string debugText
- NetworkCommissioningStatusInfo gains std::string debugText +
Optional<int32_t> connectNetworkErrorValue
- New OperationalCertErrorInfo carrying the cert-status enum
AutoCommissioner::CommissioningStepFinished populates CompletionStatus
from these report variants on the failure path.
CHIPDeviceController response handlers populate the corresponding
reports: OnArmFailSafe, OnSetRegulatoryConfigResponse,
OnSetTCAcknowledgementsResponse, OnCommissioningCompleteResponse,
OnOperationalCertificateAddResponse, OnConnectNetworkResponse,
OnNetworkConfigResponse.
PASESession:
- OnFailureStatusReport maps kProtocolCodeNoSharedRoot to
CHIP_ERROR_NO_SHARED_TRUSTED_ROOT (PASE has no shared-root semantics,
so a peer sending this is misconfigured, but the mapping is more
useful than CHIP_ERROR_INTERNAL).
- OnFailureStatusReport maps kProtocolCodeBusy to CHIP_ERROR_BUSY
(uncommon in PASE but not spec-forbidden).
Backward compatibility:
- New OnCommissioningFailure overload defaults to forwarding to the
legacy 4-arg form. Existing subclasses keep compiling and running.
- All new fields on CompletionStatus are Optional or std::string with
empty as the absence marker.
- No public API removed.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments