Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove asChipUnderlyingType helper #8062

Merged

Conversation

vivien-apple
Copy link
Contributor

Problem

In many places into our templates {{asUnderlyingZclType type}} is used to retrieve which types should be used for the signature of methods. But it does not return the proper type for octet_string nor long_octet_string at the moment so there in many places the code has been written such as:

{{#if (isOctetString type)}}chip::ByteSpan{{else}}{{asUnderlyingZclType type}}{{/if}}

This PR adds octet_string and long_octet_string to override.js so the code can be rewritten such as:

{{asUnderlyingZclType type}}

And in a few other places, the code assume that octet_string means the chip::ByteSpan class which is not very convenient if at some point this type needs to be updated...

Change overview

  • Return the expected type into override.js
  • Clean up the places where {{#if (isOctetString type)}} is useless now

Testing

The only code changes that is generated is ATTRIBUTE_ID -> ATTRIB_ID into a comment. So nothing has really changed.

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So nice to see all that conditional junk go away!

@woody-apple woody-apple merged commit 0c867f3 into project-chip:master Jul 3, 2021
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
* Remove asChipUnderlyingType helper

* Update gen/ folders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants