Skip to content

Commit

Permalink
Merge branch 'master' into feature/basic-app-install-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov authored May 21, 2024
2 parents af2d200 + b77979a commit 18750a0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class CHIPDeviceDetailsFragment : Fragment() {
binding.discriminatorEd.setText(deviceInfo.discriminator.toString())
binding.serialNumberEd.setText(deviceInfo.serialNumber)
binding.discoveryCapabilitiesTv.text = "${deviceInfo.discoveryCapabilities}"

if (deviceInfo.optionalQrCodeInfoMap.isEmpty()) {
binding.vendorTagsLabelTv.visibility = View.GONE
binding.vendorTagsContainer.visibility = View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import kotlinx.parcelize.Parcelize
import matter.onboardingpayload.DiscoveryCapability
import matter.onboardingpayload.OnboardingPayload
import matter.onboardingpayload.OnboardingPayloadException
import matter.onboardingpayload.OptionalQRCodeInfoType

/** Class to hold the CHIP device information. */
@Parcelize
Expand Down Expand Up @@ -57,6 +58,13 @@ data class CHIPDeviceInfo(
if (serialNumber.isNotEmpty()) {
onboardingPayload.addSerialNumber(serialNumber)
}
optionalQrCodeInfoMap.forEach { (_, info) ->
if (info.type == OptionalQRCodeInfoType.TYPE_STRING && info.data != null) {
onboardingPayload.addOptionalVendorData(info.tag, info.data)
} else {
onboardingPayload.addOptionalVendorData(info.tag, info.intDataValue)
}
}
return onboardingPayload
}

Expand All @@ -78,8 +86,8 @@ data class CHIPDeviceInfo(
setupPayload.getLongDiscriminatorValue(),
setupPayload.setupPinCode,
setupPayload.commissioningFlow,
setupPayload.optionalQRCodeInfo.mapValues { (_, info) ->
QrCodeInfo(info.tag, info.type, info.data, info.int32)
setupPayload.getAllOptionalVendorData().associate { info ->
info.tag to QrCodeInfo(info.tag, info.type, info.data, info.int32)
},
setupPayload.discoveryCapabilities,
setupPayload.hasShortDiscriminator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_below="@id/vendorTagsLabelTv"
android:layout_below="@id/vendorTagsContainer"
android:layout_alignParentStart="true"
android:textSize="20sp"/>
<EditText
android:id="@+id/discoveryCapabilitiesEd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_below="@id/vendorTagsLabelTv"
android:layout_below="@id/vendorTagsContainer"
android:layout_toEndOf="@id/discoveryCapabilitiesLabelTv"
android:layout_alignParentEnd="true"
android:textSize="11sp"
Expand Down Expand Up @@ -260,6 +260,6 @@
android:layout_below="@id/showQRCodeUriBtn"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:textSize="20sp"/>
android:textSize="12sp"/>
</RelativeLayout>
</ScrollView>
3 changes: 2 additions & 1 deletion src/app/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,8 @@ CHIP_ERROR TestOnlyExtractCommandPathFromNextInvokeRequest(TLV::TLVReader & invo
case CommandHandler::NlFaultInjectionType::SkipSecondResponse:
return "Single InvokeResponseMessages. Dropping response to second request";
}
VerifyOrDieWithMsg(false, DataManagement, "TH Failure: Unexpected fault type");
ChipLogError(DataManagement, "TH Failure: Unexpected fault type");
chipAbort();
}

} // anonymous namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,6 @@ private fun populateTLVBits(

for (i in 0 until tlvBufSizeInBytes) {
val value = tlvBuf[i]
populateBits(bits, offset, value.toLong(), 8, totalPayloadDataSizeInBits)
populateBits(bits, offset, value.toUByte().toLong(), 8, totalPayloadDataSizeInBits)
}
}
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ - (void)_setDSTOffsets:(NSArray<MTRTimeSynchronizationClusterDSTOffsetStruct *>
#pragma mark Subscription and delegate handling

// subscription intervals are in seconds
#define MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MIN (1 * 60) // 1 minute (for now)
#define MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MIN (10 * 60) // 10 minutes (for now)
#define MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MAX (60 * 60) // 60 minutes

- (void)setDelegate:(id<MTRDeviceDelegate>)delegate queue:(dispatch_queue_t)queue
Expand Down

0 comments on commit 18750a0

Please sign in to comment.