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 ee6d996bc09d4d..cb328e6b731bdf 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 @@ -51,7 +51,8 @@ limitations under the License. - + + @@ -83,7 +84,7 @@ limitations under the License. Command for requesting messages be presented - + @@ -93,11 +94,11 @@ 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. diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 99f8b708da7e8c..6bb5dfd91f8461 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4411,7 +4411,7 @@ provisional cluster Messages = 151 { optional char_string<32> label = 1; } - fabric_scoped struct MessageStruct { + struct MessageStruct { octet_string<16> messageID = 0; MessagePriorityEnum priority = 1; MessageControlBitmap messageControl = 2; @@ -4419,7 +4419,6 @@ provisional cluster Messages = 151 { nullable int16u duration = 4; char_string<256> messageText = 5; optional MessageResponseOptionStruct responses[] = 6; - fabric_idx fabricIndex = 254; } info event MessageQueued = 0 { @@ -4447,7 +4446,7 @@ provisional cluster Messages = 151 { readonly attribute int16u clusterRevision = 65533; request struct PresentMessagesRequestRequest { - octet_string messages[] = 0; + MessageStruct messages[] = 0; } request struct CancelMessagesRequestRequest { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index ede6acf09d2c2e..52a94e9d49865d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -29208,16 +29208,16 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList messages) { + public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList messages) { presentMessagesRequest(callback, messages, 0); } - public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList messages, int timedInvokeTimeoutMs) { + public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList messages, int timedInvokeTimeoutMs) { final long commandId = 0L; ArrayList elements = new ArrayList<>(); final long messagesFieldID = 0L; - BaseTLVType messagestlvValue = ArrayType.generateArrayType(messages, (elementmessages) -> new ByteArrayType(elementmessages)); + BaseTLVType messagestlvValue = ArrayType.generateArrayType(messages, (elementmessages) -> elementmessages.encodeTlv()); elements.add(new StructElement(messagesFieldID, messagestlvValue)); StructType value = new StructType(elements); @@ -29274,11 +29274,6 @@ public interface AttributeListAttributeCallback extends BaseAttributeCallback { public void readMessagesAttribute( MessagesAttributeCallback callback) { - readMessagesAttributeWithFabricFilter(callback, true); - } - - public void readMessagesAttributeWithFabricFilter( - MessagesAttributeCallback callback, boolean isFabricFiltered) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MESSAGES_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @@ -29287,7 +29282,7 @@ public void onSuccess(byte[] tlv) { List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MESSAGES_ATTRIBUTE_ID, isFabricFiltered); + }, MESSAGES_ATTRIBUTE_ID, true); } public void writeMessagesAttribute(DefaultClusterCallback callback, ArrayList value) { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 3ceabf0609c868..cfc67037e90260 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -6528,7 +6528,6 @@ public static class MessagesClusterMessageStruct { public @Nullable Integer duration; public String messageText; public Optional> responses; - public Integer fabricIndex; private static final long MESSAGE_I_D_ID = 0L; private static final long PRIORITY_ID = 1L; private static final long MESSAGE_CONTROL_ID = 2L; @@ -6536,7 +6535,6 @@ public static class MessagesClusterMessageStruct { private static final long DURATION_ID = 4L; private static final long MESSAGE_TEXT_ID = 5L; private static final long RESPONSES_ID = 6L; - private static final long FABRIC_INDEX_ID = 254L; public MessagesClusterMessageStruct( byte[] messageID, @@ -6545,8 +6543,7 @@ public MessagesClusterMessageStruct( @Nullable Long startTime, @Nullable Integer duration, String messageText, - Optional> responses, - Integer fabricIndex + Optional> responses ) { this.messageID = messageID; this.priority = priority; @@ -6555,7 +6552,6 @@ public MessagesClusterMessageStruct( this.duration = duration; this.messageText = messageText; this.responses = responses; - this.fabricIndex = fabricIndex; } public StructType encodeTlv() { @@ -6567,7 +6563,6 @@ public StructType encodeTlv() { values.add(new StructElement(DURATION_ID, duration != null ? new UIntType(duration) : new NullType())); values.add(new StructElement(MESSAGE_TEXT_ID, new StringType(messageText))); values.add(new StructElement(RESPONSES_ID, responses.map((nonOptionalresponses) -> ArrayType.generateArrayType(nonOptionalresponses, (elementnonOptionalresponses) -> elementnonOptionalresponses.encodeTlv())).orElse(new EmptyType()))); - values.add(new StructElement(FABRIC_INDEX_ID, new UIntType(fabricIndex))); return new StructType(values); } @@ -6583,7 +6578,6 @@ public static MessagesClusterMessageStruct decodeTlv(BaseTLVType tlvValue) { @Nullable Integer duration = null; String messageText = null; Optional> responses = Optional.empty(); - Integer fabricIndex = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == MESSAGE_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { @@ -6620,11 +6614,6 @@ public static MessagesClusterMessageStruct decodeTlv(BaseTLVType tlvValue) { ArrayType castingValue = element.value(ArrayType.class); responses = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.MessagesClusterMessageResponseOptionStruct.decodeTlv(elementcastingValue))); } - } else if (element.contextTagNum() == FABRIC_INDEX_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - fabricIndex = castingValue.value(Integer.class); - } } } return new MessagesClusterMessageStruct( @@ -6634,8 +6623,7 @@ public static MessagesClusterMessageStruct decodeTlv(BaseTLVType tlvValue) { startTime, duration, messageText, - responses, - fabricIndex + responses ); } @@ -6664,9 +6652,6 @@ public String toString() { output.append("\tresponses: "); output.append(responses); output.append("\n"); - output.append("\tfabricIndex: "); - output.append(fabricIndex); - output.append("\n"); output.append("}\n"); return output.toString(); } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index dec83e1c389bbe..70c1e3f12787d7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -23725,13 +23725,11 @@ public Map> getCommandMap() { Map messagespresentMessagesRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo messagespresentMessagesRequestmessagesCommandParameterInfo = new CommandParameterInfo("messages", ArrayList.class, ArrayList.class); - messagespresentMessagesRequestCommandParams.put("messages",messagespresentMessagesRequestmessagesCommandParameterInfo); InteractionInfo messagespresentMessagesRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MessagesCluster) cluster) .presentMessagesRequest((DefaultClusterCallback) callback - , (ArrayList) + , (ArrayList) commandArguments.get("messages") ); }, diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MessagesClusterMessageStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MessagesClusterMessageStruct.kt index 5cdeee15f4bbf1..d1749289a3b652 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MessagesClusterMessageStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MessagesClusterMessageStruct.kt @@ -31,8 +31,7 @@ class MessagesClusterMessageStruct( val startTime: ULong?, val duration: UInt?, val messageText: String, - val responses: Optional>, - val fabricIndex: UInt + val responses: Optional> ) { override fun toString(): String = buildString { append("MessagesClusterMessageStruct {\n") @@ -43,7 +42,6 @@ class MessagesClusterMessageStruct( append("\tduration : $duration\n") append("\tmessageText : $messageText\n") append("\tresponses : $responses\n") - append("\tfabricIndex : $fabricIndex\n") append("}\n") } @@ -72,7 +70,6 @@ class MessagesClusterMessageStruct( } endArray() } - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } } @@ -85,7 +82,6 @@ class MessagesClusterMessageStruct( private const val TAG_DURATION = 4 private const val TAG_MESSAGE_TEXT = 5 private const val TAG_RESPONSES = 6 - private const val TAG_FABRIC_INDEX = 254 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MessagesClusterMessageStruct { tlvReader.enterStructure(tlvTag) @@ -121,7 +117,6 @@ class MessagesClusterMessageStruct( } else { Optional.empty() } - val fabricIndex = tlvReader.getUInt(ContextSpecificTag(TAG_FABRIC_INDEX)) tlvReader.exitContainer() @@ -132,8 +127,7 @@ class MessagesClusterMessageStruct( startTime, duration, messageText, - responses, - fabricIndex + responses ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/MessagesCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/MessagesCluster.kt index 79e920a937d41f..bdde4fc975a4c8 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/MessagesCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/MessagesCluster.kt @@ -105,7 +105,7 @@ class MessagesCluster(private val controller: MatterController, private val endp } suspend fun presentMessagesRequest( - messages: List, + messages: List, timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u @@ -116,7 +116,7 @@ class MessagesCluster(private val controller: MatterController, private val endp val TAG_MESSAGES_REQ: Int = 0 tlvWriter.startArray(ContextSpecificTag(TAG_MESSAGES_REQ)) for (item in messages.iterator()) { - tlvWriter.put(AnonymousTag, item) + item.toTlv(AnonymousTag, tlvWriter) } tlvWriter.endArray() tlvWriter.endStructure() diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/MessagesClusterMessageStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/MessagesClusterMessageStruct.kt index d40439e9c96891..8560beb0a72ce1 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/MessagesClusterMessageStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/MessagesClusterMessageStruct.kt @@ -31,8 +31,7 @@ class MessagesClusterMessageStruct( val startTime: UInt?, val duration: UShort?, val messageText: String, - val responses: Optional>, - val fabricIndex: UByte + val responses: Optional> ) { override fun toString(): String = buildString { append("MessagesClusterMessageStruct {\n") @@ -43,7 +42,6 @@ class MessagesClusterMessageStruct( append("\tduration : $duration\n") append("\tmessageText : $messageText\n") append("\tresponses : $responses\n") - append("\tfabricIndex : $fabricIndex\n") append("}\n") } @@ -72,7 +70,6 @@ class MessagesClusterMessageStruct( } endArray() } - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } } @@ -85,7 +82,6 @@ class MessagesClusterMessageStruct( private const val TAG_DURATION = 4 private const val TAG_MESSAGE_TEXT = 5 private const val TAG_RESPONSES = 6 - private const val TAG_FABRIC_INDEX = 254 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MessagesClusterMessageStruct { tlvReader.enterStructure(tlvTag) @@ -121,7 +117,6 @@ class MessagesClusterMessageStruct( } else { Optional.empty() } - val fabricIndex = tlvReader.getUByte(ContextSpecificTag(TAG_FABRIC_INDEX)) tlvReader.exitContainer() @@ -132,8 +127,7 @@ class MessagesClusterMessageStruct( startTime, duration, messageText, - responses, - fabricIndex + responses ) } } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 2faff1dbcd22d6..8afc7c33e1da24 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -21974,13 +21974,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } chip::JniReferences::GetInstance().CreateOptional(newElement_0_responsesInsideOptional, newElement_0_responses); } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - jint jninewElement_0_fabricIndex = static_cast(entry_0.fabricIndex); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - jninewElement_0_fabricIndex, newElement_0_fabricIndex); jclass messageStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -21992,11 +21985,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } jmethodID messageStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, messageStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/String;Ljava/util/" - "Optional;Ljava/lang/Integer;)V", - &messageStructStructCtor_1); + err = + chip::JniReferences::GetInstance().FindMethod(env, messageStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/" + "lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V", + &messageStructStructCtor_1); if (err != CHIP_NO_ERROR || messageStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageStruct constructor"); @@ -22005,8 +21998,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0 = env->NewObject(messageStructStructClass_1, messageStructStructCtor_1, newElement_0_messageID, newElement_0_priority, newElement_0_messageControl, newElement_0_startTime, - newElement_0_duration, newElement_0_messageText, newElement_0_responses, - newElement_0_fabricIndex); + newElement_0_duration, newElement_0_messageText, newElement_0_responses); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 6eca908c20222a..37b0baf4d4a75c 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6568,7 +6568,7 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "PresentMessagesRequest", "args": { - "messages": "bytes", + "messages": "MessageStruct", }, }, 0x00000001: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 1744e1c943f6b2..d5ed0b03db0861 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -23247,7 +23247,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="duration", Tag=4, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="messageText", Tag=5, Type=str), ClusterObjectFieldDescriptor(Label="responses", Tag=6, Type=typing.Optional[typing.List[Messages.Structs.MessageResponseOptionStruct]]), - ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), ]) messageID: 'bytes' = b"" @@ -23257,7 +23256,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: duration: 'typing.Union[Nullable, uint]' = NullValue messageText: 'str' = "" responses: 'typing.Optional[typing.List[Messages.Structs.MessageResponseOptionStruct]]' = None - fabricIndex: 'uint' = 0 class Commands: @dataclass @@ -23271,10 +23269,10 @@ class PresentMessagesRequest(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="messages", Tag=0, Type=typing.List[bytes]), + ClusterObjectFieldDescriptor(Label="messages", Tag=0, Type=typing.List[Messages.Structs.MessageStruct]), ]) - messages: 'typing.List[bytes]' = field(default_factory=lambda: []) + messages: 'typing.List[Messages.Structs.MessageStruct]' = field(default_factory=lambda: []) @dataclass class CancelMessagesRequest(ClusterCommand): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index c3654daf3fd464..75ec47f5e9587e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8324,7 +8324,6 @@ static id _Nullable DecodeAttributeValueForMessagesCluster(AttributeId aAttribut } else { newElement_0.responses = nil; } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 261e27dba96c99..5ba6f1236b0ae6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7516,7 +7516,7 @@ MTR_PROVISIONALLY_AVAILABLE */ - (void)cancelMessagesRequestWithParams:(MTRMessagesClusterCancelMessagesRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeMessagesWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeMessagesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeMessagesWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeMessagesWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeMessagesWithParams:(MTRSubscribeParams *)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 89d55e0036ec63..34ce25041734bd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -51059,13 +51059,13 @@ - (void)cancelMessagesRequestWithParams:(MTRMessagesClusterCancelMessagesRequest completion:responseHandler]; } -- (void)readAttributeMessagesWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeMessagesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = Messages::Attributes::Messages::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) - params:params + params:nil queue:self.callbackQueue completion:completion]; } @@ -51154,7 +51154,6 @@ - (void)writeAttributeMessagesWithValue:(NSArray * _Nonnull)value params:(MTRWri } } } - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 242589a5953e3c..3358d9fa790561 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -15463,12 +15463,59 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < self.messages.count; ++i_0) { - if (![self.messages[i_0] isKindOfClass:[NSData class]]) { + if (![self.messages[i_0] isKindOfClass:[MTRMessagesClusterMessageStruct class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (NSData *) self.messages[i_0]; - listHolder_0->mList[i_0] = AsByteSpan(element_0); + auto element_0 = (MTRMessagesClusterMessageStruct *) self.messages[i_0]; + listHolder_0->mList[i_0].messageID = AsByteSpan(element_0.messageID); + listHolder_0->mList[i_0].priority = static_castmList[i_0].priority)>>(element_0.priority.unsignedCharValue); + listHolder_0->mList[i_0].messageControl = static_castmList[i_0].messageControl)>>(element_0.messageControl.unsignedCharValue); + if (element_0.startTime == nil) { + listHolder_0->mList[i_0].startTime.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].startTime.SetNonNull(); + nonNullValue_2 = element_0.startTime.unsignedIntValue; + } + if (element_0.duration == nil) { + listHolder_0->mList[i_0].duration.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].duration.SetNonNull(); + nonNullValue_2 = element_0.duration.unsignedShortValue; + } + listHolder_0->mList[i_0].messageText = AsCharSpan(element_0.messageText); + if (element_0.responses != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].responses.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.responses.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.responses.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.responses.count; ++i_3) { + if (![element_0.responses[i_3] isKindOfClass:[MTRMessagesClusterMessageResponseOptionStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MTRMessagesClusterMessageResponseOptionStruct *) element_0.responses[i_3]; + if (element_3.messageResponseID != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].messageResponseID.Emplace(); + definedValue_5 = element_3.messageResponseID.unsignedIntValue; + } + if (element_3.label != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].label.Emplace(); + definedValue_5 = AsCharSpan(element_3.label); + } + } + definedValue_2 = ListType_3(listHolder_3->mList, element_0.responses.count); + } else { + definedValue_2 = ListType_3(); + } + } + } } encodableStruct.messages = ListType_0(listHolder_0->mList, self.messages.count); } else { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 4f6a558800e46d..395497c0bfc648 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1202,7 +1202,6 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable duration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSString * _Nonnull messageText MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSArray * _Nullable responses MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex 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 c2528ddf0e227e..00c787feacb3c0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -4861,8 +4861,6 @@ - (instancetype)init _messageText = @""; _responses = nil; - - _fabricIndex = @(0); } return self; } @@ -4878,14 +4876,13 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.duration = self.duration; other.messageText = self.messageText; other.responses = self.responses; - other.fabricIndex = self.fabricIndex; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: messageID:%@; priority:%@; messageControl:%@; startTime:%@; duration:%@; messageText:%@; responses:%@; fabricIndex:%@; >", NSStringFromClass([self class]), [_messageID base64EncodedStringWithOptions:0], _priority, _messageControl, _startTime, _duration, _messageText, _responses, _fabricIndex]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: messageID:%@; priority:%@; messageControl:%@; startTime:%@; duration:%@; messageText:%@; responses:%@; >", NSStringFromClass([self class]), [_messageID base64EncodedStringWithOptions:0], _priority, _messageControl, _startTime, _duration, _messageText, _responses]; 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 5bd0f13ade5424..8b0a7d22694475 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 @@ -14892,21 +14892,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace MessageResponseOptionStruct namespace MessageStruct { -CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - return DoEncode(aWriter, aTag, NullOptional); -} - -CHIP_ERROR Type::EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const -{ - return DoEncode(aWriter, aTag, MakeOptional(aAccessingFabricIndex)); -} - -CHIP_ERROR Type::DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional & aAccessingFabricIndex) const +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kMessageID), messageID); encoder.Encode(to_underlying(Fields::kPriority), priority); encoder.Encode(to_underlying(Fields::kMessageControl), messageControl); @@ -14914,11 +14902,6 @@ CHIP_ERROR Type::DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optiona encoder.Encode(to_underlying(Fields::kDuration), duration); encoder.Encode(to_underlying(Fields::kMessageText), messageText); encoder.Encode(to_underlying(Fields::kResponses), responses); - if (aAccessingFabricIndex.HasValue()) - { - encoder.Encode(to_underlying(Fields::kFabricIndex), fabricIndex); - } - return encoder.Finalize(); } @@ -14964,10 +14947,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, responses); } - else if (__context_tag == to_underlying(Fields::kFabricIndex)) - { - err = DataModel::Decode(reader, fabricIndex); - } 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 1b3caa4fe1725b..0a56f821cb37f8 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 @@ -21041,7 +21041,6 @@ enum class Fields : uint8_t kDuration = 4, kMessageText = 5, kResponses = 6, - kFabricIndex = 254, }; struct Type @@ -21054,19 +21053,10 @@ struct Type DataModel::Nullable duration; chip::CharSpan messageText; Optional> responses; - chip::FabricIndex fabricIndex = static_cast(0); - - static constexpr bool kIsFabricScoped = true; - - auto GetFabricIndex() const { return fabricIndex; } - void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } - - CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const; + static constexpr bool kIsFabricScoped = false; -private: - CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional & aAccessingFabricIndex) const; + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; struct DecodableType @@ -21079,15 +21069,10 @@ struct DecodableType DataModel::Nullable duration; chip::CharSpan messageText; Optional> responses; - chip::FabricIndex fabricIndex = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); - static constexpr bool kIsFabricScoped = true; - - auto GetFabricIndex() const { return fabricIndex; } - - void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } + static constexpr bool kIsFabricScoped = false; }; } // namespace MessageStruct @@ -21122,7 +21107,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::PresentMessagesRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messages::Id; } - DataModel::List messages; + DataModel::List messages; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -21137,7 +21122,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::PresentMessagesRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messages::Id; } - DataModel::DecodableList messages; + DataModel::DecodableList messages; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace PresentMessagesRequest diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 29d308fd6f722b..efb80e38b2eb76 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6856,7 +6856,8 @@ class MessagesPresentMessagesRequest : public ClusterCommand private: chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Type mRequest; - TypedComplexArgument> mComplex_Messages; + TypedComplexArgument> + mComplex_Messages; }; /* diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index cc4b9dcfbc54e9..5813b0e5b12105 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -2875,13 +2875,6 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: } valueCopy.removeMember("responses"); - if (value.isMember("fabricIndex")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); - } - valueCopy.removeMember("fabricIndex"); - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -2894,7 +2887,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::Messages::Structs::Mes ComplexArgumentParser::Finalize(request.duration); ComplexArgumentParser::Finalize(request.messageText); ComplexArgumentParser::Finalize(request.responses); - ComplexArgumentParser::Finalize(request.fabricIndex); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, 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 770181972ebe22..ed55791683b074 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2550,14 +2550,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); - return err; - } - } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; 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 a4fb8e6b9dd41f..8befa618752ce8 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -79096,8 +79096,45 @@ class MessagesPresentMessagesRequest : public ClusterCommand { { // Scope for our temporary variables auto * array_0 = [NSMutableArray new]; for (auto & entry_0 : mRequest.messages) { - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + MTRMessagesClusterMessageStruct * newElement_0; + newElement_0 = [MTRMessagesClusterMessageStruct new]; + newElement_0.messageID = [NSData dataWithBytes:entry_0.messageID.data() length:entry_0.messageID.size()]; + newElement_0.priority = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.priority)]; + newElement_0.messageControl = [NSNumber numberWithUnsignedChar:entry_0.messageControl.Raw()]; + if (entry_0.startTime.IsNull()) { + newElement_0.startTime = nil; + } else { + newElement_0.startTime = [NSNumber numberWithUnsignedInt:entry_0.startTime.Value()]; + } + if (entry_0.duration.IsNull()) { + newElement_0.duration = nil; + } else { + newElement_0.duration = [NSNumber numberWithUnsignedShort:entry_0.duration.Value()]; + } + newElement_0.messageText = [[NSString alloc] initWithBytes:entry_0.messageText.data() length:entry_0.messageText.size() encoding:NSUTF8StringEncoding]; + if (entry_0.responses.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.responses.Value()) { + MTRMessagesClusterMessageResponseOptionStruct * newElement_3; + newElement_3 = [MTRMessagesClusterMessageResponseOptionStruct new]; + if (entry_3.messageResponseID.HasValue()) { + newElement_3.messageResponseID = [NSNumber numberWithUnsignedInt:entry_3.messageResponseID.Value()]; + } else { + newElement_3.messageResponseID = nil; + } + if (entry_3.label.HasValue()) { + newElement_3.label = [[NSString alloc] initWithBytes:entry_3.label.Value().data() length:entry_3.label.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_3.label = nil; + } + [array_3 addObject:newElement_3]; + } + newElement_0.responses = array_3; + } + } else { + newElement_0.responses = nil; + } [array_0 addObject:newElement_0]; } params.messages = array_0; @@ -79124,7 +79161,7 @@ class MessagesPresentMessagesRequest : public ClusterCommand { private: chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Type mRequest; - TypedComplexArgument> mComplex_Messages; + TypedComplexArgument> mComplex_Messages; }; #endif // MTR_ENABLE_PROVISIONAL @@ -79217,11 +79254,7 @@ class ReadMessagesMessages : public ReadAttribute { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); __auto_type * cluster = [[MTRBaseClusterMessages alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRReadParams alloc] init]; - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - [cluster readAttributeMessagesWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { + [cluster readAttributeMessagesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Messages.Messages response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); @@ -79304,7 +79337,6 @@ class WriteMessagesMessages : public WriteAttribute { } else { newElement_0.responses = nil; } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } value = array_0;