-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing a state helper such as chip_server_cluster_attributes with …
…a stateless helper zcl_attributes_server such that we can get deprecate the stateful helpers one by one. Also deprecating if_basic_global_response with if_basic_attribute. The generation diff that is being seen here pertains to generating all server attributes for the corresponding client clusters instead of hacking the server attributes in the zap file. The hack here referes to how server attributes being generated are those attributes which have been enabled without the corresponding server cluster enabled. To avoid this hack, the code now generates all server attributes for the corresponding client cluster. This seems to be in sync with the non java/python templates in terms of generation. Another generation diff seen here is that there is no basic global response for certain attributes which refer to atomic types such as group_id and vendor_id. I am not sure why that is the case. These attributes seem basic enough. Updating the zap being used - Updating min zap version to 3.16 instead of 3.17 - Github: ZAP#898
- Loading branch information
Showing
22 changed files
with
12,710 additions
and
1,045 deletions.
There are no files selected for viewing
688 changes: 688 additions & 0 deletions
688
src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/controller/java/templates/ClusterInfo-write-interaction.zapt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{{> header}} | ||
{{#if (chip_has_client_clusters)}} | ||
|
||
package chip.devicecontroller; | ||
|
||
import chip.clusterinfo.CommandParameterInfo; | ||
import chip.clusterinfo.InteractionInfo; | ||
import chip.devicecontroller.ChipClusters.DefaultClusterCallback; | ||
import java.util.HashMap; | ||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public class ClusterWriteMapping { | ||
public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() { | ||
Map<String, Map<String, InteractionInfo>> writeAttributeMap = new HashMap<>(); | ||
{{#chip_client_clusters}} | ||
Map<String, InteractionInfo> write{{asUpperCamelCase name}}InteractionInfo = new LinkedHashMap<>(); | ||
{{#zcl_attributes_server removeKeys='isOptional'}} | ||
{{! TODO: Add support for struct-typed attributes }} | ||
{{#if_unsupported_attribute_callback type isArray ../id}} | ||
{{else}} | ||
{{#if isWritableAttribute}} | ||
{{#unless isArray}} | ||
Map<String, CommandParameterInfo> write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap<String, CommandParameterInfo>(); | ||
CommandParameterInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParameterInfo = new CommandParameterInfo("value", {{asJavaType type null parent.parent.name removeGenericType=true}}.class, {{asJavaType type null parent.parent.name underlyingType=true}}.class); | ||
write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams.put("value",{{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParameterInfo); | ||
InteractionInfo write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( | ||
(cluster, callback, commandArguments) -> { | ||
((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).write{{asUpperCamelCase name}}Attribute( | ||
(DefaultClusterCallback) callback, | ||
({{as_underlying_java_zcl_type type ../id boolean="Boolean" isBoxedJavaType=true}}) | ||
commandArguments.get("value") | ||
{{#if mustUseTimedWrite}}, 10000{{/if}} | ||
); | ||
}, | ||
() -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), | ||
write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams | ||
); | ||
write{{asUpperCamelCase ../name}}InteractionInfo.put("write{{asUpperCamelCase name}}Attribute", write{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo); | ||
{{/unless}} | ||
{{/if}} | ||
{{/if_unsupported_attribute_callback}} | ||
{{/zcl_attributes_server}} | ||
writeAttributeMap.put("{{asLowerCamelCase name}}", write{{asUpperCamelCase name}}InteractionInfo); | ||
{{/chip_client_clusters}} | ||
return writeAttributeMap; | ||
} | ||
} | ||
|
||
{{/if}} |
Oops, something went wrong.