blob: 98d6d6b35431b12050188e52d6e90f8d623e7e27 [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 "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name) isForIds=true)
(isSupported (compatClusterNameRemapping name) isForIds=true))}}
MTRCluster{{compatClusterNameRemapping label}}ID {{availability (compatClusterNameRemapping name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" 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="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true deprecationMessage=(concat "The " (asUpperCamelCase label preserveAcronyms=true) " cluster will be removed")}} = {{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 "267F4B03-3256-4056-A62D-5237640FDCFE" "" 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="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{/unless}}
{{/zcl_attributes_server}}
{{#zcl_clusters}}
{{#*inline "attributeIDs"}}
{{#zcl_attributes_server}}
{{#first}}
{{#if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (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="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage="Please use MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID" isForIds=true}}
= {{asMEI manufacturerCode code}},
{{/if}}
{{/if}}
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (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="267F4B03-3256-4056-A62D-5237640FDCFE" 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="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true deprecationMessage=(concat "The " (asUpperCamelCase label preserveAcronyms=true) " attribute will be removed")}} =
{{#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 "27C5E231-9EB5-4932-B4C1-10D88419D9CB" release or later
(or just after the "267F4B03-3256-4056-A62D-5237640FDCFE" 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 "27C5E231-9EB5-4932-B4C1-10D88419D9CB" (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="267F4B03-3256-4056-A62D-5237640FDCFE" 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 "267F4B03-3256-4056-A62D-5237640FDCFE" (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 "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command isForIds=true)
(isSupported cluster command=command isForIds=true))}}
MTRCluster{{cluster}}Command{{command}}ID
{{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" 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="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true deprecationMessage=(concat "The " command " command will be removed")}} = {{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 "27C5E231-9EB5-4932-B4C1-10D88419D9CB" release or later
(or just after the "267F4B03-3256-4056-A62D-5237640FDCFE" 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 "27C5E231-9EB5-4932-B4C1-10D88419D9CB" (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 "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping ../clusterName) isForIds=true)}}
{{#if (isSupported (compatClusterNameRemapping ../clusterName))}}
// Cluster {{compatClusterNameRemapping ../clusterName}} deprecated event names
{{/if}}
{{/if}}
{{/first}}
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (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="267F4B03-3256-4056-A62D-5237640FDCFE" 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="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true}} = {{asMEI manufacturerCode code}},
{{/if}}
{{#last}}
{{/last}}
{{/zcl_events}}
{{/inline}}
{{> eventIDs clusterName=label}}
{{/zcl_clusters}}
};