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 zap tooling to Docker container #84

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Conversation

tl-sl
Copy link
Contributor

@tl-sl tl-sl commented Oct 21, 2024

Add ZAP tooling to docker container which allows for Zigbee apps that require ZCL clusters to be built (such as any of the example apps like Z3Light and Z3Switch). slc will automatically generate all required files from config/zcl/zcl_config.zap saved under the project src folder.

Snippet from .slcp file

config_file:
- path: config/zcl/zcl_config.zap
  directory: zcl

@agners agners requested a review from puddly October 21, 2024 08:13
@puddly
Copy link
Collaborator

puddly commented Oct 21, 2024

Interesting! Are you building end device or router projects with the firmware builder?

@puddly puddly merged commit 5055f0d into NabuCasa:main Oct 21, 2024
11 checks passed
@tl-sl tl-sl deleted the zap_tooling branch October 21, 2024 22:55
@tl-sl
Copy link
Contributor Author

tl-sl commented Oct 21, 2024

Yeh I am using it to build router firmware. Currently the zcl config is device specific, will probably need to extend manifest to set manufacturer/product strings here.

@puddly
Copy link
Collaborator

puddly commented Oct 21, 2024

If you break the device model and manufacturer info out into a config/something.h file, you can set it using the existing c_defines: block.

@tl-sl
Copy link
Contributor Author

tl-sl commented Oct 22, 2024

If you break the device model and manufacturer info out into a config/something.h file, you can set it using the existing c_defines: block.

I initially thought of doing something like this, however ZCL configuration works different to the main project configurator.
The zap tool takes the config from zcl_config.zap (json file) and directly generates the required .c/.h header files. Unless I am missing something, there is no way override configuration using defines here, since the generated #defines are not wrapped in #ifdefs.

@puddly
Copy link
Collaborator

puddly commented Oct 22, 2024

Ahh. Yeah, we don't currently have anything to modify JSON files. Perhaps something like:

json_config:
  - file: "config/zcl/zcl_config.zap"
    jq: |
      .endpointTypes[].clusters[].attributes[] | select(.name == "model name") 
      | .defaultValue = "some model"'

  - file: "config/zcl/zcl_config.zap"
    jq: |
      .endpointTypes[].clusters[].attributes[] | select(.name == "manufacturer name") 
      | .defaultValue = "some manufacturer"'

@puddly
Copy link
Collaborator

puddly commented Oct 22, 2024

Sample implementation, untested: #85

@tl-sl
Copy link
Contributor Author

tl-sl commented Oct 23, 2024

I think that looks good, will test

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.

2 participants