blob: 0fdc8ebf367d7821b35e751c018b5b7d1fee7d71 [file] [log] [blame]
{{> header excludeZapComment=true}}
#import <Foundation/Foundation.h>
#import <stdint.h>
#pragma mark - Clusters IDs
typedef NS_ENUM(uint32_t, MTRClusterIDType) {
{{#zcl_clusters}}
MTRCluster{{compatClusterNameRemapping label}}ID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDType{{asUpperCamelCase label}}ID")= {{asMEI manufacturerCode code}},
{{/zcl_clusters}}
{{#zcl_clusters}}
{{~#*inline "cluster"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
MTRClusterIDType{{>cluster}}ID MTR_NEWLY_AVAILABLE = {{asMEI manufacturerCode code}},
{{/zcl_clusters}}
};
#pragma mark - Attributes IDs
typedef NS_ENUM(uint32_t, MTRAttributeIDType) {
// Deprecated global attribute names
{{#zcl_attributes_server}}
{{#unless clusterRef}}
MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID
MTR_NEWLY_DEPRECATED("Please use MTRAttributeIDTypeGlobalAttribute{{asUpperCamelCase label}}ID")
= {{asMEI manufacturerCode code}},
{{/unless}}
{{/zcl_attributes_server}}
// Global attributes
{{#zcl_attributes_server}}
{{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
{{#unless clusterRef}}
MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID MTR_NEWLY_AVAILABLE = {{asMEI manufacturerCode code}},
{{/unless}}
{{/zcl_attributes_server}}
{{#zcl_clusters}}
{{#*inline "attributeIDs"}}
{{#zcl_attributes_server}}
{{#first}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated attribute names
{{/first}}
{{#if clusterRef}}
{{! TODO: We need a better setup for the API_AVAILABLE annotations here; this does not scale at all sanely. }}
MTRCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{asUpperCamelCase label}}ID
MTR_NEWLY_DEPRECATED("Please use MTRAttributeIDTypeCluster{{asUpperCamelCase ../clusterName}}Attribute{{asUpperCamelCase label}}ID")
{{#if (isStrEqual (asUpperCamelCase ../clusterName) "Descriptor")}}
{{#if (isStrEqual (asUpperCamelCase label) "DeviceTypeList")}}
API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2))
{{/if}}
{{/if}}
= {{asMEI manufacturerCode code}},
{{!Backwards compat for now: DeviceList as an alias for DeviceTypeList}}
{{#if (isStrEqual (asUpperCamelCase ../clusterName) "Descriptor")}}
{{#if (isStrEqual (asUpperCamelCase label) "DeviceTypeList")}}
MTRClusterDescriptorAttributeDeviceListID MTR_NEWLY_DEPRECATED("Please use MTRAttributeIDTypeCluster{{asUpperCamelCase ../clusterName}}Attribute{{asUpperCamelCase label}}ID") = {{asMEI manufacturerCode code}},
{{/if}}
{{/if}}
{{else}}
MTRCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{asUpperCamelCase label}}ID MTR_NEWLY_DEPRECATED("Please use MTRAttributeIDTypeCluster{{asUpperCamelCase parent.label}}Attribute{{asUpperCamelCase label}}ID") = MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID,
{{/if}}
{{#last}}
{{/last}}
{{/zcl_attributes_server}}
{{#zcl_attributes_server}}
{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}}
{{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
{{#first}}
// Cluster {{> cluster}} attributes
{{/first}}
{{#if clusterRef}}
MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID MTR_NEWLY_AVAILABLE = {{asMEI manufacturerCode code}},
{{else}}
MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID MTR_NEWLY_AVAILABLE= MTRAttributeIDTypeGlobalAttribute{{asUpperCamelCase label}}ID,
{{/if}}
{{#last}}
{{/last}}
{{/zcl_attributes_server}}
{{/inline}}
{{> attributeIDs clusterName=label}}
{{/zcl_clusters}}
};
#pragma mark - Commands IDs
typedef NS_ENUM(uint32_t, MTRCommandIDType) {
{{#zcl_clusters}}
{{#*inline "commandIDs"}}
{{#zcl_commands}}
{{#first}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated command id names
{{/first}}
MTRCluster{{compatClusterNameRemapping ../clusterName}}Command{{asUpperCamelCase label}}ID
MTR_NEWLY_DEPRECATED("Please use MTRCommandIDTypeCluster{{asUpperCamelCase ../clusterName}}Command{{asUpperCamelCase label}}ID")
= {{asMEI manufacturerCode code}},
{{#last}}
{{/last}}
{{/zcl_commands}}
{{#zcl_commands}}
{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}}
{{~#*inline "command"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
{{#first}}
// Cluster {{>cluster}} commands
{{/first}}
MTRCommandIDTypeCluster{{>cluster}}Command{{>command}}ID MTR_NEWLY_AVAILABLE = {{asMEI manufacturerCode code}},
{{#last}}
{{/last}}
{{/zcl_commands}}
{{/inline}}
{{> commandIDs clusterName=label}}
{{/zcl_clusters}}
};
#pragma mark - Events IDs
typedef NS_ENUM(uint32_t, MTREventIDType) {
{{#zcl_clusters}}
{{#*inline "eventIDs"}}
{{#zcl_events}}
{{#first}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated event names
{{/first}}
MTRCluster{{compatClusterNameRemapping ../clusterName}}Event{{asUpperCamelCase name}}ID
MTR_NEWLY_DEPRECATED("Please use MTREventIDTypeCluster{{asUpperCamelCase ../clusterName}}Event{{asUpperCamelCase name}}ID")
= {{asMEI manufacturerCode code}},
{{#last}}
{{/last}}
{{/zcl_events}}
{{#zcl_events}}
{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}}
{{~#*inline "event"}}{{asUpperCamelCase name preserveAcronyms=true}}{{/inline~}}
{{#first}}
// Cluster {{>cluster}} events
{{/first}}
MTREventIDTypeCluster{{>cluster}}Event{{>event}}ID MTR_NEWLY_AVAILABLE = {{asMEI manufacturerCode code}},
{{#last}}
{{/last}}
{{/zcl_events}}
{{/inline}}
{{> eventIDs clusterName=label}}
{{/zcl_clusters}}
};