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

Create a block helper to iterate over the ZCL Baseline Types: #1472

Conversation

brdandu
Copy link
Collaborator

@brdandu brdandu commented Oct 25, 2024

  • Add zcl_baseline_types to go over baseline types found from atomic data types
  • Add additional is_power_of_two helper for matter use case to determine odd sized data types
  • update the atomic table schema, retrieval and mapping
  • Add unit tests with the example needed for Matter code
  • update feature level pointer
  • Updating the zap schema
  • Github: ZAP#1438

Comment on lines 312 to 313
(a.$.name.toLowerCase().includes('long') &&
a.$.name.toLowerCase().includes('string')),
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it would trigger on names like "stringorlong"....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

src-electron/zcl/zcl-loader-silabs.js Outdated Show resolved Hide resolved
src-electron/zcl/zcl-loader-silabs.js Outdated Show resolved Hide resolved
test/gen-matter-1.test.js Outdated Show resolved Hide resolved
test/gen-template/matter/simple-test.zapt Outdated Show resolved Hide resolved
@@ -596,6 +596,9 @@ CREATE TABLE IF NOT EXISTS "ATOMIC" (
"IS_LONG" integer default false,
"IS_CHAR" integer default false,
"IS_SIGNED" integer default false,
"IS_COMPOSITE" integer default false,
"IS_FLOAT" integer default false,
"BASE_TYPE" text,
Copy link
Contributor

Choose a reason for hiding this comment

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

This allows BASE_TYPE to be null? Or if not, how is "no base type" represented? Empty string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will be null in this case.

* @param {*} val
* @returns boolean
*/
function is_power_of_two(val) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems completerly unrelated to the base type stuff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it is not needed but is useful for determining odd sized data types in the future.

@brdandu brdandu force-pushed the feature/createZClBaseLineTypeHelper/ZAP#1438 branch from 39c5c6f to 8068758 Compare October 29, 2024 13:37
@brdandu brdandu force-pushed the feature/createZClBaseLineTypeHelper/ZAP#1438 branch from 8068758 to 5e9696a Compare October 29, 2024 18:34
…ine odd sized data types

- update the atomic table schema, retrieval and mapping
- Add unit tests with the example needed for Matter code
- update feature level pointer
- Updating the zap schema
- Adding support to determine if a data type is baseline type or not from the xml itself
- This is done by adding BASE_TYPE column to the atomic table and then mapping it appropriately to baseType for the zcl_atomics helper
- Adding base types for derived types in the atomic xml file
- This is done by adding baseType column to the atomic table and then mapping it appropriately to baseType for the zcl_atomics helper such that derived types can refer to base types
Cleanup
- Github: ZAP#1438
@brdandu brdandu force-pushed the feature/createZClBaseLineTypeHelper/ZAP#1438 branch from 5e9696a to 7386854 Compare October 29, 2024 19:13
@brdandu brdandu merged commit baa3034 into project-chip:master Oct 29, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need a way to classify types based on their "base type"
4 participants