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

Integrate ZAP in examples #3464

Closed

Conversation

jepenven-silabs
Copy link
Contributor

Problem

ZCL code under the /gen/ folder came from Appbuilder a Silabs tools. Since it has been decided that ZAP would be the primary tool used to generate ZCL configuration, those generated file needed an update once the ZAP tool was completed. Since code generation for CHIP is almost completely available in zap (all files are generated except the endpoint_config.h which is still a work in progress) it was time to merge the generated file from zap inside the CHIP repo.

Summary of Changes

  • Update all generated files inside the /gen/ directory
  • Removed unused files (e.g. znet_bookeeping)
  • Moved function that couldn't be generated to /src/app/
  • Update build files for all examples

Fixes #1733

@jepenven-silabs
Copy link
Contributor Author

@vivien-apple The work I was telling you about

@rwalker-apple
Copy link
Contributor

can the relevant source .zap file be included for each of these?

@jepenven-silabs
Copy link
Contributor Author

can the relevant source .zap file be included for each of these?

@rwalker-apple Good idea, I'll put them inside /third_party/zap/

@rwalker-apple
Copy link
Contributor

can the relevant source .zap file be included for each of these?

@rwalker-apple Good idea, I'll put them inside /third_party/zap/

sorry: I meant the lock-app.zap, the source file. as this is source for the application, it would belong with the application source code.

putting zap itself into third_party (as a git module) will make sense too.

@jepenven-silabs
Copy link
Contributor Author

can the relevant source .zap file be included for each of these?

@rwalker-apple Good idea, I'll put them inside /third_party/zap/

sorry: I meant the lock-app.zap, the source file. as this is source for the application, it would belong with the application source code.

putting zap itself into third_party (as a git module) will make sense too.

So moving the .zap file to the src folder for each example instead of it being inside the /gen/ folder. Then adding zap as a submodule.

@andy31415
Copy link
Contributor

can the relevant source .zap file be included for each of these?

@rwalker-apple Good idea, I'll put them inside /third_party/zap/

sorry: I meant the lock-app.zap, the source file. as this is source for the application, it would belong with the application source code.
putting zap itself into third_party (as a git module) will make sense too.

So moving the .zap file to the src folder for each example instead of it being inside the /gen/ folder. Then adding zap as a submodule.

Lol @ timinig: I was just looking at adding zap as a submodule as well (had it but am also adding nodejs to the docker integration).

My thinking would be that we want the code generated files to not be part of the repo, but rather generated at build time - I was going to look into what it takes for GN to run code generation automatically.

Do you happen to have some instructions on how these files were generated and how I can reproduce the result using command-line zap?

@vivien-apple
Copy link
Contributor

can the relevant source .zap file be included for each of these?

@rwalker-apple Good idea, I'll put them inside /third_party/zap/

sorry: I meant the lock-app.zap, the source file. as this is source for the application, it would belong with the application source code.
putting zap itself into third_party (as a git module) will make sense too.

So moving the .zap file to the src folder for each example instead of it being inside the /gen/ folder. Then adding zap as a submodule.

Adding the specific .zap files and zapitself as a submodule to generate the gen/* folders directly from the build system would be awesome.

@jepenven-silabs
Copy link
Contributor Author

can the relevant source .zap file be included for each of these?

@rwalker-apple Good idea, I'll put them inside /third_party/zap/

sorry: I meant the lock-app.zap, the source file. as this is source for the application, it would belong with the application source code.
putting zap itself into third_party (as a git module) will make sense too.

So moving the .zap file to the src folder for each example instead of it being inside the /gen/ folder. Then adding zap as a submodule.

Lol @ timinig: I was just looking at adding zap as a submodule as well (had it but am also adding nodejs to the docker integration).

My thinking would be that we want the code generated files to not be part of the repo, but rather generated at build time - I was going to look into what it takes for GN to run code generation automatically.

Do you happen to have some instructions on how these files were generated and how I can reproduce the result using command-line zap?

I was planning on doing a demo soon. I'll update this PR with the zap submodule and the templates and I'll add a short chip-specific How-to in the docs

@andy31415
Copy link
Contributor

Added my pr as #3473 - it changes dockerfile and adds zap into third party.

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.

This doesn't seem to be removing examples/wifi-echo/server/esp32/main/gen/znet-bookkeeping.c unless I am missing it somewhere?

If znet-bookkeeping is gone, does that mean that emberAfMainInitCallback and the other callbacks it called are gone too?

examples/lighting-app/efr32/src/gen/call-command-handler.c Outdated Show resolved Hide resolved
examples/lighting-app/efr32/src/gen/call-command-handler.c Outdated Show resolved Hide resolved
src/app/util/attribute-table.c Show resolved Hide resolved
src/app/util/client-api.h Outdated Show resolved Hide resolved
src/app/util/esi-management.c Outdated Show resolved Hide resolved
src/app/util/process-global-message.cpp Show resolved Hide resolved
src/app/util/process-global-message.cpp Outdated Show resolved Hide resolved
@jepenven-silabs
Copy link
Contributor Author

This doesn't seem to be removing examples/wifi-echo/server/esp32/main/gen/znet-bookkeeping.c unless I am missing it somewhere?

If znet-bookkeeping is gone, does that mean that emberAfMainInitCallback and the other callbacks it called are gone too?

Yes this callback is gone. However it wasn't implemented inside the CHIP repo. It simply was an empty shel with no actual code in it. The real init was done inside the emAfInit() which call both emberAfMainInitCallback and emberAfInit . emAfInit calls were changed to emberAfInit

jepenven-silabs and others added 6 commits October 29, 2020 14:14
- Update all generated files inside the /gen/ directory
- Removed unused files (e.g. znet_bookeeping)
- Moved function that couldn't be generated to /src/app/
- Update build files for all examples
jepenven-silabs added a commit to jepenven-silabs/connectedhomeip that referenced this pull request Nov 9, 2020
mspang pushed a commit that referenced this pull request Nov 10, 2020
* Moved templates out of PR #3464

* fix PR comments

* Moved template to src/app

* Fix PR comments

* Renamed src/app/zap to src/app/zap-templates

* removed CLI define

* Switch to pragma once

* Restyled by whitespace

* Restyled by clang-format

* Restyled by prettier-json

* Restyled by prettier-markdown

Co-authored-by: Restyled.io <commits@restyled.io>
@andy31415
Copy link
Contributor

@jepenven-silabs - this PR is very old with conflicts.

Should we update or drop?

@jepenven-silabs
Copy link
Contributor Author

@jepenven-silabs - this PR is very old with conflicts.

Should we update or drop?

I think that @vivien-apple successfully broke this humongous PR into multiple small ones that got merged into master. All of the features seems to be in master or in other PR waiting to get merge. Closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate ZAP into sample application CI
6 participants