Allow device does not support any method for rendezvous (#27557)
diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt
index 9005e5b..a82ee3f 100644
--- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt
+++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt
@@ -182,8 +182,8 @@
DiscoveryCapability.SOFT_AP
)
- // If discoveryCapabilities is empty or discoveryCapabilities contains values outside of allValid
- if (discoveryCapabilities.isEmpty() || discoveryCapabilities.any { it !in allValid }) {
+ // If discoveryCapabilities is not empty and discoveryCapabilities contains values outside of allValid
+ if (!discoveryCapabilities.isEmpty() && discoveryCapabilities.any { it !in allValid }) {
return false
}
diff --git a/src/controller/java/src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt b/src/controller/java/src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt
index 8429e4b..7772bc5 100644
--- a/src/controller/java/src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt
+++ b/src/controller/java/src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt
@@ -90,10 +90,6 @@
populateBits(bits, offset, payload.vendorId.toLong(), kVendorIDFieldLengthInBits, kTotalPayloadDataSizeInBits)
populateBits(bits, offset, payload.productId.toLong(), kProductIDFieldLengthInBits, kTotalPayloadDataSizeInBits)
populateBits(bits, offset, payload.commissioningFlow.toLong(), kCommissioningFlowFieldLengthInBits, kTotalPayloadDataSizeInBits)
-
- if (payload.discoveryCapabilities.isEmpty())
- throw OnboardingPayloadException("Invalid argument")
-
populateBits(bits, offset, payload.getRendezvousInformation(), kRendezvousInfoFieldLengthInBits, kTotalPayloadDataSizeInBits)
populateBits(bits, offset, payload.discriminator.toLong(), kPayloadDiscriminatorFieldLengthInBits, kTotalPayloadDataSizeInBits)
populateBits(bits, offset, payload.setupPinCode, kSetupPINCodeFieldLengthInBits, kTotalPayloadDataSizeInBits)