-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Darwin framework: add new header generation for cluster/attribute/com…
…mand/event IDs to expose in darwin public framework (#18172) Issue #18164 - Need obj-c friendly constants header for cluster/attribute/command/event IDs
- Loading branch information
1 parent
3d4649a
commit 2845221
Showing
8 changed files
with
2,704 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zap-generated/MatterClusterConstants.h |
76 changes: 76 additions & 0 deletions
76
src/darwin/Framework/CHIP/templates/MatterClusterConstants.zapt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{{> header}} | ||
|
||
#ifndef MATTER_CLUSTER_CONSTANTS_H | ||
#define MATTER_CLUSTER_CONSTANTS_H | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <stdint.h> | ||
|
||
#pragma mark - Clusters IDs | ||
|
||
typedef NS_ENUM(uint32_t, MatterClusterIDType) { | ||
{{#zcl_clusters}} | ||
kMatterCluster{{asUpperCamelCase label}}ID = {{asMEI manufacturerCode code}}, | ||
{{/zcl_clusters}} | ||
}; | ||
|
||
#pragma mark - Attributes IDs | ||
|
||
typedef NS_ENUM(uint32_t, MatterClusterAttributeIDType) { | ||
// Global attributes | ||
{{#zcl_attributes_server}} | ||
{{#unless clusterRef}} | ||
kMatterClusterGlobalAttribute{{asUpperCamelCase label}}ID = {{asMEI manufacturerCode code}}, | ||
{{/unless}} | ||
{{/zcl_attributes_server}} | ||
|
||
{{#zcl_clusters}} | ||
{{#zcl_attributes_server}} | ||
{{#first}} | ||
// Cluster {{asUpperCamelCase parent.label}} attributes | ||
{{/first}} | ||
{{#if clusterRef}} | ||
kMatterCluster{{asUpperCamelCase parent.label}}Attribute{{asUpperCamelCase label}}ID = {{asMEI manufacturerCode code}}, | ||
{{else}} | ||
kMatterCluster{{asUpperCamelCase parent.label}}Attribute{{asUpperCamelCase label}}ID = kMatterClusterGlobalAttribute{{asUpperCamelCase label}}ID, | ||
{{/if}} | ||
{{#last}} | ||
|
||
{{/last}} | ||
{{/zcl_attributes_server}} | ||
{{/zcl_clusters}} | ||
}; | ||
|
||
#pragma mark - Commands IDs | ||
|
||
typedef NS_ENUM(uint32_t, MatterClusterCommandIDType) { | ||
{{#zcl_clusters}} | ||
{{#zcl_commands}} | ||
{{#first}} | ||
// Cluster {{asUpperCamelCase parent.label}} commands | ||
{{/first}} | ||
kMatterCluster{{asUpperCamelCase parent.label}}Command{{asUpperCamelCase label}}ID = {{asMEI manufacturerCode code}}, | ||
{{#last}} | ||
|
||
{{/last}} | ||
{{/zcl_commands}} | ||
{{/zcl_clusters}} | ||
}; | ||
|
||
#pragma mark - Events IDs | ||
|
||
typedef NS_ENUM(uint32_t, MatterClusterEventIDType) { | ||
{{#zcl_clusters}} | ||
{{#zcl_events}} | ||
{{#first}} | ||
// Cluster {{asUpperCamelCase parent.label}} events | ||
{{/first}} | ||
kMatterCluster{{asUpperCamelCase parent.label}}Event{{asUpperCamelCase name}}ID = {{asMEI manufacturerCode code}}, | ||
{{#last}} | ||
|
||
{{/last}} | ||
{{/zcl_events}} | ||
{{/zcl_clusters}} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.