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

Add custom ZCL extensions inside src/app/zap-templates #4192

Conversation

vivien-apple
Copy link
Contributor

Problem

This PR introduces a folder inside src/app/zap-templates to host custom
ZCL extensions such as the MfgSpecificPing command introduced in #4127 as
well as the Binding Cluster from #4156.

The Binding Cluster exposes 2 methods, Bind and Unbind. The current spec
defines bindings has an RW attribute but an issue has been opened since it does
not look very convenient (see https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/627)

The gen/ folders are also updated to reflect the addition of the Binding Cluster.

Futhermore, the 2 scripts used to generates the gen/ folders have also been updated to
points to the src/app/zap-templates/zcl/zcl.json instead of third_party/zap/repo/zcl-builtin/silabs/zcl.json
since the former is a superset of the later.

Comment on lines +4473 to +4477
#define ZCL_CLUSTER_REVISION_CLIENT_ATTRIBUTE_ID (0xFFFD)
#define ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID (0xFFFE)

// Server attributes
#define ZCL_CLUSTER_REVISION_SERVER_ATTRIBUTE_ID (0xFFFD)
#define ZCL_REPORTING_STATUS_SERVER_ATTRIBUTE_ID (0xFFFE)
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is duplicating values for other clusters?

Could we just define the "global" attribute ids that are the same for all clusters once? Followup for this, please.

Also, in CHIP, I don't see a "reporting status" attribute. What I do see is a "FeatureMap" attribute with ID 0xFFFC. Again, followup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is duplicating values for other clusters?

Could we just define the "global" attribute ids that are the same for all clusters once? Followup for this, please.

I opened #4219 for this one (with a patch).

vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 15, 2020
…and 'src/app/chip-zcl-zpro-codec-api.h'

Problem

So far `src/app/chip-zcl-zpro-codec-api.h` and `src/app/encoder.cpp` has been generated
using times to times by manually adding the related templates to to the `chip-templates.json` and
removing it before checking-in the code since this code does not really belongs to application folders.

It is error prone. An in fact I broken it with project-chip#4155 since attributes appears multiple times because of
the second endpoint.

This PR splits the `zap-templates` folder in two, with one folder for the examples and one fodler for
chip related code.

Summary of changes
 * Split `zap-templates` folder in two
 * Split `helper-chip.js` into multiple helpers and move those helpers where they belongs
 * Add a new `scripts/tools/zap_generate_chip.sh` script to generate the `src/app` content
 * Add `scripts/tools/zap_generate_chip.sh` to `scripts/tools/zap_regen_all.py`
 * Create a partial for the licensing `header` instead of relying on js for it
 * Fix the attribute issue mentioned above
 * Remove `asChipUnderlyingType` since it relies on `asUnderlyingZclType` and we should be able to fix the issue directly once project-chip#4192 lands and it really does not introduce any problem to remove it
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 15, 2020
…and 'src/app/chip-zcl-zpro-codec-api.h'

Problem

So far `src/app/chip-zcl-zpro-codec-api.h` and `src/app/encoder.cpp` has been generated
using times to times by manually adding the related templates to to the `chip-templates.json` and
removing it before checking-in the code since this code does not really belongs to application folders.

It is error prone. An in fact I broken it with project-chip#4155 since attributes appears multiple times because of
the second endpoint.

This PR splits the `zap-templates` folder in two, with one folder for the examples and one fodler for
chip related code.

Summary of changes
 * Split `zap-templates` folder in two
 * Split `helper-chip.js` into multiple helpers and move those helpers where they belongs
 * Add a new `scripts/tools/zap_generate_chip.sh` script to generate the `src/app` content
 * Add `scripts/tools/zap_generate_chip.sh` to `scripts/tools/zap_regen_all.py`
 * Create a partial for the licensing `header` instead of relying on js for it
 * Fix the attribute issue mentioned above
 * Remove `asChipUnderlyingType` since it relies on `asUnderlyingZclType` and we should be able to fix the issue directly once project-chip#4192 lands and it really does not introduce any problem to remove it
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 15, 2020
…and 'src/app/chip-zcl-zpro-codec-api.h'

Problem

So far `src/app/chip-zcl-zpro-codec-api.h` and `src/app/encoder.cpp` has been generated
using times to times by manually adding the related templates to to the `chip-templates.json` and
removing it before checking-in the code since this code does not really belongs to application folders.

It is error prone. An in fact I broken it with project-chip#4155 since attributes appears multiple times because of
the second endpoint.

This PR splits the `zap-templates` folder in two, with one folder for the examples and one fodler for
chip related code.

Summary of changes
 * Split `zap-templates` folder in two
 * Split `helper-chip.js` into multiple helpers and move those helpers where they belongs
 * Add a new `scripts/tools/zap_generate_chip.sh` script to generate the `src/app` content
 * Add `scripts/tools/zap_generate_chip.sh` to `scripts/tools/zap_regen_all.py`
 * Create a partial for the licensing `header` instead of relying on js for it
 * Fix the attribute issue mentioned above
 * Remove `asChipUnderlyingType` since it relies on `asUnderlyingZclType` and we should be able to fix the issue directly once project-chip#4192 lands and it really does not introduce any problem to remove it
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 16, 2020
…and 'src/app/chip-zcl-zpro-codec-api.h'

Problem

So far `src/app/chip-zcl-zpro-codec-api.h` and `src/app/encoder.cpp` has been generated
using times to times by manually adding the related templates to to the `chip-templates.json` and
removing it before checking-in the code since this code does not really belongs to application folders.

It is error prone. An in fact I broken it with project-chip#4155 since attributes appears multiple times because of
the second endpoint.

This PR splits the `zap-templates` folder in two, with one folder for the examples and one fodler for
chip related code.

Summary of changes
 * Split `zap-templates` folder in two
 * Split `helper-chip.js` into multiple helpers and move those helpers where they belongs
 * Add a new `scripts/tools/zap_generate_chip.sh` script to generate the `src/app` content
 * Add `scripts/tools/zap_generate_chip.sh` to `scripts/tools/zap_regen_all.py`
 * Create a partial for the licensing `header` instead of relying on js for it
 * Fix the attribute issue mentioned above
 * Remove `asChipUnderlyingType` since it relies on `asUnderlyingZclType` and we should be able to fix the issue directly once project-chip#4192 lands and it really does not introduce any problem to remove it
mspang pushed a commit that referenced this pull request Jan 6, 2021
…and 'src/app/chip-zcl-zpro-codec-api.h' (#4212)

Problem

So far `src/app/chip-zcl-zpro-codec-api.h` and `src/app/encoder.cpp` has been generated
using times to times by manually adding the related templates to to the `chip-templates.json` and
removing it before checking-in the code since this code does not really belongs to application folders.

It is error prone. An in fact I broken it with #4155 since attributes appears multiple times because of
the second endpoint.

This PR splits the `zap-templates` folder in two, with one folder for the examples and one fodler for
chip related code.

Summary of changes
 * Split `zap-templates` folder in two
 * Split `helper-chip.js` into multiple helpers and move those helpers where they belongs
 * Add a new `scripts/tools/zap_generate_chip.sh` script to generate the `src/app` content
 * Add `scripts/tools/zap_generate_chip.sh` to `scripts/tools/zap_regen_all.py`
 * Create a partial for the licensing `header` instead of relying on js for it
 * Fix the attribute issue mentioned above
 * Remove `asChipUnderlyingType` since it relies on `asUnderlyingZclType` and we should be able to fix the issue directly once #4192 lands and it really does not introduce any problem to remove it
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
@BroderickCarlin BroderickCarlin merged commit f6676ec into project-chip:master Jan 8, 2021
kpschoedel pushed a commit to kpschoedel/connectedhomeip that referenced this pull request Jan 8, 2021
…and 'src/app/chip-zcl-zpro-codec-api.h' (project-chip#4212)

Problem

So far `src/app/chip-zcl-zpro-codec-api.h` and `src/app/encoder.cpp` has been generated
using times to times by manually adding the related templates to to the `chip-templates.json` and
removing it before checking-in the code since this code does not really belongs to application folders.

It is error prone. An in fact I broken it with project-chip#4155 since attributes appears multiple times because of
the second endpoint.

This PR splits the `zap-templates` folder in two, with one folder for the examples and one fodler for
chip related code.

Summary of changes
 * Split `zap-templates` folder in two
 * Split `helper-chip.js` into multiple helpers and move those helpers where they belongs
 * Add a new `scripts/tools/zap_generate_chip.sh` script to generate the `src/app` content
 * Add `scripts/tools/zap_generate_chip.sh` to `scripts/tools/zap_regen_all.py`
 * Create a partial for the licensing `header` instead of relying on js for it
 * Fix the attribute issue mentioned above
 * Remove `asChipUnderlyingType` since it relies on `asUnderlyingZclType` and we should be able to fix the issue directly once project-chip#4192 lands and it really does not introduce any problem to remove it
kpschoedel pushed a commit to kpschoedel/connectedhomeip that referenced this pull request Jan 8, 2021
…4192)

This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
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.

5 participants