blob: 55cd007cf195f7e4dc1bbaf4ef989e25f5176958 [file] [log] [blame]
{{> header}}
package chip.devicecontroller;
public final class ChipIdLookup {
/**
* Translates cluster ID to a cluster name in upper camel case. If no matching
* ID is found, returns an empty string.
*/
public static String clusterIdToName(long clusterId) {
{{#zcl_clusters}}
if (clusterId == {{code}}L) {
return "{{asUpperCamelCase name}}";
}
{{/zcl_clusters}}
return "";
}
/**
* Translates cluster ID and attribute ID to an attribute name in upper camel case.
* If no matching IDs are found, returns an empty string.
*/
public static String attributeIdToName(long clusterId, long attributeId) {
{{#zcl_clusters}}
if (clusterId == {{code}}L) {
{{#zcl_attributes_server}}
if (attributeId == {{code}}L) {
return "{{asUpperCamelCase name}}";
}
{{/zcl_attributes_server}}
return "";
}
{{/zcl_clusters}}
return "";
}
/**
* Translates cluster ID and event ID to an attribute name in upper camel case.
* If no matching IDs are found, returns an empty string.
*/
public static String eventIdToName(long clusterId, long eventId) {
{{#zcl_clusters}}
if (clusterId == {{code}}L) {
{{#zcl_events}}
if (eventId == {{code}}L) {
return "{{asUpperCamelCase name}}";
}
{{/zcl_events}}
return "";
}
{{/zcl_clusters}}
return "";
}
}