diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 5cc4c47092ba77..a3a313d1c41b70 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -2704,6 +2704,7 @@ cluster BridgedDeviceBasicInformation = 57 { request struct KeepActiveRequest { int32u stayActiveDuration = 0; + int32u timeoutMs = 1; } /** The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. */ diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index cee95d2d1cfa7a..e1920f474f61bc 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2661,6 +2661,7 @@ cluster BridgedDeviceBasicInformation = 57 { request struct KeepActiveRequest { int32u stayActiveDuration = 0; + int32u timeoutMs = 1; } /** The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. */ diff --git a/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml b/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml index b33ccb740f9a54..ef2629c3574701 100644 --- a/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml +++ b/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml @@ -97,7 +97,8 @@ limitations under the License. The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. - + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 6fa99d2558bf0f..e9615e98f9c90a 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2587,6 +2587,7 @@ cluster BridgedDeviceBasicInformation = 57 { request struct KeepActiveRequest { int32u stayActiveDuration = 0; + int32u timeoutMs = 1; } /** The server SHALL attempt to keep the devices specified active for StayActiveDuration milliseconds when they are next active. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index cf344db593f46a..5d932a2510945b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -15197,11 +15197,11 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration) { - keepActive(callback, stayActiveDuration, 0); + public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration, Long timeoutMs) { + keepActive(callback, stayActiveDuration, timeoutMs, 0); } - public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration, int timedInvokeTimeoutMs) { + public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration, Long timeoutMs, int timedInvokeTimeoutMs) { final long commandId = 128L; ArrayList elements = new ArrayList<>(); @@ -15209,6 +15209,10 @@ public void keepActive(DefaultClusterCallback callback, Long stayActiveDuration, BaseTLVType stayActiveDurationtlvValue = new UIntType(stayActiveDuration); elements.add(new StructElement(stayActiveDurationFieldID, stayActiveDurationtlvValue)); + final long timeoutMsFieldID = 1L; + BaseTLVType timeoutMstlvValue = new UIntType(timeoutMs); + elements.add(new StructElement(timeoutMsFieldID, timeoutMstlvValue)); + StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 30f064babb1fa5..063fe951e3e12b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -4543,7 +4543,7 @@ public static Command value(long id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum KeepActiveCommandField {StayActiveDuration(0),; + }public enum KeepActiveCommandField {StayActiveDuration(0),TimeoutMs(1),; private final int id; KeepActiveCommandField(int id) { this.id = id; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index f58ac0f6e47798..e6e78c35935abf 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -24443,12 +24443,17 @@ public Map> getCommandMap() { CommandParameterInfo bridgedDeviceBasicInformationkeepActivestayActiveDurationCommandParameterInfo = new CommandParameterInfo("stayActiveDuration", Long.class, Long.class); bridgedDeviceBasicInformationkeepActiveCommandParams.put("stayActiveDuration",bridgedDeviceBasicInformationkeepActivestayActiveDurationCommandParameterInfo); + + CommandParameterInfo bridgedDeviceBasicInformationkeepActivetimeoutMsCommandParameterInfo = new CommandParameterInfo("timeoutMs", Long.class, Long.class); + bridgedDeviceBasicInformationkeepActiveCommandParams.put("timeoutMs",bridgedDeviceBasicInformationkeepActivetimeoutMsCommandParameterInfo); InteractionInfo bridgedDeviceBasicInformationkeepActiveInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicInformationCluster) cluster) .keepActive((DefaultClusterCallback) callback , (Long) commandArguments.get("stayActiveDuration") + , (Long) + commandArguments.get("timeoutMs") ); }, () -> new DelegatedDefaultClusterCallback(), diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt index 8e56362d8da349..9ae253f277ed10 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt @@ -101,7 +101,11 @@ class BridgedDeviceBasicInformationCluster( object SubscriptionEstablished : AttributeListAttributeSubscriptionState() } - suspend fun keepActive(stayActiveDuration: UInt, timedInvokeTimeout: Duration? = null) { + suspend fun keepActive( + stayActiveDuration: UInt, + timeoutMs: UInt, + timedInvokeTimeout: Duration? = null, + ) { val commandId: UInt = 128u val tlvWriter = TlvWriter() @@ -109,6 +113,9 @@ class BridgedDeviceBasicInformationCluster( val TAG_STAY_ACTIVE_DURATION_REQ: Int = 0 tlvWriter.put(ContextSpecificTag(TAG_STAY_ACTIVE_DURATION_REQ), stayActiveDuration) + + val TAG_TIMEOUT_MS_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_TIMEOUT_MS_REQ), timeoutMs) tlvWriter.endStructure() val request: InvokeRequest = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 028810afd4eb77..38a8146f25a655 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3302,6 +3302,7 @@ class ChipClusters: "commandName": "KeepActive", "args": { "stayActiveDuration": "int", + "timeoutMs": "int", }, }, }, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ecd84b76523bce..3b121afb95307c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -12168,9 +12168,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="stayActiveDuration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="timeoutMs", Tag=1, Type=uint), ]) stayActiveDuration: 'uint' = 0 + timeoutMs: 'uint' = 0 class Attributes: @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index a5934b16975260..95b3675d94e0ae 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -3019,6 +3019,8 @@ MTR_PROVISIONALLY_AVAILABLE @interface MTRBridgedDeviceBasicInformationClusterKeepActiveParams : NSObject @property (nonatomic, copy) NSNumber * _Nonnull stayActiveDuration MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull timeoutMs MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 5ae975508e9b75..00dc34a9a37ee6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -7934,6 +7934,8 @@ - (instancetype)init if (self = [super init]) { _stayActiveDuration = @(0); + + _timeoutMs = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -7945,6 +7947,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; auto other = [[MTRBridgedDeviceBasicInformationClusterKeepActiveParams alloc] init]; other.stayActiveDuration = self.stayActiveDuration; + other.timeoutMs = self.timeoutMs; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -7953,7 +7956,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: stayActiveDuration:%@; >", NSStringFromClass([self class]), _stayActiveDuration]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: stayActiveDuration:%@; timeoutMs:%@; >", NSStringFromClass([self class]), _stayActiveDuration, _timeoutMs]; return descriptionString; } @@ -7968,6 +7971,9 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { encodableStruct.stayActiveDuration = self.stayActiveDuration.unsignedIntValue; } + { + encodableStruct.timeoutMs = self.timeoutMs.unsignedIntValue; + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 84a4c6da19a641..ebe45c86ed8406 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -8227,6 +8227,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; encoder.Encode(to_underlying(Fields::kStayActiveDuration), stayActiveDuration); + encoder.Encode(to_underlying(Fields::kTimeoutMs), timeoutMs); return encoder.Finalize(); } @@ -8248,6 +8249,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, stayActiveDuration); } + else if (__context_tag == to_underlying(Fields::kTimeoutMs)) + { + err = DataModel::Decode(reader, timeoutMs); + } else { } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 0fe76db4e0fd6e..35f77bf4895d3d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -11089,6 +11089,7 @@ namespace KeepActive { enum class Fields : uint8_t { kStayActiveDuration = 0, + kTimeoutMs = 1, }; struct Type @@ -11099,6 +11100,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasicInformation::Id; } uint32_t stayActiveDuration = static_cast(0); + uint32_t timeoutMs = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -11114,6 +11116,7 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasicInformation::Id; } uint32_t stayActiveDuration = static_cast(0); + uint32_t timeoutMs = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace KeepActive diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index f6f5f81644a9ef..a4f8cb7298bbf9 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -3528,6 +3528,7 @@ class BridgedDeviceBasicInformationKeepActive : public ClusterCommand ClusterCommand("keep-active", credsIssuerConfig) { AddArgument("StayActiveDuration", 0, UINT32_MAX, &mRequest.stayActiveDuration); + AddArgument("TimeoutMs", 0, UINT32_MAX, &mRequest.timeoutMs); ClusterCommand::AddArguments(); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b9105c44f3769d..9c139bebe8881a 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -40189,6 +40189,9 @@ class BridgedDeviceBasicInformationKeepActive : public ClusterCommand { { #if MTR_ENABLE_PROVISIONAL AddArgument("StayActiveDuration", 0, UINT32_MAX, &mRequest.stayActiveDuration); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TimeoutMs", 0, UINT32_MAX, &mRequest.timeoutMs); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -40206,6 +40209,9 @@ class BridgedDeviceBasicInformationKeepActive : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL params.stayActiveDuration = [NSNumber numberWithUnsignedInt:mRequest.stayActiveDuration]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.timeoutMs = [NSNumber numberWithUnsignedInt:mRequest.timeoutMs]; #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount;