From 8e9f997d1deb7552aef52ab9b80bf418b3238def Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 17 Oct 2022 14:15:27 -0400 Subject: [PATCH] Mark event paths as urgent when doing node-wide subscriptions in Matter.framework. (#23226) Otherwise we will not receive events until the max-interval elapses. --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 2 ++ src/darwin/Framework/CHIP/MTRDevice.mm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 0a2a0083d0f34f..222fd80fc891d7 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -294,6 +294,8 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue // Wildcard endpoint, cluster, attribute, event. auto attributePath = std::make_unique(); auto eventPath = std::make_unique(); + // We want to get event reports at the minInterval, not the maxInterval. + eventPath->mIsUrgentEvent = true; ReadPrepareParams readParams(session.Value()); readParams.mMinIntervalFloorSeconds = minInterval; readParams.mMaxIntervalCeilingSeconds = maxInterval; diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 9cea81ca5120a6..486b5bac17fb69 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -299,6 +299,8 @@ - (void)subscribeWithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)max // Wildcard endpoint, cluster, attribute, event. auto attributePath = std::make_unique(); auto eventPath = std::make_unique(); + // We want to get event reports at the minInterval, not the maxInterval. + eventPath->mIsUrgentEvent = true; ReadPrepareParams readParams(session.Value()); readParams.mMinIntervalFloorSeconds = minInterval; readParams.mMaxIntervalCeilingSeconds = maxInterval;