blob: 4432bde2cf240d524a830c8b1b91bf4abd8303bd [file] [log] [blame]
{{> header excludeZapComment=true}}
#import <Matter/MTRDefines.h>
#import <stdint.h>
#pragma mark - Clusters IDs
typedef NS_ENUM(uint32_t, MTRClusterIDType) {
{{#zcl_clusters}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name) isForIds=true)
(isSupported (compatClusterNameRemapping name) isForIds=true))}}
MTRCluster{{compatClusterNameRemapping label}}ID {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRClusterIDType" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{/zcl_clusters}}
{{#zcl_clusters}}
{{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}}
{{~#*inline "cluster"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
MTRClusterIDType{{>cluster}}ID {{availability (asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{/zcl_clusters}}
};
#pragma mark - Attributes IDs
typedef NS_ENUM(uint32_t, MTRAttributeIDType) {
// Deprecated global attribute names
{{#zcl_attributes_server}}
{{#unless clusterRef}}
{{#if (wasIntroducedBeforeRelease "First major API revamp" "" globalAttribute=(asUpperCamelCase label) isForIds=true)}}
MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID
{{availability "" api="Deprecated global attribute names" deprecationMessage=(concat "Please use MTRAttributeIDTypeGlobalAttribute" (asUpperCamelCase label) "ID") isForIds=true}}
= {{asMEI manufacturerCode code}},
{{/if}}
{{/unless}}
{{/zcl_attributes_server}}
// Global attributes
{{#zcl_attributes_server}}
{{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
{{#unless clusterRef}}
{{#if (isSupported "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)}}
MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{/unless}}
{{/zcl_attributes_server}}
{{#zcl_clusters}}
{{#*inline "attributeIDs"}}
{{#zcl_attributes_server}}
{{#first}}
{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}}
{{#if (isSupported (compatClusterNameRemapping ../clusterName) isForIds=true)}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated attribute names
{{/if}}
{{/if}}
{{/first}}
{{! DeviceTypeList is special: we did not call it by that name
anywhere else in the API at the point when we shipped an id for it
here in the old id format but using the new name alongside the old name. }}
{{#if (isStrEqual (asUpperCamelCase ../clusterName) "Descriptor")}}
{{#if (isStrEqual (asUpperCamelCase label) "DeviceTypeList")}}
MTRClusterDescriptorAttributeDeviceTypeListID
{{availability "Descriptor" attribute="DeviceTypeList" deprecatedRelease="First major API revamp" deprecationMessage="Please use MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID" isForIds=true}}
= {{asMEI manufacturerCode code}},
{{/if}}
{{/if}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true)
(isSupported (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true))}}
MTRCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID
{{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRAttributeIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} =
{{#if clusterRef}}
{{asMEI manufacturerCode code}},
{{else}}
MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID,
{{/if}}
{{/if}}
{{#last}}
{{/last}}
{{/zcl_attributes_server}}
{{#zcl_attributes_server}}
{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}}
{{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}}
{{#first}}
{{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) isForIds=true)}}
// Cluster {{> cluster}} attributes
{{/if}}
{{/first}}
{{#if (and (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)
(or clusterRef
(isSupported "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)))}}
MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} =
{{#if clusterRef}}
{{asMEI manufacturerCode code}},
{{else}}
MTRAttributeIDTypeGlobalAttribute{{asUpperCamelCase label}}ID,
{{/if}}
{{/if}}
{{! Anything which has an old name, and the new name was introduced in the "First after major API revamp" release or later
(or just after the "First major API revamp" release, but we don't have a good way to test for that),
we need to generate the new-form id for the old name too, as long as it was not removed. }}
{{#if (and (hasOldName (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)
(not (wasIntroducedBeforeRelease "First after major API revamp" (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true))
(isSupported (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true))}}
MTRAttributeIDTypeCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID {{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true minimalRelease="First major API revamp" deprecationMessage=(concat "Please use MTRAttributeIDType" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID")}} = MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}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}}
{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}}
{{#if (isSupported (compatClusterNameRemapping ../clusterName) isForIds=true)}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated command id names
{{/if}}
{{/if}}
{{/first}}
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandIdDecl"}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command isForIds=true)
(isSupported cluster command=command isForIds=true))}}
MTRCluster{{cluster}}Command{{command}}ID
{{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRCommandIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Command" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}}
= {{asMEI manufacturerCode code}},
{{/if}}
{{/inline}}
{{> commandIdDecl cluster=(compatClusterNameRemapping ../clusterName)
command=(compatCommandNameRemapping ../clusterName name)}}
{{#last}}
{{/last}}
{{/zcl_commands}}
{{#zcl_commands}}
{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}}
{{#first}}
{{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) isForIds=true)}}
// Cluster {{>cluster}} commands
{{/if}}
{{/first}}
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandIdDecl"}}
{{#if (isSupported cluster command=command isForIds=true)}}
MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{availability cluster command=command minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{/inline}}
{{> commandIdDecl cluster=(asUpperCamelCase ../clusterName preserveAcronyms=true)
command=(asUpperCamelCase name preserveAcronyms=true)}}
{{! Anything which has an old name, and the new name was introduced in the "First after major API revamp" release or later
(or just after the "First major API revamp" release, but we don't have a good way to test for that),
we need to generate the new-form id for the old name too, as long as it was not removed. }}
{{#if (and (hasOldName (asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)
(not (wasIntroducedBeforeRelease "First after major API revamp" (asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true))
(isSupported (compatClusterNameRemapping ../clusterName) command=(compatCommandNameRemapping ../clusterName name) isForIds=true))}}
{{> commandIdDecl cluster=(compatClusterNameRemapping ../clusterName)
command=(compatCommandNameRemapping ../clusterName name)}}
{{/if}}
{{#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}}
{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}}
{{#if (isSupported (compatClusterNameRemapping ../clusterName))}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated event names
{{/if}}
{{/if}}
{{/first}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true)
(isSupported (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true))}}
MTRCluster{{compatClusterNameRemapping ../clusterName}}Event{{asUpperCamelCase name}}ID
{{availability (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTREventIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Event" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}}
= {{asMEI manufacturerCode code}},
{{/if}}
{{#last}}
{{/last}}
{{/zcl_events}}
{{#zcl_events}}
{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}}
{{~#*inline "event"}}{{asUpperCamelCase name preserveAcronyms=true}}{{/inline~}}
{{#first}}
{{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true))}}
// Cluster {{>cluster}} events
{{/if}}
{{/first}}
{{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)}}
MTREventIDTypeCluster{{>cluster}}Event{{>event}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{#last}}
{{/last}}
{{/zcl_events}}
{{/inline}}
{{> eventIDs clusterName=label}}
{{/zcl_clusters}}
};