This directory contains generation templates for ZAP, ZCL Advanced Platform.
IMPORTANT: Changes to templates will affect all examples.
Run ZAP with UI to configure endpoints and clusters
./scripts/tools/zap/run_zaptool.sh
or
./scripts/tools/zap/run_zaptool.sh <path to *.zap file>
When any of the .zapt
templates has been changed, all examples applications need to be updated. You can regenerate all files with:
./scripts/tools/zap_regen_all.py
By default generated files are located in a zap-generated/
folder under zzz_generated/app-name/
.
The zap-generated/
folder content is the output of the templates listed into app-templates.json
.
zap-generated/
folder the command is:./scripts/tools/zap/generate.py <path to application *.zap file> -o zzz_generated/app-name/zap-generated
For example, to generate the zzz_generated/lighting-app/zap-generated/
folder the command is:
./scripts/tools/zap/generate.py examples/lighting-app/lighting-common/lighting-app.zap -o zzz_generated/lighting-app/zap-generated
An application may use some custom templates to generate additional files.
In this case the file listing the templates needs to be passed as an argument to generate.py
.
To generate the application additional files, the command is:
./scripts/tools/zap/generate.py <path to *.zap file> -t <path to templates.json file>
For example, to generate chip-tool
additional files the command is:
./scripts/tools/zap/generate.py src/controller/data_model/controller-clusters.zap -t examples/chip-tool/templates/templates.json
For more information please see the documentation under docs/
in ZAP