pub struct SetupPayload {
pub version: u8,
pub vendor_id: Option<u16>,
pub product_id: Option<u16>,
pub commissioning_flow: CommissioningFlow,
pub discovery_capabilities: DiscoveryCapabilities,
pub discriminator: Discriminator,
pub passcode: Passcode,
}Expand description
The decoded contents of a Matter onboarding payload (QR code or manual pairing code), as defined in Matter Core Spec §5.1.3.
Roundtrip identities:
// For every valid `p` produced by M6.1:
assert_eq!(parse_qr(&encode_qr(&p)?)?, p);
assert_eq!(parse_manual_code(&encode_manual_code(&p)), p); // see caveat belowThe manual-code roundtrip preserves the upper four bits of the
discriminator (the short discriminator) and zero-extends the rest.
A SetupPayload decoded from a manual code therefore has a
discriminator whose lower 8 bits are zero, regardless of what the
physical device’s long discriminator actually is. Callers matching
against mDNS records should compare on the short discriminator in
that case.
Fields§
§version: u8Onboarding payload version. Currently always 0 (Matter Core
Spec §5.1.3.1 Table 39). Reserved for future use.
vendor_id: Option<u16>Vendor ID. None if the source was an 11-digit manual code,
which does not carry VID/PID.
product_id: Option<u16>Product ID. Pair with vendor_id — both are Some or both
None.
commissioning_flow: CommissioningFlowCommissioning flow indicator.
discovery_capabilities: DiscoveryCapabilitiesBitmask of discovery transports the device supports while commissionable. Always present in QR codes; manual codes do not carry this field and decode it as the empty set.
discriminator: Discriminator12-bit Long Discriminator. See the type-level rustdoc for the manual-code caveat.
passcode: Passcode27-bit passcode.
Trait Implementations§
Source§impl Clone for SetupPayload
impl Clone for SetupPayload
Source§fn clone(&self) -> SetupPayload
fn clone(&self) -> SetupPayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more