From 37af39c2012971daca6d9ee7291ee7c201ddee77 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Mon, 20 May 2024 16:06:21 +0200 Subject: [PATCH 1/3] Fix compilation with functions instrumentation (#33504) --- src/app/CommandHandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 89ff52f9669d2e..86ef22ab886212 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -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 From 6bd80b080eff659ceb3b77e5eb08992b69be505e Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Mon, 20 May 2024 10:43:55 -0700 Subject: [PATCH 2/3] Updating min subscription time for darwin to 10 minutes (#33522) --- src/darwin/Framework/CHIP/MTRDevice.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 61dbc643f5ccd1..4fca9139b87d2c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -682,7 +682,7 @@ - (void)_setDSTOffsets:(NSArray #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)delegate queue:(dispatch_queue_t)queue From b77979afdf984ca8be952258ad279d9afafd23f0 Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Tue, 21 May 2024 13:05:50 +0900 Subject: [PATCH 3/3] [Android] Fix QR Code parsing about vendor info (#33486) * Fix QR Code parsing about vendor info * Update kotlin codestyle --- .../setuppayloadscanner/CHIPDeviceDetailsFragment.kt | 1 - .../chiptool/setuppayloadscanner/CHIPDeviceInfo.kt | 12 ++++++++++-- .../main/res/layout/chip_device_info_fragment.xml | 6 +++--- .../QRCodeBasicOnboardingPayloadGenerator.kt | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt index ea131c0e726bcb..411f51eae3de73 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceDetailsFragment.kt @@ -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 diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt index 28cfaa11f162c6..b2afd8a9985474 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPDeviceInfo.kt @@ -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 @@ -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 } @@ -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, diff --git a/examples/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml b/examples/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml index 4997681993ca29..a1deab648adc9f 100644 --- a/examples/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml +++ b/examples/android/CHIPTool/app/src/main/res/layout/chip_device_info_fragment.xml @@ -151,7 +151,7 @@ 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"/> + android:textSize="12sp"/> diff --git a/src/controller/java/src/matter/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt b/src/controller/java/src/matter/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt index a51fd8367be335..853b3308953afd 100644 --- a/src/controller/java/src/matter/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt +++ b/src/controller/java/src/matter/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt @@ -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) } }