diff --git a/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml index c49fa087fa6917..584da5b79fce65 100644 --- a/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml @@ -93,19 +93,18 @@ limitations under the License. This event SHALL be generated when the message is confirmed by the user, or when the expiration date of the message is reached. - + This event SHALL be generated when the message is presented to the user. - + This event SHALL be generated when the message is confirmed by the user, or when the expiration date of the message is reached. - - - - - + + + + \ No newline at end of file diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 1b872e0e88a8bc..efc6dce2023e95 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4432,10 +4432,9 @@ provisional cluster Messages = 151 { info event MessageComplete = 2 { octet_string messageID = 0; - epoch_s timestamp = 2; - nullable int32u responseID = 3; - nullable long_char_string reply = 4; - nullable FutureMessagePreferenceEnum futureMessagesPref = 5; + optional nullable int32u responseID = 1; + optional nullable char_string reply = 2; + nullable FutureMessagePreferenceEnum futureMessagesPreference = 3; } readonly attribute MessageStruct messages[] = 0; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 7babb2df863344..b759822df155b5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -3854,37 +3854,32 @@ public String toString() { } public static class MessagesClusterMessageCompleteEvent { public byte[] messageID; - public Long timestamp; - public @Nullable Long responseID; - public @Nullable String reply; - public @Nullable Integer futureMessagesPref; + public @Nullable Optional responseID; + public @Nullable Optional reply; + public @Nullable Integer futureMessagesPreference; private static final long MESSAGE_I_D_ID = 0L; - private static final long TIMESTAMP_ID = 2L; - private static final long RESPONSE_I_D_ID = 3L; - private static final long REPLY_ID = 4L; - private static final long FUTURE_MESSAGES_PREF_ID = 5L; + private static final long RESPONSE_I_D_ID = 1L; + private static final long REPLY_ID = 2L; + private static final long FUTURE_MESSAGES_PREFERENCE_ID = 3L; public MessagesClusterMessageCompleteEvent( byte[] messageID, - Long timestamp, - @Nullable Long responseID, - @Nullable String reply, - @Nullable Integer futureMessagesPref + @Nullable Optional responseID, + @Nullable Optional reply, + @Nullable Integer futureMessagesPreference ) { this.messageID = messageID; - this.timestamp = timestamp; this.responseID = responseID; this.reply = reply; - this.futureMessagesPref = futureMessagesPref; + this.futureMessagesPreference = futureMessagesPreference; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); values.add(new StructElement(MESSAGE_I_D_ID, new ByteArrayType(messageID))); - values.add(new StructElement(TIMESTAMP_ID, new UIntType(timestamp))); - values.add(new StructElement(RESPONSE_I_D_ID, responseID != null ? new UIntType(responseID) : new NullType())); - values.add(new StructElement(REPLY_ID, reply != null ? new StringType(reply) : new NullType())); - values.add(new StructElement(FUTURE_MESSAGES_PREF_ID, futureMessagesPref != null ? new UIntType(futureMessagesPref) : new NullType())); + values.add(new StructElement(RESPONSE_I_D_ID, responseID != null ? responseID.map((nonOptionalresponseID) -> new UIntType(nonOptionalresponseID)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(REPLY_ID, reply != null ? reply.map((nonOptionalreply) -> new StringType(nonOptionalreply)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(FUTURE_MESSAGES_PREFERENCE_ID, futureMessagesPreference != null ? new UIntType(futureMessagesPreference) : new NullType())); return new StructType(values); } @@ -3894,44 +3889,37 @@ public static MessagesClusterMessageCompleteEvent decodeTlv(BaseTLVType tlvValue return null; } byte[] messageID = null; - Long timestamp = null; - @Nullable Long responseID = null; - @Nullable String reply = null; - @Nullable Integer futureMessagesPref = null; + @Nullable Optional responseID = null; + @Nullable Optional reply = null; + @Nullable Integer futureMessagesPreference = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == MESSAGE_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { ByteArrayType castingValue = element.value(ByteArrayType.class); messageID = castingValue.value(byte[].class); } - } else if (element.contextTagNum() == TIMESTAMP_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - timestamp = castingValue.value(Long.class); - } } else if (element.contextTagNum() == RESPONSE_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - responseID = castingValue.value(Long.class); + responseID = Optional.of(castingValue.value(Long.class)); } } else if (element.contextTagNum() == REPLY_ID) { if (element.value(BaseTLVType.class).type() == TLVType.String) { StringType castingValue = element.value(StringType.class); - reply = castingValue.value(String.class); + reply = Optional.of(castingValue.value(String.class)); } - } else if (element.contextTagNum() == FUTURE_MESSAGES_PREF_ID) { + } else if (element.contextTagNum() == FUTURE_MESSAGES_PREFERENCE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - futureMessagesPref = castingValue.value(Integer.class); + futureMessagesPreference = castingValue.value(Integer.class); } } } return new MessagesClusterMessageCompleteEvent( messageID, - timestamp, responseID, reply, - futureMessagesPref + futureMessagesPreference ); } @@ -3942,17 +3930,14 @@ public String toString() { output.append("\tmessageID: "); output.append(Arrays.toString(messageID)); output.append("\n"); - output.append("\ttimestamp: "); - output.append(timestamp); - output.append("\n"); output.append("\tresponseID: "); output.append(responseID); output.append("\n"); output.append("\treply: "); output.append(reply); output.append("\n"); - output.append("\tfutureMessagesPref: "); - output.append(futureMessagesPref); + output.append("\tfutureMessagesPreference: "); + output.append(futureMessagesPreference); output.append("\n"); output.append("}\n"); return output.toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt index 93947bf4277976..d885f26d3d9b8b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader @@ -24,18 +25,16 @@ import matter.tlv.TlvWriter class MessagesClusterMessageCompleteEvent( val messageID: ByteArray, - val timestamp: ULong, - val responseID: ULong?, - val reply: String?, - val futureMessagesPref: UInt? + val responseID: Optional?, + val reply: Optional?, + val futureMessagesPreference: UInt? ) { override fun toString(): String = buildString { append("MessagesClusterMessageCompleteEvent {\n") append("\tmessageID : $messageID\n") - append("\ttimestamp : $timestamp\n") append("\tresponseID : $responseID\n") append("\treply : $reply\n") - append("\tfutureMessagesPref : $futureMessagesPref\n") + append("\tfutureMessagesPreference : $futureMessagesPreference\n") append("}\n") } @@ -43,21 +42,26 @@ class MessagesClusterMessageCompleteEvent( tlvWriter.apply { startStructure(tlvTag) put(ContextSpecificTag(TAG_MESSAGE_I_D), messageID) - put(ContextSpecificTag(TAG_TIMESTAMP), timestamp) if (responseID != null) { - put(ContextSpecificTag(TAG_RESPONSE_I_D), responseID) + if (responseID.isPresent) { + val optresponseID = responseID.get() + put(ContextSpecificTag(TAG_RESPONSE_I_D), optresponseID) + } } else { putNull(ContextSpecificTag(TAG_RESPONSE_I_D)) } if (reply != null) { - put(ContextSpecificTag(TAG_REPLY), reply) + if (reply.isPresent) { + val optreply = reply.get() + put(ContextSpecificTag(TAG_REPLY), optreply) + } } else { putNull(ContextSpecificTag(TAG_REPLY)) } - if (futureMessagesPref != null) { - put(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF), futureMessagesPref) + if (futureMessagesPreference != null) { + put(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE), futureMessagesPreference) } else { - putNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF)) + putNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE)) } endStructure() } @@ -65,34 +69,40 @@ class MessagesClusterMessageCompleteEvent( companion object { private const val TAG_MESSAGE_I_D = 0 - private const val TAG_TIMESTAMP = 2 - private const val TAG_RESPONSE_I_D = 3 - private const val TAG_REPLY = 4 - private const val TAG_FUTURE_MESSAGES_PREF = 5 + private const val TAG_RESPONSE_I_D = 1 + private const val TAG_REPLY = 2 + private const val TAG_FUTURE_MESSAGES_PREFERENCE = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MessagesClusterMessageCompleteEvent { tlvReader.enterStructure(tlvTag) val messageID = tlvReader.getByteArray(ContextSpecificTag(TAG_MESSAGE_I_D)) - val timestamp = tlvReader.getULong(ContextSpecificTag(TAG_TIMESTAMP)) val responseID = if (!tlvReader.isNull()) { - tlvReader.getULong(ContextSpecificTag(TAG_RESPONSE_I_D)) + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RESPONSE_I_D))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_RESPONSE_I_D))) + } else { + Optional.empty() + } } else { tlvReader.getNull(ContextSpecificTag(TAG_RESPONSE_I_D)) null } val reply = if (!tlvReader.isNull()) { - tlvReader.getString(ContextSpecificTag(TAG_REPLY)) + if (tlvReader.isNextTag(ContextSpecificTag(TAG_REPLY))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_REPLY))) + } else { + Optional.empty() + } } else { tlvReader.getNull(ContextSpecificTag(TAG_REPLY)) null } - val futureMessagesPref = + val futureMessagesPreference = if (!tlvReader.isNull()) { - tlvReader.getUInt(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF)) + tlvReader.getUInt(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE)) } else { - tlvReader.getNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF)) + tlvReader.getNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE)) null } @@ -100,10 +110,9 @@ class MessagesClusterMessageCompleteEvent( return MessagesClusterMessageCompleteEvent( messageID, - timestamp, responseID, reply, - futureMessagesPref + futureMessagesPreference ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt index 2dc5450e204269..4c30c4ec20bd82 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/MessagesClusterMessageCompleteEvent.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.eventstructs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -24,18 +25,16 @@ import matter.tlv.TlvWriter class MessagesClusterMessageCompleteEvent( val messageID: ByteArray, - val timestamp: UInt, - val responseID: UInt?, - val reply: String?, - val futureMessagesPref: UByte? + val responseID: Optional?, + val reply: Optional?, + val futureMessagesPreference: UByte? ) { override fun toString(): String = buildString { append("MessagesClusterMessageCompleteEvent {\n") append("\tmessageID : $messageID\n") - append("\ttimestamp : $timestamp\n") append("\tresponseID : $responseID\n") append("\treply : $reply\n") - append("\tfutureMessagesPref : $futureMessagesPref\n") + append("\tfutureMessagesPreference : $futureMessagesPreference\n") append("}\n") } @@ -43,21 +42,26 @@ class MessagesClusterMessageCompleteEvent( tlvWriter.apply { startStructure(tlvTag) put(ContextSpecificTag(TAG_MESSAGE_I_D), messageID) - put(ContextSpecificTag(TAG_TIMESTAMP), timestamp) if (responseID != null) { - put(ContextSpecificTag(TAG_RESPONSE_I_D), responseID) + if (responseID.isPresent) { + val optresponseID = responseID.get() + put(ContextSpecificTag(TAG_RESPONSE_I_D), optresponseID) + } } else { putNull(ContextSpecificTag(TAG_RESPONSE_I_D)) } if (reply != null) { - put(ContextSpecificTag(TAG_REPLY), reply) + if (reply.isPresent) { + val optreply = reply.get() + put(ContextSpecificTag(TAG_REPLY), optreply) + } } else { putNull(ContextSpecificTag(TAG_REPLY)) } - if (futureMessagesPref != null) { - put(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF), futureMessagesPref) + if (futureMessagesPreference != null) { + put(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE), futureMessagesPreference) } else { - putNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF)) + putNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE)) } endStructure() } @@ -65,34 +69,40 @@ class MessagesClusterMessageCompleteEvent( companion object { private const val TAG_MESSAGE_I_D = 0 - private const val TAG_TIMESTAMP = 2 - private const val TAG_RESPONSE_I_D = 3 - private const val TAG_REPLY = 4 - private const val TAG_FUTURE_MESSAGES_PREF = 5 + private const val TAG_RESPONSE_I_D = 1 + private const val TAG_REPLY = 2 + private const val TAG_FUTURE_MESSAGES_PREFERENCE = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MessagesClusterMessageCompleteEvent { tlvReader.enterStructure(tlvTag) val messageID = tlvReader.getByteArray(ContextSpecificTag(TAG_MESSAGE_I_D)) - val timestamp = tlvReader.getUInt(ContextSpecificTag(TAG_TIMESTAMP)) val responseID = if (!tlvReader.isNull()) { - tlvReader.getUInt(ContextSpecificTag(TAG_RESPONSE_I_D)) + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RESPONSE_I_D))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_RESPONSE_I_D))) + } else { + Optional.empty() + } } else { tlvReader.getNull(ContextSpecificTag(TAG_RESPONSE_I_D)) null } val reply = if (!tlvReader.isNull()) { - tlvReader.getString(ContextSpecificTag(TAG_REPLY)) + if (tlvReader.isNextTag(ContextSpecificTag(TAG_REPLY))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_REPLY))) + } else { + Optional.empty() + } } else { tlvReader.getNull(ContextSpecificTag(TAG_REPLY)) null } - val futureMessagesPref = + val futureMessagesPreference = if (!tlvReader.isNull()) { - tlvReader.getUByte(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF)) + tlvReader.getUByte(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE)) } else { - tlvReader.getNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREF)) + tlvReader.getNull(ContextSpecificTag(TAG_FUTURE_MESSAGES_PREFERENCE)) null } @@ -100,10 +110,9 @@ class MessagesClusterMessageCompleteEvent( return MessagesClusterMessageCompleteEvent( messageID, - timestamp, responseID, reply, - futureMessagesPref + futureMessagesPreference ) } } diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index eb0fe817b12727..4795647b3e242f 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5217,51 +5217,63 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & reinterpret_cast(cppValue.messageID.data())); value_messageID = value_messageIDByteArray; - jobject value_timestamp; - std::string value_timestampClassName = "java/lang/Long"; - std::string value_timestampCtorSignature = "(J)V"; - jlong jnivalue_timestamp = static_cast(cppValue.timestamp); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_timestampClassName.c_str(), value_timestampCtorSignature.c_str(), jnivalue_timestamp, value_timestamp); - jobject value_responseID; - if (cppValue.responseID.IsNull()) + if (!cppValue.responseID.HasValue()) { - value_responseID = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_responseID); } else { - std::string value_responseIDClassName = "java/lang/Long"; - std::string value_responseIDCtorSignature = "(J)V"; - jlong jnivalue_responseID = static_cast(cppValue.responseID.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(value_responseIDClassName.c_str(), - value_responseIDCtorSignature.c_str(), - jnivalue_responseID, value_responseID); + jobject value_responseIDInsideOptional; + if (cppValue.responseID.Value().IsNull()) + { + value_responseIDInsideOptional = nullptr; + } + else + { + std::string value_responseIDInsideOptionalClassName = "java/lang/Long"; + std::string value_responseIDInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_responseIDInsideOptional = static_cast(cppValue.responseID.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_responseIDInsideOptionalClassName.c_str(), value_responseIDInsideOptionalCtorSignature.c_str(), + jnivalue_responseIDInsideOptional, value_responseIDInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_responseIDInsideOptional, value_responseID); } jobject value_reply; - if (cppValue.reply.IsNull()) + if (!cppValue.reply.HasValue()) { - value_reply = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_reply); } else { - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.reply.Value(), value_reply)); + jobject value_replyInsideOptional; + if (cppValue.reply.Value().IsNull()) + { + value_replyInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.reply.Value().Value(), + value_replyInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(value_replyInsideOptional, value_reply); } - jobject value_futureMessagesPref; - if (cppValue.futureMessagesPref.IsNull()) + jobject value_futureMessagesPreference; + if (cppValue.futureMessagesPreference.IsNull()) { - value_futureMessagesPref = nullptr; + value_futureMessagesPreference = nullptr; } else { - std::string value_futureMessagesPrefClassName = "java/lang/Integer"; - std::string value_futureMessagesPrefCtorSignature = "(I)V"; - jint jnivalue_futureMessagesPref = static_cast(cppValue.futureMessagesPref.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(value_futureMessagesPrefClassName.c_str(), - value_futureMessagesPrefCtorSignature.c_str(), - jnivalue_futureMessagesPref, value_futureMessagesPref); + std::string value_futureMessagesPreferenceClassName = "java/lang/Integer"; + std::string value_futureMessagesPreferenceCtorSignature = "(I)V"; + jint jnivalue_futureMessagesPreference = static_cast(cppValue.futureMessagesPreference.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_futureMessagesPreferenceClassName.c_str(), value_futureMessagesPreferenceCtorSignature.c_str(), + jnivalue_futureMessagesPreference, value_futureMessagesPreference); } jclass messageCompleteStructClass; @@ -5274,17 +5286,17 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jmethodID messageCompleteStructCtor; - err = chip::JniReferences::GetInstance().FindMethod( - env, messageCompleteStructClass, "", - "([BLjava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V", &messageCompleteStructCtor); + err = chip::JniReferences::GetInstance().FindMethod(env, messageCompleteStructClass, "", + "([BLjava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", + &messageCompleteStructCtor); if (err != CHIP_NO_ERROR || messageCompleteStructCtor == nullptr) { ChipLogError(Zcl, "Could not find ChipEventStructs$MessagesClusterMessageCompleteEvent constructor"); return nullptr; } - jobject value = env->NewObject(messageCompleteStructClass, messageCompleteStructCtor, value_messageID, value_timestamp, - value_responseID, value_reply, value_futureMessagesPref); + jobject value = env->NewObject(messageCompleteStructClass, messageCompleteStructCtor, value_messageID, value_responseID, + value_reply, value_futureMessagesPreference); return value; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ebbbfc92253e65..a47de3ff5ef7e2 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -23475,17 +23475,15 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="messageID", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="timestamp", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="responseID", Tag=3, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="reply", Tag=4, Type=typing.Union[Nullable, str]), - ClusterObjectFieldDescriptor(Label="futureMessagesPref", Tag=5, Type=typing.Union[Nullable, Messages.Enums.FutureMessagePreferenceEnum]), + ClusterObjectFieldDescriptor(Label="responseID", Tag=1, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="reply", Tag=2, Type=typing.Union[None, Nullable, str]), + ClusterObjectFieldDescriptor(Label="futureMessagesPreference", Tag=3, Type=typing.Union[Nullable, Messages.Enums.FutureMessagePreferenceEnum]), ]) messageID: 'bytes' = b"" - timestamp: 'uint' = 0 - responseID: 'typing.Union[Nullable, uint]' = NullValue - reply: 'typing.Union[Nullable, str]' = NullValue - futureMessagesPref: 'typing.Union[Nullable, Messages.Enums.FutureMessagePreferenceEnum]' = NullValue + responseID: 'typing.Union[None, Nullable, uint]' = None + reply: 'typing.Union[None, Nullable, str]' = None + futureMessagesPreference: 'typing.Union[Nullable, Messages.Enums.FutureMessagePreferenceEnum]' = NullValue @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 90f052746d7ddf..431d29dac94ef3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2842,42 +2842,45 @@ static id _Nullable DecodeEventPayloadForMessagesCluster(EventId aEventId, TLV:: memberValue = AsData(cppValue.messageID); value.messageID = memberValue; } while (0); - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedInt:cppValue.timestamp]; - value.timestamp = memberValue; - } while (0); do { NSNumber * _Nullable memberValue; - if (cppValue.responseID.IsNull()) { - memberValue = nil; + if (cppValue.responseID.HasValue()) { + if (cppValue.responseID.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.responseID.Value().Value()]; + } } else { - memberValue = [NSNumber numberWithUnsignedInt:cppValue.responseID.Value()]; + memberValue = nil; } value.responseID = memberValue; } while (0); do { NSString * _Nullable memberValue; - if (cppValue.reply.IsNull()) { - memberValue = nil; - } else { - memberValue = AsString(cppValue.reply.Value()); - if (memberValue == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + if (cppValue.reply.HasValue()) { + if (cppValue.reply.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = AsString(cppValue.reply.Value().Value()); + if (memberValue == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } } + } else { + memberValue = nil; } value.reply = memberValue; } while (0); do { NSNumber * _Nullable memberValue; - if (cppValue.futureMessagesPref.IsNull()) { + if (cppValue.futureMessagesPreference.IsNull()) { memberValue = nil; } else { - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.futureMessagesPref.Value())]; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.futureMessagesPreference.Value())]; } - value.futureMessagesPref = memberValue; + value.futureMessagesPreference = memberValue; } while (0); return value; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 7088f5192e1f9c..4f6a558800e46d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1218,10 +1218,9 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRMessagesClusterMessageCompleteEvent : NSObject @property (nonatomic, copy) NSData * _Nonnull messageID MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull timestamp MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable responseID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSString * _Nullable reply MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable futureMessagesPref MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable futureMessagesPreference MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 2bea9be776cfb3..c2528ddf0e227e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -4952,13 +4952,11 @@ - (instancetype)init _messageID = [NSData data]; - _timestamp = @(0); - _responseID = nil; _reply = nil; - _futureMessagesPref = nil; + _futureMessagesPreference = nil; } return self; } @@ -4968,17 +4966,16 @@ - (id)copyWithZone:(NSZone * _Nullable)zone auto other = [[MTRMessagesClusterMessageCompleteEvent alloc] init]; other.messageID = self.messageID; - other.timestamp = self.timestamp; other.responseID = self.responseID; other.reply = self.reply; - other.futureMessagesPref = self.futureMessagesPref; + other.futureMessagesPreference = self.futureMessagesPreference; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: messageID:%@; timestamp:%@; responseID:%@; reply:%@; futureMessagesPref:%@; >", NSStringFromClass([self class]), [_messageID base64EncodedStringWithOptions:0], _timestamp, _responseID, _reply, _futureMessagesPref]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: messageID:%@; responseID:%@; reply:%@; futureMessagesPreference:%@; >", NSStringFromClass([self class]), [_messageID base64EncodedStringWithOptions:0], _responseID, _reply, _futureMessagesPreference]; return descriptionString; } 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 58eb01287c7c43..d402dc9b205aa3 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 @@ -15154,10 +15154,9 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const TLV::TLVType outer; ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMessageID), messageID)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kTimestamp), timestamp)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kResponseID), responseID)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReply), reply)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFutureMessagesPref), futureMessagesPref)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFutureMessagesPreference), futureMessagesPreference)); return aWriter.EndContainer(outer); } @@ -15179,10 +15178,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, messageID); } - else if (__context_tag == to_underlying(Fields::kTimestamp)) - { - err = DataModel::Decode(reader, timestamp); - } else if (__context_tag == to_underlying(Fields::kResponseID)) { err = DataModel::Decode(reader, responseID); @@ -15191,9 +15186,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, reply); } - else if (__context_tag == to_underlying(Fields::kFutureMessagesPref)) + else if (__context_tag == to_underlying(Fields::kFutureMessagesPreference)) { - err = DataModel::Decode(reader, futureMessagesPref); + err = DataModel::Decode(reader, futureMessagesPreference); } 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 d3dcf4929e935b..a9ea1c015bfb77 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 @@ -21330,11 +21330,10 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields : uint8_t { - kMessageID = 0, - kTimestamp = 2, - kResponseID = 3, - kReply = 4, - kFutureMessagesPref = 5, + kMessageID = 0, + kResponseID = 1, + kReply = 2, + kFutureMessagesPreference = 3, }; struct Type @@ -21346,10 +21345,9 @@ struct Type static constexpr bool kIsFabricScoped = false; chip::ByteSpan messageID; - uint32_t timestamp = static_cast(0); - DataModel::Nullable responseID; - DataModel::Nullable reply; - DataModel::Nullable futureMessagesPref; + Optional> responseID; + Optional> reply; + DataModel::Nullable futureMessagesPreference; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; @@ -21362,10 +21360,9 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::Messages::Id; } chip::ByteSpan messageID; - uint32_t timestamp = static_cast(0); - DataModel::Nullable responseID; - DataModel::Nullable reply; - DataModel::Nullable futureMessagesPref; + Optional> responseID; + Optional> reply; + DataModel::Nullable futureMessagesPreference; CHIP_ERROR Decode(TLV::TLVReader & reader); }; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 8c6411b390797a..770181972ebe22 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6162,14 +6162,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } - { - CHIP_ERROR err = DataModelLogger::LogValue("Timestamp", indent + 1, value.timestamp); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Timestamp'"); - return err; - } - } { CHIP_ERROR err = DataModelLogger::LogValue("ResponseID", indent + 1, value.responseID); if (err != CHIP_NO_ERROR) @@ -6187,10 +6179,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = DataModelLogger::LogValue("FutureMessagesPref", indent + 1, value.futureMessagesPref); + CHIP_ERROR err = DataModelLogger::LogValue("FutureMessagesPreference", indent + 1, value.futureMessagesPreference); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FutureMessagesPref'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FutureMessagesPreference'"); return err; } }