-
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.
Add methods for doing schema checks on response-value command payload…
… dictionaries. (#26586) * Add methods for doing schema checks on response-value command payload dictionaries. This adds a way to initialize strongly typed command response structs with a response-value dictionary representing a command response. * Fix typo in error message. Co-authored-by: Karsten Sperling <[email protected]> --------- Co-authored-by: Karsten Sperling <[email protected]>
- Loading branch information
Showing
14 changed files
with
5,944 additions
and
1,396 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
26 changes: 26 additions & 0 deletions
26
src/darwin/Framework/CHIP/templates/MTRCommandPayloads_Internal.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,26 @@ | ||
{{> header excludeZapComment=true}} | ||
|
||
#import <Matter/MTRDefines.h> | ||
|
||
#include <app-common/zap-generated/cluster-objects.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
{{#zcl_clusters}} | ||
{{#zcl_commands}} | ||
{{! We only need to generate conversion functions for the server-generated commands }} | ||
{{#if (isStrEqual source "server")}} | ||
{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForCommandPayload=true)}} | ||
|
||
@interface MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params (InternalMethods) | ||
|
||
- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &)decodableStruct; | ||
|
||
@end | ||
|
||
{{/if}} | ||
{{/if}} | ||
{{/zcl_commands}} | ||
{{/zcl_clusters}} | ||
|
||
NS_ASSUME_NONNULL_END |
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
Oops, something went wrong.