Skip to content

Commit

Permalink
Allowing chip-repl test to send invalid enum values (#24352)
Browse files Browse the repository at this point in the history
* Proof of concept for allowing chip-repl test to send invalid enum values

* Prototype after latest round of discussions

* Quick cleanup

* Moving to properly done version

* Couple extra fixes

* Remove unneeded global

* Add lock for placeholder count

* Restyle

* add missing regen to cluster-enums.h after merging master

* Quick fix

* Quick Fix

* Restyle
  • Loading branch information
tehampson authored and pull[bot] committed Aug 1, 2023
1 parent c923d98 commit 1078332
Show file tree
Hide file tree
Showing 7 changed files with 1,550 additions and 438 deletions.
4 changes: 4 additions & 0 deletions src/app/zap-templates/templates/app/cluster-enums.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ enum class {{asType label}} : {{asUnderlyingZclType name}} {
{{#zcl_enum_items}}
k{{asUpperCamelCase label}} = {{asHex value 2}},
{{/zcl_enum_items}}
// All received enum values that are not listed above will be mapped
// to kUnknownEnumValue. This is a helper enum value that should only
// be used by code to process how it handles receiving and unknown
// enum value. This specific should never be transmitted.
kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}},
};
{{#if (isWeaklyTypedEnum label)}}
Expand Down
2 changes: 2 additions & 0 deletions src/controller/python/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ chip_python_wheel_action("chip-core") {
"chip/clusters/Attribute.py",
"chip/clusters/Command.py",
"chip/clusters/__init__.py",
"chip/clusters/enum.py",
"chip/configuration/__init__.py",
"chip/discovery/__init__.py",
"chip/discovery/library_handle.py",
Expand Down Expand Up @@ -289,6 +290,7 @@ chip_python_wheel_action("chip-core") {
}

py_package_reqs = [
"aenum",
"coloredlogs",
"construct",
"dacite",
Expand Down
Loading

0 comments on commit 1078332

Please sign in to comment.