Skip to content

fix: Add ArmFailSafe to IP Commissioning Path#9

Merged
tom-code merged 1 commit into
tom-code:mainfrom
skoky:arm_failsafe_fix
May 23, 2026
Merged

fix: Add ArmFailSafe to IP Commissioning Path#9
tom-code merged 1 commit into
tom-code:mainfrom
skoky:arm_failsafe_fix

Conversation

@skoky
Copy link
Copy Markdown
Contributor

@skoky skoky commented May 23, 2026

Please consider this AI generated patch. I has solved my issue with matter bridge commissioning.

Fix: Add ArmFailSafe to IP Commissioning Path

Problem

When commissioning a Matter device over IP (Ethernet/Wi-Fi), the matc controller
skipped the mandatory ArmFailSafe command. The Matter specification requires
ArmFailSafe to be sent before CSRRequest to open a commissioning window on
the device side.

As a result, bridges and devices implementing the spec strictly (such as rs-matter)
rejected the CSRRequest with status code 0xCA (IMStatusCode::FailSafeRequired,
decimal 202), causing commissioning to fail immediately.

The arm_failsafe function and its associated constant
CMD_GENERAL_COMMISSIONING_ARMFAILSAFE existed in the codebase but were gated
behind #[cfg(feature = "ble")], making them unavailable for the standard IP path.

Fix

  • Removed the #[cfg(feature = "ble")] guard from CMD_GENERAL_COMMISSIONING_ARMFAILSAFE
    and from the arm_failsafe async function, making both available unconditionally.
  • Added an arm_failsafe call as the first step inside commission(), before
    send_csr. A 60-second timeout is requested, which is the standard value used
    during commissioning.
  • Shifted all subsequent exchange IDs by +1 (using wrapping_add) to avoid reusing
    the exchange ID consumed by ArmFailSafe.

@tom-code tom-code merged commit 54d92d3 into tom-code:main May 23, 2026
1 of 2 checks passed
@tom-code
Copy link
Copy Markdown
Owner

it looks ok. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants