Skip to content

Commit

Permalink
MTRSetupPayload initWithSetupPasscode should not produce invalid payl…
Browse files Browse the repository at this point in the history
…oads. (#31132)

It's using a long discriminator, so has to have discovery capabilities
available.

Fixes #31129
  • Loading branch information
bzbarsky-apple authored Dec 22, 2023
1 parent ab58186 commit d0d95d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/darwin/Framework/CHIP/MTRSetupPayload.mm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ - (instancetype)initWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(N
_vendorID = @(0); // Not available.
_productID = @(0); // Not available.
_commissioningFlow = MTRCommissioningFlowStandard;
_discoveryCapabilities = MTRDiscoveryCapabilitiesUnknown;
// We are using a long discriminator, so have to have a known
// discoveryCapabilities to be a valid payload. Just default to "try
// all discovery methods".
_discoveryCapabilities = MTRDiscoveryCapabilitiesAllMask;
_hasShortDiscriminator = NO;
_discriminator = discriminator;
_setupPasscode = setupPasscode;
Expand Down

0 comments on commit d0d95d3

Please sign in to comment.