Skip to content

Commit

Permalink
Documentation: Consolidate zap/codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Oct 23, 2024
1 parent c02c070 commit 256889f
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 8 deletions.
10 changes: 5 additions & 5 deletions docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ Note that the output should also be verified against the spec using the
- Goal: get zap to understand the new cluster so it can be used on devices
(XML and glue)

![](../getting_started/img/zap_compiler.png)
![](../zap_and_codegen/img/zap_compiler.png)

### Cluster definitions and ZAP

Please see [ZAP](../getting_started/zap.md) for an introduction to ZAP.
Please see [ZAP](../zap_and_codegen/zap_intro.md) for an introduction to ZAP.

After implementing the changes outlined in the wiki article, your cluster and
device type should show up in zap. you can check this by running zaptool with
Expand All @@ -64,17 +64,17 @@ To ensure the cluster and device type are correctly implemented for ZAP, open
the endpoint configuration and ensure the device type appears in the device type
list.

![](../getting_started/img/zap3.png)
![](../zap_and_codegen/img/zap3.png)

Next, check your cluster. The "domain" parameter in the XML controls which group
the cluster is in. It should have all the expected attributes, commands and
events.

![](../getting_started/img/zap4.png)
![](../zap_and_codegen/img/zap4.png)

Last, ensure that your attributes have the storage option set appropriately.

![](../getting_started/img/zap5.png)
![](../zap_and_codegen/img/zap5.png)

### Cluster implementation - Ember and overrides

Expand Down
20 changes: 20 additions & 0 deletions docs/getting_started/first_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,23 @@ where:
- on is the attribute name
- 0x12344321 is the node ID you used for commissioning
- 1 is the endpoint

## Making changes to the example app composition

Most of the examples use a static definition of the device composition. This
composition is defined in a .zap file, that is intended to be read and managed
through the ZAP tool. Example apps most commonly store their zap configuration
files in a -common subdirectory which is shared across all the platform
implementations.

The basic steps involved in making changes to example apps are as follows:

- Open the .zap file in the zap tool and make the required changes
- Run generate.py to generate the .matter file from the .zap file
- Re-build the application to incorporate the changes
- Run device composition tests to ensure the new composition is spec compliant

Information on updating with ZAP can be found in
[Updating an application ZAP file](../zap_and_codegen/code_generation.md#flow-for-updating-an-application-zap-file).

Information on testing can be found in [Testing](../testing/index.md).
3 changes: 1 addition & 2 deletions docs/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ The following docs are a brief introduction to SDK development.
```

- [Running your first example](./first_example.md)
- [SDK Basics](./SDKBasics.md)
- [ZAP](./zap.md)
- [SDK Architecture Basics](./SDKBasics.md)
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ product_considerations/index
testing/index
tips_and_troubleshooting/index
tools/index
zap_and_codegen/index
BUG_REPORT
code_generation
upgrading
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ via `-o/--output-dir`.
./scripts/tools/zap/generate.py $PATH_TO_ZAP_FILE
```

Rebuild the application.

It is also recommended to run device composition tests to ensure the selected
composition is spec compliant (see [Testing](../testing/index.md))

### Compile-time code generation / pre-generated code

A subset of code generation (both `codegen.py` and `zap-cli`) is done at compile
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 8 additions & 0 deletions docs/zap_and_codegen/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ZAP and Codegen

```{toctree}
:glob:
:maxdepth: 1
*
```
File renamed without changes.

0 comments on commit 256889f

Please sign in to comment.