Skip to content

Commit

Permalink
Deprecating stateful helpers with stateless ones (#25978)
Browse files Browse the repository at this point in the history
* Deprecating stateful helpers with stateless ones
Github: ZAP#682

* updating the minimum version of zap
Github: ZAP#682
  • Loading branch information
brdandu authored and pull[bot] committed Oct 27, 2023
1 parent ce7184c commit 1824880
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions examples/chip-tool/templates/logging/DataModelLogger-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip
switch (header.mPath.mClusterId)
{
{{#all_user_clusters side='client'}}
{{#chip_server_cluster_events}}
{{#zcl_events}}
{{#first}}
case {{asUpperCamelCase parent.name}}::Id:
{
Expand All @@ -177,7 +177,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip
break;
}
{{/last}}
{{/chip_server_cluster_events}}
{{/zcl_events}}
{{/all_user_clusters}}
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-cert-bins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb
# ZAP Development install, so that it runs on both x64 and arm64
# Generally this should match with the ZAP version that is used for codegen within the
# specified SHA
ARG ZAP_VERSION=v2023.03.30-nightly
ARG ZAP_VERSION=v2023.04.05-nightly

# Ensure TARGETPLATFORM is set
RUN case ${TARGETPLATFORM} in \
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup/zap.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"mac-arm64",
"windows-amd64"
],
"tags": ["version:2@v2023.03.30-nightly.1"]
"tags": ["version:2@v2023.04.05-nightly.1"]
}
]
}
2 changes: 1 addition & 1 deletion scripts/tools/zap/zap_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Use scripts/tools/zap/version_update.py to manage ZAP versioning as many
# files may need updating for versions
#
MIN_ZAP_VERSION = '2023.3.30'
MIN_ZAP_VERSION = '2023.4.5'


class ZapTool:
Expand Down
4 changes: 2 additions & 2 deletions src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{> header}}

{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
#pragma once

#include <app/InteractionModelEngine.h>
Expand All @@ -21,4 +21,4 @@ typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttr
{{/zcl_attributes_server}}
{{/all_user_clusters}}

{{/if}}
{{/if_enabled_clusters}}
4 changes: 2 additions & 2 deletions src/app/zap-templates/templates/app/CHIPClusters.zapt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{> header}}

{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
// Prevent multiple inclusion
#pragma once

Expand All @@ -25,4 +25,4 @@ public:
{{/all_user_clusters}}
} // namespace Controller
} // namespace chip
{{/if}}
{{/if_enabled_clusters}}
48 changes: 24 additions & 24 deletions src/app/zap-templates/templates/app/access.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

////////////////////////////////////////////////////////////////////////////////

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (*cluster*, attribute, privilege) for read attribute
#define GENERATED_ACCESS_READ_ATTRIBUTE__CLUSTER { \
Expand Down Expand Up @@ -41,9 +41,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, *attribute*, privilege) for read attribute
#define GENERATED_ACCESS_READ_ATTRIBUTE__ATTRIBUTE { \
Expand Down Expand Up @@ -74,9 +74,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, attribute, *privilege*) for read attribute
#define GENERATED_ACCESS_READ_ATTRIBUTE__PRIVILEGE { \
Expand Down Expand Up @@ -107,11 +107,11 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

////////////////////////////////////////////////////////////////////////////////

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (*cluster*, attribute, privilege) for write attribute
#define GENERATED_ACCESS_WRITE_ATTRIBUTE__CLUSTER { \
Expand Down Expand Up @@ -142,9 +142,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, *attribute*, privilege) for write attribute
#define GENERATED_ACCESS_WRITE_ATTRIBUTE__ATTRIBUTE { \
Expand Down Expand Up @@ -175,9 +175,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, attribute, *privilege*) for write attribute
#define GENERATED_ACCESS_WRITE_ATTRIBUTE__PRIVILEGE { \
Expand Down Expand Up @@ -208,11 +208,11 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

////////////////////////////////////////////////////////////////////////////////

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (*cluster*, command, privilege) for invoke command
#define GENERATED_ACCESS_INVOKE_COMMAND__CLUSTER { \
Expand Down Expand Up @@ -243,9 +243,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, *command*, privilege) for invoke command
#define GENERATED_ACCESS_INVOKE_COMMAND__COMMAND { \
Expand Down Expand Up @@ -276,9 +276,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, command, *privilege*) for invoke command
#define GENERATED_ACCESS_INVOKE_COMMAND__PRIVILEGE { \
Expand Down Expand Up @@ -309,11 +309,11 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

////////////////////////////////////////////////////////////////////////////////

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (*cluster*, event, privilege) for read event
#define GENERATED_ACCESS_READ_EVENT__CLUSTER { \
Expand Down Expand Up @@ -344,9 +344,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, *event*, privilege) for read event
#define GENERATED_ACCESS_READ_EVENT__EVENT { \
Expand Down Expand Up @@ -377,9 +377,9 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

{{#chip_server_clusters}}
{{#all_user_clusters side='server'}}
{{#first}}
// Parallel array data (cluster, event, *privilege*) for read event
#define GENERATED_ACCESS_READ_EVENT__PRIVILEGE { \
Expand Down Expand Up @@ -410,7 +410,7 @@
{{#last}}
}
{{/last}}
{{/chip_server_clusters}}
{{/all_user_clusters}}

////////////////////////////////////////////////////////////////////////////////

Expand Down
4 changes: 2 additions & 2 deletions src/controller/java/templates/CHIPClustersWrite-JNI.zapt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{> header}}
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
#include <jni/CHIPCallbackTypes.h>
#include <jni/CHIPReadCallbacks.h>
#include "CHIPInvokeCallbacks.h"
Expand Down Expand Up @@ -78,6 +78,6 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase na
{{/if_unsupported_attribute_callback}}
{{/zcl_attributes_server}}
{{/all_user_clusters}}
{{/if}}
{{/if_enabled_clusters}}

#pragma clang diagnostic pop
4 changes: 2 additions & 2 deletions src/controller/java/templates/CHIPInvokeCallbacks.zapt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{> header}}
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
#include <jni/CHIPCallbackTypes.h>

#include <app-common/zap-generated/cluster-objects.h>
Expand All @@ -26,4 +26,4 @@ private:
{{/zcl_commands_source_server}}
{{/all_user_clusters}}
} // namespace chip
{{/if}}
{{/if_enabled_clusters}}
4 changes: 2 additions & 2 deletions src/controller/java/templates/CHIPReadCallbacks-src.zapt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{> header}}
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
#include <jni/CHIPReadCallbacks.h>

#include <zap-generated/CHIPClientCallbacks.h>
Expand Down Expand Up @@ -175,4 +175,4 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb
{{/zcl_attributes_server}}
{{/all_user_clusters}}

{{/if}}
{{/if_enabled_clusters}}
4 changes: 2 additions & 2 deletions src/controller/java/templates/ChipClusters-java.zapt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{> header}}
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}

package chip.devicecontroller;

Expand Down Expand Up @@ -247,4 +247,4 @@ public class ChipClusters {
{{/not_last}}
{{/all_user_clusters}}
}
{{/if}}
{{/if_enabled_clusters}}
8 changes: 4 additions & 4 deletions src/controller/java/templates/ChipEventStructs-java.zapt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{> header}}
package chip.devicecontroller;

{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Optional;
{{/if}}
{{/if_enabled_clusters}}

{{! TODO: Use AutoValue for inner classes. }}
public class ChipEventStructs {
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
{{#all_user_clusters side='client'}}
{{#zcl_events}}
public static class {{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Event {
Expand Down Expand Up @@ -55,5 +55,5 @@ public {{asJavaType type null parent.parent.name includeAnnotations=true}} {{asL

{{/zcl_events}}
{{/all_user_clusters}}
{{/if}}
{{/if_enabled_clusters}}
}
8 changes: 4 additions & 4 deletions src/controller/java/templates/ChipIdLookup-java.zapt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{> header}}
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}

package chip.devicecontroller;

Expand Down Expand Up @@ -42,15 +42,15 @@ public final class ChipIdLookup {
public static String eventIdToName(long clusterId, long eventId) {
{{#all_user_clusters side='client'}}
if (clusterId == {{code}}L) {
{{#chip_server_cluster_events}}
{{#zcl_events}}
if (eventId == {{code}}L) {
return "{{asUpperCamelCase name}}";
}
{{/chip_server_cluster_events}}
{{/zcl_events}}
return "";
}
{{/all_user_clusters}}
return "";
}
}
{{/if}}
{{/if_enabled_clusters}}
8 changes: 4 additions & 4 deletions src/controller/java/templates/ChipStructs-java.zapt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{> header}}
package chip.devicecontroller;

{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Optional;
{{/if}}
{{/if_enabled_clusters}}

{{! TODO: Use AutoValue for inner classes. }}
public class ChipStructs {
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}
{{#all_user_clusters side='client'}}
{{#zcl_structs}}
{{#if itemCnt}}
Expand Down Expand Up @@ -53,5 +53,5 @@ public {{asJavaType type null parent.parent.name includeAnnotations=true}} {{asL

{{/zcl_structs}}
{{/all_user_clusters}}
{{/if}}
{{/if_enabled_clusters}}
}
4 changes: 2 additions & 2 deletions src/controller/java/templates/ClusterInfo-java.zapt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{> header}}
{{#if (chip_has_client_clusters)}}
{{#if_enabled_clusters side='client'}}

package chip.devicecontroller;

Expand Down Expand Up @@ -373,4 +373,4 @@ public class ClusterInfoMapping {

}

{{/if}}
{{/if_enabled_clusters}}

0 comments on commit 1824880

Please sign in to comment.