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 0029e1066f96f0..28b3eb975594a0 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
@@ -84,7 +84,13 @@ limitations under the License.
Command for requesting messages be presented
-
+
+
+
+
+
+
+
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index dacc1008177ad9..dbad9659e2f85f 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -4440,7 +4440,13 @@ cluster Messages = 151 {
readonly attribute int16u clusterRevision = 65533;
request struct PresentMessagesRequestRequest {
- MessageStruct messages[] = 0;
+ octet_string<16> messageID = 0;
+ MessagePriorityEnum priority = 1;
+ MessageControlBitmap messageControl = 2;
+ nullable epoch_s startTime = 3;
+ nullable int16u duration = 4;
+ char_string<256> messageText = 5;
+ optional MessageResponseOptionStruct responses[] = 6;
}
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 05034b2792c9e7..262059e5f3b85f 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
@@ -29078,17 +29078,41 @@ public long initWithDevice(long devicePtr, int endpointId) {
return 0L;
}
- public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList messages) {
- presentMessagesRequest(callback, messages, 0);
+ public void presentMessagesRequest(DefaultClusterCallback callback, byte[] messageID, Integer priority, Integer messageControl, @Nullable Long startTime, @Nullable Integer duration, String messageText, Optional> responses) {
+ presentMessagesRequest(callback, messageID, priority, messageControl, startTime, duration, messageText, responses, 0);
}
- public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList messages, int timedInvokeTimeoutMs) {
+ public void presentMessagesRequest(DefaultClusterCallback callback, byte[] messageID, Integer priority, Integer messageControl, @Nullable Long startTime, @Nullable Integer duration, String messageText, Optional> responses, int timedInvokeTimeoutMs) {
final long commandId = 0L;
ArrayList elements = new ArrayList<>();
- final long messagesFieldID = 0L;
- BaseTLVType messagestlvValue = ArrayType.generateArrayType(messages, (elementmessages) -> elementmessages.encodeTlv());
- elements.add(new StructElement(messagesFieldID, messagestlvValue));
+ final long messageIDFieldID = 0L;
+ BaseTLVType messageIDtlvValue = new ByteArrayType(messageID);
+ elements.add(new StructElement(messageIDFieldID, messageIDtlvValue));
+
+ final long priorityFieldID = 1L;
+ BaseTLVType prioritytlvValue = new UIntType(priority);
+ elements.add(new StructElement(priorityFieldID, prioritytlvValue));
+
+ final long messageControlFieldID = 2L;
+ BaseTLVType messageControltlvValue = new UIntType(messageControl);
+ elements.add(new StructElement(messageControlFieldID, messageControltlvValue));
+
+ final long startTimeFieldID = 3L;
+ BaseTLVType startTimetlvValue = startTime != null ? new UIntType(startTime) : new NullType();
+ elements.add(new StructElement(startTimeFieldID, startTimetlvValue));
+
+ final long durationFieldID = 4L;
+ BaseTLVType durationtlvValue = duration != null ? new UIntType(duration) : new NullType();
+ elements.add(new StructElement(durationFieldID, durationtlvValue));
+
+ final long messageTextFieldID = 5L;
+ BaseTLVType messageTexttlvValue = new StringType(messageText);
+ elements.add(new StructElement(messageTextFieldID, messageTexttlvValue));
+
+ final long responsesFieldID = 6L;
+ BaseTLVType responsestlvValue = responses.map((nonOptionalresponses) -> ArrayType.generateArrayType(nonOptionalresponses, (elementnonOptionalresponses) -> elementnonOptionalresponses.encodeTlv())).orElse(new EmptyType());
+ elements.add(new StructElement(responsesFieldID, responsestlvValue));
StructType value = new StructType(elements);
invoke(new InvokeCallbackImpl(callback) {
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
index 31a6462aa17d1e..43e246a70b6d81 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
@@ -9385,7 +9385,7 @@ public static Command value(long id) throws NoSuchFieldError {
}
throw new NoSuchFieldError();
}
- }public enum PresentMessagesRequestCommandField {Messages(0),;
+ }public enum PresentMessagesRequestCommandField {MessageID(0),Priority(1),MessageControl(2),StartTime(3),Duration(4),MessageText(5),Responses(6),;
private final int id;
PresentMessagesRequestCommandField(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 ab150d36e3925d..837e6e72bd193c 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
@@ -23659,12 +23659,42 @@ public Map> getCommandMap() {
Map messagespresentMessagesRequestCommandParams = new LinkedHashMap();
+ CommandParameterInfo messagespresentMessagesRequestmessageIDCommandParameterInfo = new CommandParameterInfo("messageID", byte[].class, byte[].class);
+ messagespresentMessagesRequestCommandParams.put("messageID",messagespresentMessagesRequestmessageIDCommandParameterInfo);
+
+ CommandParameterInfo messagespresentMessagesRequestpriorityCommandParameterInfo = new CommandParameterInfo("priority", Integer.class, Integer.class);
+ messagespresentMessagesRequestCommandParams.put("priority",messagespresentMessagesRequestpriorityCommandParameterInfo);
+
+ CommandParameterInfo messagespresentMessagesRequestmessageControlCommandParameterInfo = new CommandParameterInfo("messageControl", Integer.class, Integer.class);
+ messagespresentMessagesRequestCommandParams.put("messageControl",messagespresentMessagesRequestmessageControlCommandParameterInfo);
+
+ CommandParameterInfo messagespresentMessagesRequeststartTimeCommandParameterInfo = new CommandParameterInfo("startTime", Long.class, Long.class);
+ messagespresentMessagesRequestCommandParams.put("startTime",messagespresentMessagesRequeststartTimeCommandParameterInfo);
+
+ CommandParameterInfo messagespresentMessagesRequestdurationCommandParameterInfo = new CommandParameterInfo("duration", Integer.class, Integer.class);
+ messagespresentMessagesRequestCommandParams.put("duration",messagespresentMessagesRequestdurationCommandParameterInfo);
+
+ CommandParameterInfo messagespresentMessagesRequestmessageTextCommandParameterInfo = new CommandParameterInfo("messageText", String.class, String.class);
+ messagespresentMessagesRequestCommandParams.put("messageText",messagespresentMessagesRequestmessageTextCommandParameterInfo);
+
InteractionInfo messagespresentMessagesRequestInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.MessagesCluster) cluster)
.presentMessagesRequest((DefaultClusterCallback) callback
- , (ArrayList)
- commandArguments.get("messages")
+ , (byte[])
+ commandArguments.get("messageID")
+ , (Integer)
+ commandArguments.get("priority")
+ , (Integer)
+ commandArguments.get("messageControl")
+ , (Long)
+ commandArguments.get("startTime")
+ , (Integer)
+ commandArguments.get("duration")
+ , (String)
+ commandArguments.get("messageText")
+ , (Optional>)
+ commandArguments.get("responses")
);
},
() -> new DelegatedDefaultClusterCallback(),
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 7793725b8d9cce..5ce55e2e0dd21b 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
@@ -102,7 +102,13 @@ class MessagesCluster(private val controller: MatterController, private val endp
}
suspend fun presentMessagesRequest(
- messages: List,
+ messageID: ByteArray,
+ priority: UByte,
+ messageControl: UByte,
+ startTime: UInt?,
+ duration: UShort?,
+ messageText: String,
+ responses: List?,
timedInvokeTimeout: Duration? = null
) {
val commandId: UInt = 0u
@@ -110,12 +116,32 @@ class MessagesCluster(private val controller: MatterController, private val endp
val tlvWriter = TlvWriter()
tlvWriter.startStructure(AnonymousTag)
- val TAG_MESSAGES_REQ: Int = 0
- tlvWriter.startArray(ContextSpecificTag(TAG_MESSAGES_REQ))
- for (item in messages.iterator()) {
- item.toTlv(AnonymousTag, tlvWriter)
+ val TAG_MESSAGE_I_D_REQ: Int = 0
+ tlvWriter.put(ContextSpecificTag(TAG_MESSAGE_I_D_REQ), messageID)
+
+ val TAG_PRIORITY_REQ: Int = 1
+ tlvWriter.put(ContextSpecificTag(TAG_PRIORITY_REQ), priority)
+
+ val TAG_MESSAGE_CONTROL_REQ: Int = 2
+ tlvWriter.put(ContextSpecificTag(TAG_MESSAGE_CONTROL_REQ), messageControl)
+
+ val TAG_START_TIME_REQ: Int = 3
+ startTime?.let { tlvWriter.put(ContextSpecificTag(TAG_START_TIME_REQ), startTime) }
+
+ val TAG_DURATION_REQ: Int = 4
+ duration?.let { tlvWriter.put(ContextSpecificTag(TAG_DURATION_REQ), duration) }
+
+ val TAG_MESSAGE_TEXT_REQ: Int = 5
+ tlvWriter.put(ContextSpecificTag(TAG_MESSAGE_TEXT_REQ), messageText)
+
+ val TAG_RESPONSES_REQ: Int = 6
+ responses?.let {
+ tlvWriter.startArray(ContextSpecificTag(TAG_RESPONSES_REQ))
+ for (item in responses.iterator()) {
+ item.toTlv(AnonymousTag, tlvWriter)
+ }
+ tlvWriter.endArray()
}
- tlvWriter.endArray()
tlvWriter.endStructure()
val request: InvokeRequest =
diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py
index b039925f2c21e0..56486a09e15a42 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.py
+++ b/src/controller/python/chip/clusters/CHIPClusters.py
@@ -6542,7 +6542,13 @@ class ChipClusters:
"commandId": 0x00000000,
"commandName": "PresentMessagesRequest",
"args": {
- "messages": "MessageStruct",
+ "messageID": "bytes",
+ "priority": "int",
+ "messageControl": "int",
+ "startTime": "int",
+ "duration": "int",
+ "messageText": "str",
+ "responses": "MessageResponseOptionStruct",
},
},
0x00000001: {
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index da92192016b089..38a40194feff0a 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -23207,10 +23207,22 @@ class PresentMessagesRequest(ClusterCommand):
def descriptor(cls) -> ClusterObjectDescriptor:
return ClusterObjectDescriptor(
Fields=[
- ClusterObjectFieldDescriptor(Label="messages", Tag=0, Type=typing.List[Messages.Structs.MessageStruct]),
+ ClusterObjectFieldDescriptor(Label="messageID", Tag=0, Type=bytes),
+ ClusterObjectFieldDescriptor(Label="priority", Tag=1, Type=Messages.Enums.MessagePriorityEnum),
+ ClusterObjectFieldDescriptor(Label="messageControl", Tag=2, Type=uint),
+ ClusterObjectFieldDescriptor(Label="startTime", Tag=3, Type=typing.Union[Nullable, uint]),
+ 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]]),
])
- messages: 'typing.List[Messages.Structs.MessageStruct]' = field(default_factory=lambda: [])
+ messageID: 'bytes' = b""
+ priority: 'Messages.Enums.MessagePriorityEnum' = 0
+ messageControl: 'uint' = 0
+ startTime: 'typing.Union[Nullable, uint]' = NullValue
+ duration: 'typing.Union[Nullable, uint]' = NullValue
+ messageText: 'str' = ""
+ responses: 'typing.Optional[typing.List[Messages.Structs.MessageResponseOptionStruct]]' = None
@dataclass
class CancelMessagesRequest(ClusterCommand):
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
index 0c66bc8d9af6ce..b2159626d29866 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
@@ -5458,7 +5458,19 @@ MTR_PROVISIONALLY_AVAILABLE
MTR_PROVISIONALLY_AVAILABLE
@interface MTRMessagesClusterPresentMessagesRequestParams : NSObject
-@property (nonatomic, copy) NSArray * _Nonnull messages MTR_PROVISIONALLY_AVAILABLE;
+@property (nonatomic, copy) NSData * _Nonnull messageID MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull priority MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull messageControl MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nullable startTime 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;
/**
* 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 2fcecf401135e7..6e7f500929877d 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
@@ -15274,7 +15274,19 @@ - (instancetype)init
{
if (self = [super init]) {
- _messages = [NSArray array];
+ _messageID = [NSData data];
+
+ _priority = @(0);
+
+ _messageControl = @(0);
+
+ _startTime = nil;
+
+ _duration = nil;
+
+ _messageText = @"";
+
+ _responses = nil;
_timedInvokeTimeoutMs = nil;
_serverSideProcessingTimeout = nil;
}
@@ -15285,7 +15297,13 @@ - (id)copyWithZone:(NSZone * _Nullable)zone;
{
auto other = [[MTRMessagesClusterPresentMessagesRequestParams alloc] init];
- other.messages = self.messages;
+ other.messageID = self.messageID;
+ other.priority = self.priority;
+ other.messageControl = self.messageControl;
+ other.startTime = self.startTime;
+ other.duration = self.duration;
+ other.messageText = self.messageText;
+ other.responses = self.responses;
other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
other.serverSideProcessingTimeout = self.serverSideProcessingTimeout;
@@ -15294,7 +15312,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone;
- (NSString *)description
{
- NSString * descriptionString = [NSString stringWithFormat:@"<%@: messages:%@; >", NSStringFromClass([self class]), _messages];
+ 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;
}
@@ -15307,73 +15325,64 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader
chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Type encodableStruct;
ListFreer listFreer;
{
- {
- using ListType_0 = std::remove_reference_t;
- using ListMemberType_0 = ListMemberTypeGetter::Type;
- if (self.messages.count != 0) {
- auto * listHolder_0 = new ListHolder(self.messages.count);
- if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
- return CHIP_ERROR_INVALID_ARGUMENT;
- }
- listFreer.add(listHolder_0);
- for (size_t i_0 = 0; i_0 < self.messages.count; ++i_0) {
- if (![self.messages[i_0] isKindOfClass:[MTRMessagesClusterMessageStruct class]]) {
- // Wrong kind of value.
+ encodableStruct.messageID = AsByteSpan(self.messageID);
+ }
+ {
+ encodableStruct.priority = static_cast>(self.priority.unsignedCharValue);
+ }
+ {
+ encodableStruct.messageControl = static_cast>(self.messageControl.unsignedCharValue);
+ }
+ {
+ if (self.startTime == nil) {
+ encodableStruct.startTime.SetNull();
+ } else {
+ auto & nonNullValue_0 = encodableStruct.startTime.SetNonNull();
+ nonNullValue_0 = self.startTime.unsignedIntValue;
+ }
+ }
+ {
+ if (self.duration == nil) {
+ encodableStruct.duration.SetNull();
+ } else {
+ auto & nonNullValue_0 = encodableStruct.duration.SetNonNull();
+ nonNullValue_0 = self.duration.unsignedShortValue;
+ }
+ }
+ {
+ encodableStruct.messageText = AsCharSpan(self.messageText);
+ }
+ {
+ if (self.responses != nil) {
+ auto & definedValue_0 = encodableStruct.responses.Emplace();
+ {
+ using ListType_1 = std::remove_reference_t;
+ using ListMemberType_1 = ListMemberTypeGetter::Type;
+ if (self.responses.count != 0) {
+ auto * listHolder_1 = new ListHolder(self.responses.count);
+ if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) {
return CHIP_ERROR_INVALID_ARGUMENT;
}
- 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();
- }
+ listFreer.add(listHolder_1);
+ for (size_t i_1 = 0; i_1 < self.responses.count; ++i_1) {
+ if (![self.responses[i_1] isKindOfClass:[MTRMessagesClusterMessageResponseOptionStruct class]]) {
+ // Wrong kind of value.
+ return CHIP_ERROR_INVALID_ARGUMENT;
+ }
+ auto element_1 = (MTRMessagesClusterMessageResponseOptionStruct *) self.responses[i_1];
+ if (element_1.messageResponseID != nil) {
+ auto & definedValue_3 = listHolder_1->mList[i_1].messageResponseID.Emplace();
+ definedValue_3 = element_1.messageResponseID.unsignedIntValue;
+ }
+ if (element_1.label != nil) {
+ auto & definedValue_3 = listHolder_1->mList[i_1].label.Emplace();
+ definedValue_3 = AsCharSpan(element_1.label);
}
}
+ definedValue_0 = ListType_1(listHolder_1->mList, self.responses.count);
+ } else {
+ definedValue_0 = ListType_1();
}
- encodableStruct.messages = ListType_0(listHolder_0->mList, self.messages.count);
- } else {
- encodableStruct.messages = ListType_0();
}
}
}
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 77288b75a82c3d..c19ff038dfffbf 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
@@ -14919,7 +14919,13 @@ namespace PresentMessagesRequest {
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
{
DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
- encoder.Encode(to_underlying(Fields::kMessages), messages);
+ encoder.Encode(to_underlying(Fields::kMessageID), messageID);
+ encoder.Encode(to_underlying(Fields::kPriority), priority);
+ encoder.Encode(to_underlying(Fields::kMessageControl), messageControl);
+ encoder.Encode(to_underlying(Fields::kStartTime), startTime);
+ encoder.Encode(to_underlying(Fields::kDuration), duration);
+ encoder.Encode(to_underlying(Fields::kMessageText), messageText);
+ encoder.Encode(to_underlying(Fields::kResponses), responses);
return encoder.Finalize();
}
@@ -14937,9 +14943,33 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
CHIP_ERROR err = CHIP_NO_ERROR;
const uint8_t __context_tag = std::get(__element);
- if (__context_tag == to_underlying(Fields::kMessages))
+ if (__context_tag == to_underlying(Fields::kMessageID))
{
- err = DataModel::Decode(reader, messages);
+ err = DataModel::Decode(reader, messageID);
+ }
+ else if (__context_tag == to_underlying(Fields::kPriority))
+ {
+ err = DataModel::Decode(reader, priority);
+ }
+ else if (__context_tag == to_underlying(Fields::kMessageControl))
+ {
+ err = DataModel::Decode(reader, messageControl);
+ }
+ else if (__context_tag == to_underlying(Fields::kStartTime))
+ {
+ err = DataModel::Decode(reader, startTime);
+ }
+ else if (__context_tag == to_underlying(Fields::kDuration))
+ {
+ err = DataModel::Decode(reader, duration);
+ }
+ else if (__context_tag == to_underlying(Fields::kMessageText))
+ {
+ err = DataModel::Decode(reader, messageText);
+ }
+ else if (__context_tag == to_underlying(Fields::kResponses))
+ {
+ err = DataModel::Decode(reader, responses);
}
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 934de47159426b..84960c16a477f2 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
@@ -21005,7 +21005,13 @@ namespace Commands {
namespace PresentMessagesRequest {
enum class Fields : uint8_t
{
- kMessages = 0,
+ kMessageID = 0,
+ kPriority = 1,
+ kMessageControl = 2,
+ kStartTime = 3,
+ kDuration = 4,
+ kMessageText = 5,
+ kResponses = 6,
};
struct Type
@@ -21015,7 +21021,13 @@ struct Type
static constexpr CommandId GetCommandId() { return Commands::PresentMessagesRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::Messages::Id; }
- DataModel::List messages;
+ chip::ByteSpan messageID;
+ MessagePriorityEnum priority = static_cast(0);
+ chip::BitMask messageControl = static_cast>(0);
+ DataModel::Nullable startTime;
+ DataModel::Nullable duration;
+ chip::CharSpan messageText;
+ Optional> responses;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
@@ -21030,7 +21042,13 @@ struct DecodableType
static constexpr CommandId GetCommandId() { return Commands::PresentMessagesRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::Messages::Id; }
- DataModel::DecodableList messages;
+ chip::ByteSpan messageID;
+ MessagePriorityEnum priority = static_cast(0);
+ chip::BitMask messageControl = static_cast>(0);
+ DataModel::Nullable startTime;
+ DataModel::Nullable duration;
+ chip::CharSpan messageText;
+ Optional> responses;
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 bf96cf25bf46dd..eb333b055a0469 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -6751,9 +6751,15 @@ class MessagesPresentMessagesRequest : public ClusterCommand
{
public:
MessagesPresentMessagesRequest(CredentialIssuerCommands * credsIssuerConfig) :
- ClusterCommand("present-messages-request", credsIssuerConfig), mComplex_Messages(&mRequest.messages)
+ ClusterCommand("present-messages-request", credsIssuerConfig), mComplex_Responses(&mRequest.responses)
{
- AddArgument("Messages", &mComplex_Messages);
+ AddArgument("MessageID", &mRequest.messageID);
+ AddArgument("Priority", 0, UINT8_MAX, &mRequest.priority);
+ AddArgument("MessageControl", 0, UINT8_MAX, &mRequest.messageControl);
+ AddArgument("StartTime", 0, UINT32_MAX, &mRequest.startTime);
+ AddArgument("Duration", 0, UINT16_MAX, &mRequest.duration);
+ AddArgument("MessageText", &mRequest.messageText);
+ AddArgument("Responses", &mComplex_Responses, "", Argument::kOptional);
ClusterCommand::AddArguments();
}
@@ -6780,8 +6786,9 @@ class MessagesPresentMessagesRequest : public ClusterCommand
private:
chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Type mRequest;
- TypedComplexArgument>
- mComplex_Messages;
+ TypedComplexArgument<
+ chip::Optional>>
+ mComplex_Responses;
};
/*
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 8266f153ec5a30..3a487ec7d0ddeb 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
@@ -78705,10 +78705,28 @@ class MessagesPresentMessagesRequest : public ClusterCommand {
public:
MessagesPresentMessagesRequest()
: ClusterCommand("present-messages-request")
- , mComplex_Messages(&mRequest.messages)
+ , mComplex_Responses(&mRequest.responses)
{
#if MTR_ENABLE_PROVISIONAL
- AddArgument("Messages", &mComplex_Messages);
+ AddArgument("MessageID", &mRequest.messageID);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("Priority", 0, UINT8_MAX, &mRequest.priority);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("MessageControl", 0, UINT8_MAX, &mRequest.messageControl);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("StartTime", 0, UINT32_MAX, &mRequest.startTime);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("Duration", 0, UINT16_MAX, &mRequest.duration);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("MessageText", &mRequest.messageText);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("Responses", &mComplex_Responses);
#endif // MTR_ENABLE_PROVISIONAL
ClusterCommand::AddArguments();
}
@@ -78725,51 +78743,54 @@ class MessagesPresentMessagesRequest : public ClusterCommand {
__auto_type * params = [[MTRMessagesClusterPresentMessagesRequestParams alloc] init];
params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
#if MTR_ENABLE_PROVISIONAL
- { // Scope for our temporary variables
- auto * array_0 = [NSMutableArray new];
- for (auto & entry_0 : mRequest.messages) {
- 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;
+ params.messageID = [NSData dataWithBytes:mRequest.messageID.data() length:mRequest.messageID.size()];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.priority = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.priority)];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.messageControl = [NSNumber numberWithUnsignedChar:mRequest.messageControl.Raw()];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ if (mRequest.startTime.IsNull()) {
+ params.startTime = nil;
+ } else {
+ params.startTime = [NSNumber numberWithUnsignedInt:mRequest.startTime.Value()];
+ }
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ if (mRequest.duration.IsNull()) {
+ params.duration = nil;
+ } else {
+ params.duration = [NSNumber numberWithUnsignedShort:mRequest.duration.Value()];
+ }
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.messageText = [[NSString alloc] initWithBytes:mRequest.messageText.data() length:mRequest.messageText.size() encoding:NSUTF8StringEncoding];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ if (mRequest.responses.HasValue()) {
+ { // Scope for our temporary variables
+ auto * array_1 = [NSMutableArray new];
+ for (auto & entry_1 : mRequest.responses.Value()) {
+ MTRMessagesClusterMessageResponseOptionStruct * newElement_1;
+ newElement_1 = [MTRMessagesClusterMessageResponseOptionStruct new];
+ if (entry_1.messageResponseID.HasValue()) {
+ newElement_1.messageResponseID = [NSNumber numberWithUnsignedInt:entry_1.messageResponseID.Value()];
+ } else {
+ newElement_1.messageResponseID = nil;
}
- } else {
- newElement_0.responses = nil;
+ if (entry_1.label.HasValue()) {
+ newElement_1.label = [[NSString alloc] initWithBytes:entry_1.label.Value().data() length:entry_1.label.Value().size() encoding:NSUTF8StringEncoding];
+ } else {
+ newElement_1.label = nil;
+ }
+ [array_1 addObject:newElement_1];
}
- [array_0 addObject:newElement_0];
+ params.responses = array_1;
}
- params.messages = array_0;
+ } else {
+ params.responses = nil;
}
#endif // MTR_ENABLE_PROVISIONAL
uint16_t repeatCount = mRepeatCount.ValueOr(1);
@@ -78793,7 +78814,7 @@ class MessagesPresentMessagesRequest : public ClusterCommand {
private:
chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Type mRequest;
- TypedComplexArgument> mComplex_Messages;
+ TypedComplexArgument>> mComplex_Responses;
};
#endif // MTR_ENABLE_PROVISIONAL