From 0c218cc4f75f68d14f082938c9ac3af6a5e28a41 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 20 Dec 2023 11:09:26 -0500 Subject: [PATCH] MTRSetupPayload initWithSetupPasscode should not produce invalid payloads. It's using a long discriminator, so has to have discovery capabilities available. Fixes https://github.com/project-chip/connectedhomeip/issues/31129 --- src/darwin/Framework/CHIP/MTRSetupPayload.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index adfeb7cd3a9ac4..d7b08c7c0a44a4 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -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;