Skip to content

Commit

Permalink
Update enum decode for cluster object (#10257)
Browse files Browse the repository at this point in the history
* update enum type decode in cluster object

* run codegen
  • Loading branch information
yunhanw-google authored and pull[bot] committed Nov 6, 2021
1 parent e575d24 commit 82fb6ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 31 deletions.
7 changes: 0 additions & 7 deletions src/app/zap-templates/templates/app/cluster-objects-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader &reader) {
{
{{#zcl_struct_items}}
case k{{asUpperCamelCase label}}FieldId:
{{#if_is_enum type}}
uint8_t v;
ReturnErrorOnFailure(DataModel::Decode(reader, v));
{{asLowerCamelCase label}} = static_cast<{{type}}>(v);
break;
{{else}}
ReturnErrorOnFailure(DataModel::Decode(reader, {{asLowerCamelCase label}}));
break;
{{/if_is_enum}}
{{/zcl_struct_items}}
default:
break;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82fb6ad

Please sign in to comment.