Skip to content

Commit b25200a

Browse files
cecilleandy31415Vyrastas
authored
Documentation: more handbook re-org (project-chip#36208)
* Documentation: gather IDs and codes into dir * Documentation: Consolidate zap/codegen * Update docs/getting_started/changing_examples.md Co-authored-by: Jeff Bumgardner <jbumgardner@google.com> * Fix a couple of missed doc refs * Fix some paths for the CI checkers * Not sure why it's not finding this on the CI * fix zap output directory --------- Co-authored-by: Andrei Litvin <andy314@gmail.com> Co-authored-by: Jeff Bumgardner <jbumgardner@google.com>
1 parent 73a1c0b commit b25200a

24 files changed

+56
-26
lines changed

.github/workflows/zap_templates.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Generate all
6363
run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py
6464
- name: Generate script-maintained items (ERROR_CODES.md)
65-
run: ./scripts/run_in_build_env.sh "scripts/error_table.py > docs/ERROR_CODES.md"
65+
run: ./scripts/run_in_build_env.sh "scripts/error_table.py > docs/ids_and_codes/ERROR_CODES.md"
6666
- name: Ensure git works in current working directory
6767
run: git config --global --add safe.directory `pwd`
6868
- name: Check for uncommited changes

.restyled.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ exclude:
8383
- "scripts/setup/bootstrap.sh" # tries to quote loop variable
8484
- "integrations/docker/build-all.sh" # tries to quote loop variable
8585
- "scripts/setup/pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff.
86-
- "docs/ERROR_CODES.md" # generated by scripts, not easy to align tables
87-
- "docs/zap_clusters.md" # generated by scripts, not easy to align tables
88-
- "docs/spec_clusters.md" # generated by scripts, not easy to align tables
86+
- "docs/ids_and_codes/**" # generated by scripts, not easy to align tables
8987
- "docs/testing/yaml_pseudocluster.md" # generated by scripts, restyler makes the tables render improperly
9088
- "docs/testing/yaml_schema.md" # generated by scripts, restyler makes the tables render improperly
9189

.spellcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ matrix:
6565
# converts markdown to HTML
6666
- pyspelling.filters.markdown:
6767
sources:
68-
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md|!docs/testing/python.md|!docs/testing/ChipDeviceCtrlAPI.md|!docs/issue_triage.md'
68+
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ids_and_codes/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md|!docs/testing/python.md|!docs/testing/ChipDeviceCtrlAPI.md|!docs/issue_triage.md'
6969
aspell:
7070
ignore-case: true
7171
camel-case: true

docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ Note that the output should also be verified against the spec using the
4848
- Goal: get zap to understand the new cluster so it can be used on devices
4949
(XML and glue)
5050

51-
![](../getting_started/img/zap_compiler.png)
51+
![](../zap_and_codegen/img/zap_compiler.png)
5252

5353
### Cluster definitions and ZAP
5454

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

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

67-
![](../getting_started/img/zap3.png)
67+
![](../zap_and_codegen/img/zap3.png)
6868

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

73-
![](../getting_started/img/zap4.png)
73+
![](../zap_and_codegen/img/zap4.png)
7474

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

77-
![](../getting_started/img/zap5.png)
77+
![](../zap_and_codegen/img/zap5.png)
7878

7979
### Cluster implementation - Ember and overrides
8080

docs/getting_started/changing_examples.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ The composition of most examples in the SDK is static and code generated.
44

55
The tool used to describe and change the composition of an example is called
66
ZAP. More information about ZAP and a walk-through of the tool can be found in
7-
the [ZAP introduction](./zap.md). The composition of the device is captured in a
8-
.zap file, which is readable by the ZAP tool. This is then compiled into a
9-
human-readable .matter file, which is used to build the static features of the
10-
example.
7+
the [ZAP introduction](../zap_and_codegen/zap_intro.md). The composition of the
8+
device is captured in a .zap file, which is readable by the ZAP tool. This is
9+
then compiled into a human-readable .matter file, which is used to build the
10+
static features of the example.
1111

1212
To change the composition of a device example, you need to
1313

@@ -35,7 +35,8 @@ This will open the ZAP GUI tool, which can be used to change the endpoint
3535
composition, clusters, features, attributes, commands and events exposed by the
3636
device.
3737

38-
Details of how to use the tool can be found in the [ZAP Introduction](./zap.md).
38+
Details of how to use the tool can be found in the
39+
[ZAP Introduction](../zap_and_codegen/zap_intro.md).
3940

4041
## Running code generation
4142

@@ -62,3 +63,16 @@ recompile the .zap files for all the examples and the controller.
6263

6364
After generating the .matter file, re-build the example. Instructions for
6465
building examples are given in [Building your first example](./first_example.md)
66+
67+
## Ensuring device conformance
68+
69+
After changing the examples, it is important to ensure they remain spec
70+
compliant. Although there are numerous certification tests to check the various
71+
parts of the device, the tests most likely to be affected by changes to ZAP are
72+
the conformance tests, which ensure that the device included meets the
73+
conformance requirements for clusters and device types. To run conformance tests
74+
against the example app, see [Testing](../testing/index.md). The tests that
75+
ensure the device composition is spec compliant are found in
76+
[Device Basic Composition Test](../../src/python_testing/TC_DeviceBasicComposition.py)
77+
and
78+
[Device Conformance Tests](../../src/python_testing/TC_DeviceConformance.py).

docs/getting_started/first_example.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ for testing. More information about the python controller can be found in the
3737

3838
The examples directory contains a set of apps using an example device
3939
composition \.zap file. For more information about device composition and zap,
40-
see [ZAP documentation](./zap.md).
40+
see [ZAP documentation](../zap_and_codegen/zap_intro.md).
4141

4242
This quick start guide will walk you through
4343

docs/getting_started/index.md

-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ The following docs are a brief introduction to SDK development.
1010
first_example
1111
changing_examples
1212
SDKBasics
13-
zap
1413
1514
```
1615

1716
- [Running your first example](./first_example.md)
1817
- [Changing examples](./changing_examples.md)
1918
- [SDK Architecture Overview](./SDKBasics.md)
20-
- [ZAP Introduction](./zap.md)

docs/guides/simulated_device_linux.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ is defined by a ZAP config file and tests can be added with a
1919

2020
- [Building Prerequisites](./BUILDING.md#prerequisites)
2121
- [Prepare For Building](./BUILDING.md#prepare-for-building)
22-
- [Code Generate](../code_generation.md)
23-
- [ZAP Installed](../code_generation.md#installing-zap-and-environment-variables)
22+
- [Code Generate](../zap_and_codegen/code_generation.md)
23+
- [ZAP Installed](../zap_and_codegen/code_generation.md#installing-zap-and-environment-variables)
2424

2525
## Building the default Simulated App with Script
2626

File renamed without changes.

docs/ids_and_codes/index.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IDs and Codes
2+
3+
4+
```{toctree}
5+
:glob:
6+
:maxdepth: 1
7+
8+
*
9+
10+
```
File renamed without changes.
File renamed without changes.

docs/index.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ VSCODE_DEVELOPMENT
1010
ci-cd/index
1111
development_controllers/index
1212
getting_started/index
13+
ids_and_codes/index
1314
cluster_and_device_type_dev/index
1415
guides/index
1516
platforms/index
@@ -19,14 +20,10 @@ product_considerations/index
1920
testing/index
2021
tips_and_troubleshooting/index
2122
tools/index
23+
zap_and_codegen/index
2224
BUG_REPORT
23-
code_generation
24-
zap_clusters
25-
spec_clusters
2625
upgrading
27-
ERROR_CODES
2826
issue_triage
29-
3027
```
3128

3229
```{include} README.md

docs/code_generation.md docs/zap_and_codegen/code_generation.md

+5
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ via `-o/--output-dir`.
197197
./scripts/tools/zap/generate.py $PATH_TO_ZAP_FILE
198198
```
199199

200+
Rebuild the application.
201+
202+
It is also recommended to run device composition tests to ensure the selected
203+
composition is spec compliant (see [Testing](../testing))
204+
200205
### Compile-time code generation / pre-generated code
201206

202207
A subset of code generation (both `codegen.py` and `zap-cli`) is done at compile
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/zap_and_codegen/index.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ZAP and Codegen
2+
3+
```{toctree}
4+
:glob:
5+
:maxdepth: 1
6+
7+
*
8+
```
File renamed without changes.

scripts/tools/zap_regen_all.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def getCodegenTemplates():
414414
targets.append(JinjaCodegenTarget(
415415
generator="summary-markdown",
416416
idl_path="src/controller/data_model/controller-clusters.matter",
417-
output_directory="docs"))
417+
output_directory="docs/ids_and_codes"))
418418

419419
return targets
420420

0 commit comments

Comments
 (0)