-
Notifications
You must be signed in to change notification settings - Fork 60
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
[nrf noup] Add zcl_generate to west command #547
base: master
Are you sure you want to change the base?
[nrf noup] Add zcl_generate to west command #547
Conversation
scripts/west/zap_common.py
Outdated
DEFAULT_DATA_MODEL_PATH = f'{DEFAULT_MATTER_PATH}/src/app/zap-templates/zcl' | ||
DEFAULT_ZCL_PATH = f'{DEFAULT_DATA_MODEL_PATH}/zcl.json' | ||
DEFAULT_APP_TEMPLATES_PATH = f'{DEFAULT_MATTER_PATH}/src/app/zap-templates/app-templates.json' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these be Path
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
scripts/west/west-commands.yml
Outdated
commands: | ||
- name: zcl-generate | ||
class: ZCLGenerate | ||
help: Generate ZCL code from XML cluster definition file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that naming is a bit unfortunate here and there. According to name and help it seems that it generates source code, while it's not true, as it generates only json file that describes data model. Source code is generated by zap-generate, which is also unfortunate name, because it sounds like it could generate zap file, not the code.
I don't know if we should change zap-generate name, as customers could already have learned how to use it, but I would try to name the new command in a different way (and change help as well). Maybe zap-generate-json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe zcl-append-cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the other commands start with zap, so why do we want to use zcl now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because, actually it is more about ZCL than zap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to zap-append :)
77f534d
to
15b657a
Compare
15b657a
to
93bbf4e
Compare
scripts/west/zap_gui.py
Outdated
|
||
zap_installer = ZapInstaller(args.matter_path) | ||
zap_installer.update_zap_if_needed() | ||
zap_cache_path = zap_installer.get_install_path() / ".zap" | ||
zap_cache_path = zap_installer.get_cache_path() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add here temporary cache directory instead of using the global one inside the installation dir.
Added zap_append command to the west. use `west zap-append -h` to see all options. Now you can add new clusters to the matter ZCL datamodel. Use a `west zap-append` and provide the new cluster definitionsas XML files to add them to the zcl.json file. You can generate the new zcl.json file by providing `-o, --output` argument, or overwrite the existing one. The zcl_generate is integrated with `west zap-gui` commands. If you want to use it call the `west zap-gui` command with the additional argument `--clusters`. You can provide multiple clusters at once. If you provide an additional `-j` / `--zcl-json` argument alongside the `--clusters` argument to the `west zap-gui` command, the new zcl.json will be created and contain the new clusters. Signed-off-by: Arkadiusz Balys <[email protected]>
93bbf4e
to
4a4c48c
Compare
Added zap_append command to the west.
use
west zap-append -h
to see all options.Now you can add new clusters to the matter ZCL datamodel.
Use a
west zap-append
and provide the new cluster definitionsas XML files to add them to the zcl.json file.You can generate the new zcl.json file by providing
-o, --output
argument, or overwrite the existing one.The zcl_generate is integrated with
west zap-gui
commands.If you want to use it call the
west zap-gui
command with the additional argument--clusters
.You can provide multiple clusters at once.
If you provide an additional
-j
/--zcl-json
argument alongside the--clusters
argument to thewest zap-gui
command, the new zcl.json will be created and contain the new clusters.manifest-pr-skip