Skip to content

Commit

Permalink
Merge remote-tracking branch 'chip/master' into icd/python-wait-for-a…
Browse files Browse the repository at this point in the history
…ctive-testing
  • Loading branch information
erjiaqing committed Jul 14, 2024
2 parents af11bdc + 7611b99 commit e4e8a17
Show file tree
Hide file tree
Showing 299 changed files with 20,791 additions and 4,553 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ on:
run-codeql:
required: false
type: boolean

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
cancel-in-progress: true

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:
build_linux_gcc_debug:
name: Build on Linux (gcc_debug)
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/run-clang-tidy-on-compile-commands.py \
--compile-database out/sanitizers/compile_commands.json \
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write' \
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \
check \
"
- name: Clean output
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
run: |
rm -rf ./zzz_pregenerated
mv scripts/codegen.py.renamed scripts/codegen.py
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
- name: Run fake linux tests with build_examples
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -253,7 +253,7 @@ jobs:
uses: ./.github/actions/perform-codeql-analysis
with:
language: cpp

- name: Uploading core files
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
Expand Down Expand Up @@ -430,7 +430,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/run-clang-tidy-on-compile-commands.py \
--compile-database out/default/compile_commands.json \
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write' \
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \
check \
"
- name: Uploading diagnostic logs
Expand All @@ -445,7 +445,7 @@ jobs:
uses: ./.github/actions/perform-codeql-analysis
with:
language: cpp

# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
# TODO https://github.com/project-chip/connectedhomeip/issues/1512

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/examples-nxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,36 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-k32w0-lighting \
--target nxp-k32w0-lighting-factory \
--target nxp-k32w0-lighting-rotating-id \
--target nxp-k32w0-contact-sensor \
--target nxp-k32w0-contact-sensor-low-power \
--target nxp-k32w0-contact-sensor-low-power-factory \
--target nxp-k32w1-lighting \
--target nxp-k32w1-contact-sensor-low-power \
--target nxp-k32w0-freertos-lighting \
--target nxp-k32w0-freertos-lighting-factory \
--target nxp-k32w0-freertos-lighting-rotating-id \
--target nxp-k32w0-freertos-contact-sensor \
--target nxp-k32w0-freertos-contact-sensor-low-power \
--target nxp-k32w0-freertos-contact-sensor-low-power-factory \
--target nxp-k32w1-freertos-lighting \
--target nxp-k32w1-freertos-contact-sensor-low-power \
build \
--copy-artifacts-to out/artifacts \
"
- name: Get lighting app size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w0+release light \
out/artifacts/nxp-k32w0-lighting/chip-k32w0x-light-example.elf \
out/artifacts/nxp-k32w0-freertos-lighting/chip-k32w0x-light-example.elf \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w1+release light \
out/artifacts/nxp-k32w1-lighting/chip-k32w1-light-example.elf \
out/artifacts/nxp-k32w1-freertos-lighting/chip-k32w1-light-example.elf \
/tmp/bloat_reports/
- name: Get contact sensor size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w0+release contact \
out/artifacts/nxp-k32w0-contact-sensor-low-power/chip-k32w0x-contact-example.elf \
out/artifacts/nxp-k32w0-freertos-contact-sensor-low-power/chip-k32w0x-contact-example.elf \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w1+release contact \
out/artifacts/nxp-k32w1-contact-sensor-low-power/chip-k32w1-contact-example.elf \
out/artifacts/nxp-k32w1-freertos-contact-sensor-low-power/chip-k32w1-contact-example.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: ./.github/actions/upload-size-reports
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml \
src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml \
Expand Down Expand Up @@ -191,6 +192,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/window-covering.xml \
Expand Down Expand Up @@ -493,7 +495,7 @@ jobs:
- name: Run Tests
run: |
mkdir -p out/trace_data
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_3.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_4.py'
Expand Down Expand Up @@ -529,6 +531,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDManagementCluster.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_1_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_1_4.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_4_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_PWRTL_2_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_RR_1_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_SC_3_6.py'
Expand Down Expand Up @@ -579,6 +582,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py'
scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py'
- name: Uploading core files
uses: actions/upload-artifact@v4
Expand Down
4 changes: 3 additions & 1 deletion config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,11 @@ menu "CHIP Device Layer"
config MAX_EVENT_QUEUE_SIZE
int "Max Event Queue Size"
range 0 65535
default 25
default 40
help
The maximum number of events that can be held in the CHIP Platform event queue.
Should be set greater than CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM. For SoCs other than
ESP32-C2, where the Wi-Fi buffer number is 8, recommended to use the default value.

config ENABLE_EXTENDED_DISCOVERY
bool "Enable Extended discovery Support"
Expand Down
15 changes: 11 additions & 4 deletions config/python/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@
#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

// Uncomment this for a large Tunnel MTU.
//#define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)
// #define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)

// Enable support functions for parsing command-line arguments
#define CHIP_CONFIG_ENABLE_ARG_PARSER 1

// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
// Enable use of test setup parameters for testing purposes only.
//
// WARNING: This option makes it possible to circumvent basic chip security functionality.
// Because of this it SHOULD NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#ifndef CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS
#define CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS 1
#endif

// Enable reading DRBG seed data from /dev/(u)random.
// This is needed for test applications and the CHIP device manager to function
Expand All @@ -46,6 +51,8 @@
// WARNING: These options make it possible to circumvent basic Chip security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
// To build with this flag, pass 'treat_warnings_as_errors=false' to gn/ninja.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0

#define CHIP_CONFIG_ENABLE_UPDATE 1
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/SDKBasics.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ logic is handled in the run-time installed interface layers.
- examples
- [examples/chip-tool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool) -
main controller example
- [examples/all-clusters-app](https://github.com/project-chip/connectedhomeip/blob/master/examples/all-cluster-app) -
- [examples/all-clusters-app](https://github.com/project-chip/connectedhomeip/blob/master/examples/all-clusters-app) -
QA app
- [examples/\<others\>](https://github.com/project-chip/connectedhomeip/blob/master/examples) -
Specific Device examples
Expand Down
164 changes: 164 additions & 0 deletions docs/guides/fabric_synchronization_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Fabric Synchronization Guide

- [Fabric Synchronization Guide](#fabric-synchronization-guide)
- [Fabric Sync Example Applications](#fabric-sync-example-applications)
- [Run Fabric Sync Demo on RP4](#run-fabric-sync-demo-on-rp4)

## Fabric Sync Example Applications

Fabric-Admin and Fabric-Bridge example applications are provided to demonstrate
Fabric Synchronization feature. You can find them in the examples.

![matter_fabric_synchronization](images/matter_fabric_synchronization.png)

Fabric-Admin example app implements the Fabric Administrator role and
communicates with the Fabric-Bridge-App on the other side, facilitating the
Fabric Synchronization process.

Fabric-Bridge-App example app implements the Aggregator device type with Fabric
Synchronization condition met and demonstrates the end-to-end Fabric
Synchronization feature using dynamic endpoints.

Fabric Synchronization can be triggered from either side. The initiator of the
Fabric Synchronization process, who shares their devices, takes on the
Commissioner role. The recipient of the Fabric Synchronization request, who
receives the shared devices, assumes the Commissionee role. This flexibility
enables a seamless and efficient synchronization process.

### Building the Example Application

- Building the Fabric-Admin Application

[Fabric-Admin](https://github.com/project-chip/connectedhomeip/tree/master/examples/fabric-admin/README.md)

* Building the Fabric-Bridge Application

[Fabric-Bridge](https://github.com/project-chip/connectedhomeip/tree/master/examples/fabric-bridge-app/linux/README.md)

## Run Fabric Sync Demo on RP4

### Setup Fabric Source

Connect to the Fabric Source server:

```
ssh [email protected]
```

Password: <password>

Run the Fabric Source script:

```
./run_fabric_source.sh
```

### Setup Fabric Sink

Connect to the Fabric Sink server:

```
ssh [email protected]
```

Password: <password>

Run the Fabric Sink script:

```
./run_fabric_sink.sh
```

### Fabric Sync Setup

Enable Fabric Auto Sync:

In Fabric-Sync console:

```
fabricsync enable-auto-sync 1
```

Pair the Fabric-Source bridge to Fabric-Sync with node ID 1:

```
fabricsync add-bridge 1 <fabric-sink-ip>
```

### Pair Light Example to Fabric-Source

Pair the Light Example with node ID 3 using its payload number:

```
pairing already-discovered 3 20202021 <ip> 5540
```

After the Light Example is successfully paired in Fabric-Source, it will be
synced to Fabric-Sink with a new assigned node ID.

Toggle the Light Example:

From Fabric-Source:

```
onoff on <node-id> 1
onoff off <node-id> 1
```

From Fabric-Sink: (Use the node ID assigned)

```
onoff on x 1
onoff off x 1
```

### Remove Light Example from Fabric-Source

Unpair the Light Example:

```
pairing unpair <node-id>
```

After the Light Example is successfully unpaired from Fabric-Source, it will
also be removed from the Fabric-Sink.

### Pair Commercial Switch to Fabric-Source

Pair the switch using its payload number:

In Fabric-Source console:

```
pairing code-wifi <node-id> <ssid> <passwd> <payload>
```

After the switch is successfully paired in Fabric-Source, it will be synced to
Fabric-Sink with a new assigned node ID.

Toggle the switch:

From Fabric-Source:

```
onoff on <node-id> 1
onoff off <node-id> 1
```

From Fabric-Sink: (Use the node ID assigned)

```
onoff on <node-id> 1
onoff off <node-id> 1
```

### Remove Switch from Fabric-Source

Unpair the switch:

```
pairing unpair <node-id>
```

After the switch is successfully unpaired from Fabric-Source, it will also be
removed from the Fabric-Sink.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e4e8a17

Please sign in to comment.