Skip to content

Commit

Permalink
Merge branch 'master' into AA/GoogleTestErrorFormatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Oct 31, 2024
2 parents f69755c + aa914dd commit 83b60fd
Show file tree
Hide file tree
Showing 448 changed files with 20,716 additions and 6,029 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-efr32:85
image: ghcr.io/project-chip/chip-build-efr32:89
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples-nxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-k32w0-freertos-lighting-factory \
--target nxp-k32w0-freertos-lighting-factory-log-progress \
--target nxp-k32w0-freertos-contact-sensor-low-power-factory \
build \
--copy-artifacts-to out/artifacts \
Expand All @@ -79,7 +79,7 @@ jobs:
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w0+release light \
out/artifacts/nxp-k32w0-freertos-lighting-factory/chip-k32w0x-light-example.elf \
out/artifacts/nxp-k32w0-freertos-lighting-factory-log-progress/chip-k32w0x-light-example.elf \
/tmp/bloat_reports/
- name: Get K32W0 contact sensor size stats
run: |
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ jobs:
--known-failure app/reporting/reporting.cpp \
--known-failure app/reporting/tests/MockReportScheduler.cpp \
--known-failure app/reporting/tests/MockReportScheduler.h \
--known-failure app/util/attribute-storage.cpp \
--known-failure app/util/attribute-storage-detail.h \
--known-failure app/util/attribute-storage.h \
--known-failure app/util/attribute-table.cpp \
--known-failure app/util/attribute-table-detail.h \
--known-failure app/util/attribute-table.h \
--known-failure app/util/binding-table.cpp \
Expand All @@ -118,9 +116,7 @@ jobs:
--known-failure app/util/DataModelHandler.h \
--known-failure app/util/ember-compatibility-functions.cpp \
--known-failure app/util/ember-compatibility-functions.h \
--known-failure app/util/ember-global-attribute-access-interface.cpp \
--known-failure app/util/ember-global-attribute-access-interface.h \
--known-failure app/util/ember-io-storage.cpp \
--known-failure app/util/ember-io-storage.h \
--known-failure app/util/endpoint-config-api.h \
--known-failure app/util/generic-callbacks.h \
Expand All @@ -135,7 +131,12 @@ jobs:
--known-failure platform/GLibTypeDeleter.h \
--known-failure platform/SingletonConfigurationManager.cpp \
"
# These ARE actually orphaned but due to dynamic-server we have code paths
# for them. Keeping them as a list as they still need review ...
# --known-failure app/util/attribute-table.cpp \
# --known-failure app/util/ember-io-storage.cpp \
# --known-failure app/util/ember-global-attribute-access-interface.cpp \
# --known-failure app/util/attribute-storage.cpp \
- name: Check for matter lint errors
if: always()
run: |
Expand Down Expand Up @@ -295,11 +296,13 @@ jobs:
':(exclude)examples/common/pigweed/rpc_services/Attributes.h' \
':(exclude)src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp' \
':(exclude)src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp' \
':(exclude)src/app/dynamic_server/DynamicDispatcher.cpp' \
':(exclude)src/app/util/attribute-table.cpp' \
':(exclude)src/app/util/attribute-table.h' \
':(exclude)src/app/util/ember-compatibility-functions.cpp' \
':(exclude)src/app/util/mock/CodegenEmberMocks.cpp' \
':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' \
':(exclude)src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm' \
':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' \
&& exit 1 || exit 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zap_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Generate all
run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py
- name: Generate script-maintained items (ERROR_CODES.md)
run: ./scripts/run_in_build_env.sh "scripts/error_table.py > docs/ERROR_CODES.md"
run: ./scripts/run_in_build_env.sh "scripts/error_table.py > docs/ids_and_codes/ERROR_CODES.md"
- name: Ensure git works in current working directory
run: git config --global --add safe.directory `pwd`
- name: Check for uncommited changes
Expand Down
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
[submodule "third_party/lwip/repo"]
path = third_party/lwip/repo
url = https://github.com/lwip-tcpip/lwip.git
excluded-platforms = darwin
[submodule "third_party/abseil-cpp/src"]
path = third_party/abseil-cpp/src
url = https://github.com/abseil/abseil-cpp.git
Expand Down
6 changes: 0 additions & 6 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/googletest.gni")
import("//build_overrides/pigweed.gni")

# The location of the build configuration file.
Expand All @@ -34,11 +33,6 @@ default_args = {
# GN target to use for the default Python build venv.
pw_build_PYTHON_BUILD_VENV = "//:matter_build_venv"

# Use the GoogleTest backend for unit tests running on host.
pw_unit_test_BACKEND = "$dir_pw_unit_test:googletest"
pw_unit_test_MAIN = "$dir_pigweed/third_party/googletest:gmock_main"
dir_pw_third_party_googletest = "$dir_googletest"

# Required for pw_unit_test
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
pw_assert_BACKEND = "$dir_pw_assert_log"
Expand Down
4 changes: 1 addition & 3 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ exclude:
- "scripts/setup/bootstrap.sh" # tries to quote loop variable
- "integrations/docker/build-all.sh" # tries to quote loop variable
- "scripts/setup/pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff.
- "docs/ERROR_CODES.md" # generated by scripts, not easy to align tables
- "docs/zap_clusters.md" # generated by scripts, not easy to align tables
- "docs/spec_clusters.md" # generated by scripts, not easy to align tables
- "docs/ids_and_codes/**" # generated by scripts, not easy to align tables
- "docs/testing/yaml_pseudocluster.md" # generated by scripts, restyler makes the tables render improperly
- "docs/testing/yaml_schema.md" # generated by scripts, restyler makes the tables render improperly

Expand Down
2 changes: 1 addition & 1 deletion .spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ matrix:
# converts markdown to HTML
- pyspelling.filters.markdown:
sources:
- '**/*.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'
- '**/*.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'
aspell:
ignore-case: true
camel-case: true
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"${chip_root}/src/lib/core/tests:fuzz-tlv-reader-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
"${chip_root}/src/lib/dnssd/minimal_mdns/tests:fuzz-minmdns-packet-parsing-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
"${chip_root}/src/lib/format/tests:fuzz-payload-decoder-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
"${chip_root}/src/protocols/secure_channel/tests:fuzz-PASE-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
"${chip_root}/src/setup_payload/tests:fuzz-setup-payload-base38-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
]
}
Expand Down
5 changes: 5 additions & 0 deletions build/chip/chip_test_suite.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/googletest.gni")
import("//build_overrides/pigweed.gni")

import("${chip_root}/build/chip/tests.gni")
Expand Down Expand Up @@ -120,6 +121,10 @@ template("chip_test_suite") {
# Link to the common lib for this suite so we get its `sources`.
public_deps += [ ":${_suite_name}.lib" ]

if (pw_unit_test_BACKEND == "$dir_pw_unit_test:googletest") {
test_main = "$dir_pigweed/third_party/googletest:gmock_main"
}

# Set variables that the platform executable may need.
if (test_executable_output_name != "") {
output_name = test_executable_output_name + _test_name +
Expand Down
2 changes: 1 addition & 1 deletion build/chip/esp32/esp32_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ macro(chip_app_component_zapgen ZAP_NAME)

# When data model interface is used, provide a default code-generation data model as
# part of zapgen. See `chip_data_model.cmake` for similar logic
set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled")
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")

if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled")
target_sources(${COMPONENT_LIB} PRIVATE ${CODEGEN_DATA_MODEL_SOURCES})
Expand Down
2 changes: 1 addition & 1 deletion build_overrides/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

declare_args() {
# Root directory for efr32 SDK build files.
efr32_sdk_build_root = "//third_party/silabs"
silabs_sdk_build_root = "//third_party/silabs"
}
2 changes: 1 addition & 1 deletion config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)

set(CHIP_REQUIRE_COMPONENTS esp_eth freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash spi_flash)

set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled")
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")

if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND CHIP_REQUIRE_COMPONENTS mdns)
Expand Down
2 changes: 1 addition & 1 deletion config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (CONFIG_MBED_BSD_SOCKET_TRACE)
endif()

# Option can be set with `-DCHIP_DATA_MODEL_INTERFACE=enabled` or similar on the command line
set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled")
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")

# ==============================================================================
# Generate configuration for CHIP GN build system
Expand Down
8 changes: 4 additions & 4 deletions config/nxp/chip-cmake-freertos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ endif()
# ==============================================================================
matter_add_gn_arg_string("nxp_nvm_component" ${CONFIG_CHIP_NVM_COMPONENT})
matter_add_gn_arg_string("nxp_platform" ${CONFIG_CHIP_NXP_PLATFORM})
matter_add_gn_arg("chip_with_factory_data" ${CONFIG_CHIP_FACTORY_DATA})
matter_add_gn_arg("chip_enable_secure_dac_private_key_storage" ${CONFIG_CHIP_SECURE_DAC_PRIVATE_KEY_STORAGE})
matter_add_gn_arg("chip_enable_secure_whole_factory_data" ${CONFIG_CHIP_ENABLE_SECURE_WHOLE_FACTORY_DATA})
matter_add_gn_arg_bool("chip_enable_matter_cli" CONFIG_CHIP_LIB_SHELL)
matter_add_gn_arg_bool("nxp_use_factory_data" ${CONFIG_CHIP_FACTORY_DATA})
matter_add_gn_arg_bool("nxp_enable_secure_dac_private_key_storage" ${CONFIG_CHIP_SECURE_DAC_PRIVATE_KEY_STORAGE})
matter_add_gn_arg_bool("nxp_enable_secure_whole_factory_data" ${CONFIG_CHIP_ENABLE_SECURE_WHOLE_FACTORY_DATA})
matter_add_gn_arg_bool("nxp_enable_matter_cli" CONFIG_CHIP_LIB_SHELL)
matter_add_gn_arg_bool("chip_enable_pairing_autostart" CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART)

if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
Expand Down
1 change: 1 addition & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ config CHIP_BLE_ADVERTISING_DURATION

config USE_CHIP_DATA_MODEL_INTERFACE
bool "Use a DataModel::Provider interface for data access"
default y
help
This enables a level of indiraction in the CHIP interaction model engine in
accessing underlying data and executing operations such as
Expand Down
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
24 changes: 19 additions & 5 deletions docs/getting_started/changing_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ The composition of most examples in the SDK is static and code generated.

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

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

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

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

## Running code generation

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

After generating the .matter file, re-build the example. Instructions for
building examples are given in [Building your first example](./first_example.md)

## Ensuring device conformance

After changing the examples, it is important to ensure they remain spec
compliant. Although there are numerous certification tests to check the various
parts of the device, the tests most likely to be affected by changes to ZAP are
the conformance tests, which ensure that the device included meets the
conformance requirements for clusters and device types. To run conformance tests
against the example app, see [Testing](../testing/index.md). The tests that
ensure the device composition is spec compliant are found in
[Device Basic Composition Test](../../src/python_testing/TC_DeviceBasicComposition.py)
and
[Device Conformance Tests](../../src/python_testing/TC_DeviceConformance.py).
2 changes: 1 addition & 1 deletion docs/getting_started/first_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for testing. More information about the python controller can be found in the

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

This quick start guide will walk you through

Expand Down
2 changes: 0 additions & 2 deletions docs/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ The following docs are a brief introduction to SDK development.
first_example
changing_examples
SDKBasics
zap
```

- [Running your first example](./first_example.md)
- [Changing examples](./changing_examples.md)
- [SDK Architecture Overview](./SDKBasics.md)
- [ZAP Introduction](./zap.md)
4 changes: 2 additions & 2 deletions docs/guides/simulated_device_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ is defined by a ZAP config file and tests can be added with a

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

## Building the default Simulated App with Script

Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions docs/ids_and_codes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# IDs and Codes


```{toctree}
:glob:
:maxdepth: 1
*
```
File renamed without changes.
File renamed without changes.
7 changes: 2 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ VSCODE_DEVELOPMENT
ci-cd/index
development_controllers/index
getting_started/index
ids_and_codes/index
cluster_and_device_type_dev/index
guides/index
platforms/index
Expand All @@ -19,14 +20,10 @@ product_considerations/index
testing/index
tips_and_troubleshooting/index
tools/index
zap_and_codegen/index
BUG_REPORT
code_generation
zap_clusters
spec_clusters
upgrading
ERROR_CODES
issue_triage
```

```{include} README.md
Expand Down
Loading

0 comments on commit 83b60fd

Please sign in to comment.