Skip to content

Commit

Permalink
Allow device does not support any method for rendezvous (#27557)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored and pull[bot] committed Dec 18, 2023
1 parent adf16f2 commit 1159602
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class OnboardingPayload(
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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ private fun generateBitSet(
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)
Expand Down

0 comments on commit 1159602

Please sign in to comment.