Expand description
Setup payload parsing and encoding for Matter QR codes and manual pairing codes (Matter Core Spec §5.1).
This is Milestone 6 phase 1 of the matter-rust roadmap. See
docs/superpowers/specs/2026-05-22-matter-commissioning-setup-payload-design.md
for design rationale and docs/superpowers/specs/2026-05-22-matter-commissioning-design.md
for the M6 umbrella.
§Phase status
- M6.1 (this revision): QR-code and manual-pairing-code codec, no
vendor TLV (deferred to a later phase).
SetupPayloadis the canonical in-memory representation.
Structs§
- Discovery
Capabilities - Matter Core Spec §5.1.3.1 Table 39 “Discovery Capabilities” — the 8-bit bitmask advertising which discovery transports the device supports while commissionable.
- Discriminator
- Twelve-bit long discriminator identifying a Matter device while it is commissionable (Matter Core Spec §5.1.2.2).
- Passcode
- 27-bit Matter setup passcode (Matter Core Spec §5.1.7).
- Setup
Payload - The decoded contents of a Matter onboarding payload (QR code or manual pairing code), as defined in Matter Core Spec §5.1.3.
Enums§
- Commissioning
Flow - Commissioning flow indicator from Matter Core Spec §5.1.3.1 Table 39.
- Error
- Errors from setup-payload parsing and encoding.
Constants§
- DISALLOWED_
PASSCODES - Disallowed-trivial passcode values from Matter Core Spec §5.1.7.1.
- MAX_
PASSCODE - Largest valid Matter setup passcode (Core Spec §5.1.7.1: the passcode SHALL
be in
1..=99_999_998). The QR/manual-code wire field is 27 bits wide, but values in99_999_999..=0x07FF_FFFFare not valid passcodes — every spec-compliant commissioner (chip-tool, Apple/Google Home, …) rejects a setup code that carries one.
Functions§
- encode_
manual_ code - Encode a
SetupPayloadas a manual pairing code (Matter Core Spec §5.1.4). - encode_
qr - Encode a
SetupPayloadas a Matter QR string (Matter Core Spec §5.1.3.1). - parse_
manual_ code - Parse a Matter manual pairing code (11 or 21 digits).
- parse_
qr - Parse a Matter QR string into a
SetupPayload.
Type Aliases§
- Result
- Convenience alias for
Result<T, Error>inside the setup module.