| {{> header excludeZapComment=true}} |
| |
| #import <Foundation/Foundation.h> |
| #import <stdint.h> |
| |
| #pragma mark - Clusters IDs |
| |
| typedef NS_ENUM(uint32_t, MTRClusterIDType) { |
| {{#zcl_clusters}} |
| {{#if (wasIntroducedBeforeRelease "First major API revamp" (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}} |
| {{~#*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}}, |
| {{/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}} |
| MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttribute=(asUpperCamelCase label) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, |
| {{/unless}} |
| {{/zcl_attributes_server}} |
| |
| {{#zcl_clusters}} |
| {{#*inline "attributeIDs"}} |
| {{#zcl_attributes_server}} |
| {{#first}} |
| {{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} |
| // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated attribute names |
| {{/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 (wasIntroducedBeforeRelease "First major API revamp" (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}} |
| // Cluster {{> cluster}} attributes |
| {{/first}} |
| 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}} |
| {{#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)}} |
| // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated command id names |
| {{/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) |
| (not (wasRemoved 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}} |
| // Cluster {{>cluster}} commands |
| {{/first}} |
| {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} |
| {{#*inline "commandIdDecl"}} |
| {{#unless (wasRemoved cluster command=command isForIds=true)}} |
| MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{availability cluster command=command minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, |
| {{/unless}} |
| {{/inline}} |
| {{> commandIdDecl cluster=(asUpperCamelCase ../clusterName preserveAcronyms=true) |
| command=(asUpperCamelCase name preserveAcronyms=true)}} |
| {{#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)}} |
| // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated event names |
| {{/if}} |
| {{/first}} |
| {{#if (wasIntroducedBeforeRelease "First major API revamp" (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}} |
| // Cluster {{>cluster}} events |
| {{/first}} |
| 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}}, |
| {{#last}} |
| |
| {{/last}} |
| {{/zcl_events}} |
| {{/inline}} |
| |
| {{> eventIDs clusterName=label}} |
| {{/zcl_clusters}} |
| }; |