Skip to content

Commit

Permalink
Run ZAP script
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov committed Jan 25, 2024
1 parent 88246cf commit e4d0ddc
Show file tree
Hide file tree
Showing 13 changed files with 699 additions and 532 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ limitations under the License.
<description>
Command for requesting messages be presented
</description>
<arg name="Messages" type="octet_string" array="true"/>
<arg name="Messages" type="MessageStruct" array="true"/>
</command>
<command source="client" code="0x01" name="CancelMessagesRequest" isFabricScoped="true" optional="false">
<description>
Command for cancelling message present requests
</description>
<arg name="Messages" type="octet_string" array="true"/>
<arg name="Messages" type="MessageStruct" array="true"/>
</command>
<event side="server" code="0x00" name="MessageQueued" priority="info" optional="false">
<description>This event SHALL be generated when the message is confirmed by the user, or when the expiration date of the message is reached.</description>
Expand Down
4 changes: 2 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4448,11 +4448,11 @@ provisional cluster Messages = 151 {
readonly attribute int16u clusterRevision = 65533;

request struct PresentMessagesRequestRequest {
octet_string messages[] = 0;
MessageStruct messages[] = 0;
}

request struct CancelMessagesRequestRequest {
octet_string messages[] = 0;
MessageStruct messages[] = 0;
}

/** Command for requesting messages be presented */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29208,16 +29208,16 @@ public long initWithDevice(long devicePtr, int endpointId) {
return 0L;
}

public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList<byte[]> messages) {
public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList<ChipStructs.MessagesClusterMessageStruct> messages) {
presentMessagesRequest(callback, messages, 0);
}

public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList<byte[]> messages, int timedInvokeTimeoutMs) {
public void presentMessagesRequest(DefaultClusterCallback callback, ArrayList<ChipStructs.MessagesClusterMessageStruct> messages, int timedInvokeTimeoutMs) {
final long commandId = 0L;

ArrayList<StructElement> 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);
Expand All @@ -29228,16 +29228,16 @@ public void onResponse(StructType invokeStructValue) {
}}, commandId, value, timedInvokeTimeoutMs);
}

public void cancelMessagesRequest(DefaultClusterCallback callback, ArrayList<byte[]> messages) {
public void cancelMessagesRequest(DefaultClusterCallback callback, ArrayList<ChipStructs.MessagesClusterMessageStruct> messages) {
cancelMessagesRequest(callback, messages, 0);
}

public void cancelMessagesRequest(DefaultClusterCallback callback, ArrayList<byte[]> messages, int timedInvokeTimeoutMs) {
public void cancelMessagesRequest(DefaultClusterCallback callback, ArrayList<ChipStructs.MessagesClusterMessageStruct> messages, int timedInvokeTimeoutMs) {
final long commandId = 1L;

ArrayList<StructElement> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23725,13 +23725,11 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() {

Map<String, CommandParameterInfo> messagespresentMessagesRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();

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<byte[]>)
, (ArrayList<ChipStructs.MessagesClusterMessageStruct>)
commandArguments.get("messages")
);
},
Expand All @@ -23742,13 +23740,11 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() {

Map<String, CommandParameterInfo> messagescancelMessagesRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();

CommandParameterInfo messagescancelMessagesRequestmessagesCommandParameterInfo = new CommandParameterInfo("messages", ArrayList.class, ArrayList.class);
messagescancelMessagesRequestCommandParams.put("messages",messagescancelMessagesRequestmessagesCommandParameterInfo);
InteractionInfo messagescancelMessagesRequestInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.MessagesCluster) cluster)
.cancelMessagesRequest((DefaultClusterCallback) callback
, (ArrayList<byte[]>)
, (ArrayList<ChipStructs.MessagesClusterMessageStruct>)
commandArguments.get("messages")
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class MessagesCluster(private val controller: MatterController, private val endp
}

suspend fun presentMessagesRequest(
messages: List<ByteArray>,
messages: List<MessagesClusterMessageStruct>,
timedInvokeTimeout: Duration? = null
) {
val commandId: UInt = 0u
Expand All @@ -113,7 +113,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()
Expand All @@ -130,7 +130,7 @@ class MessagesCluster(private val controller: MatterController, private val endp
}

suspend fun cancelMessagesRequest(
messages: List<ByteArray>,
messages: List<MessagesClusterMessageStruct>,
timedInvokeTimeout: Duration? = null
) {
val commandId: UInt = 1u
Expand All @@ -141,7 +141,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()
Expand Down
70 changes: 35 additions & 35 deletions src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e4d0ddc

Please sign in to comment.