diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index e80dfa78bded48..ce44f93caadcea 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -17,7 +17,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
- "BUILD_VERSION": "0.5.79"
+ "BUILD_VERSION": "0.5.84"
}
},
"remoteUser": "vscode",
diff --git a/.github/labeler.yml b/.github/labeler.yml
index ae076f92e36001..6e52598d8782b7 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -126,6 +126,11 @@ setup payload:
############################################################
platform:
- src/platform/*
+ - config/tizen/chip-gn/platform/*
+ - examples/platform/*
+ - scripts/tools/memory/platform/*
+ - src/include/platform/*
+ - src/lib/dnssd/platform/*
darwin:
- src/platform/Darwin/*
diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml
index f7a59c578317e5..3e6e6856a8c0ce 100644
--- a/.github/workflows/bloat_check.yaml
+++ b/.github/workflows/bloat_check.yaml
@@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
steps:
- uses: Wandalen/wretry.action@v1.0.15
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 6fffb7fb6196a0..5f9e3b8e8da158 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
@@ -67,7 +67,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -106,7 +106,7 @@ jobs:
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-core-linux-gcc-debug
path: /tmp/cores/
@@ -114,7 +114,7 @@ jobs:
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-objdir-linux-gcc-debug
path: out/
@@ -128,7 +128,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
@@ -168,7 +168,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -239,7 +239,7 @@ jobs:
"./scripts/build/build_examples.py --no-log-timestamps --target linux-fake-tests build"
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-core-linux
path: /tmp/cores/
@@ -247,7 +247,7 @@ jobs:
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-objdir-linux
path: out/
@@ -279,7 +279,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
@@ -359,7 +359,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -407,7 +407,7 @@ jobs:
"
- name: Uploading diagnostic logs
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-log-darwin
path: ~/Library/Logs/DiagnosticReports/
diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml
index a11e2786477b52..7a3e9f86bd7946 100644
--- a/.github/workflows/chef.yaml
+++ b/.github/workflows/chef.yaml
@@ -30,7 +30,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
options: --user root
steps:
@@ -42,6 +42,11 @@ jobs:
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
+ - name: Checkout submodules
+ run: scripts/checkout_submodules.py --shallow --platform linux
+ - name: Bootstrap
+ timeout-minutes: 10
+ run: scripts/build/gn_bootstrap.sh
- name: CI Examples Linux
shell: bash
run: |
@@ -53,7 +58,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-esp32:0.5.79
+ image: connectedhomeip/chip-build-esp32:0.5.84
options: --user root
steps:
@@ -65,6 +70,11 @@ jobs:
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
+ - name: Checkout submodules
+ run: scripts/checkout_submodules.py --shallow --platform esp32
+ - name: Bootstrap
+ timeout-minutes: 10
+ run: scripts/build/gn_bootstrap.sh
- name: CI Examples ESP32
shell: bash
run: |
@@ -76,7 +86,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-nrf-platform:0.5.79
+ image: connectedhomeip/chip-build-nrf-platform:0.5.84
options: --user root
steps:
@@ -88,6 +98,11 @@ jobs:
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
+ - name: Checkout submodules
+ run: scripts/checkout_submodules.py --shallow --platform nrfconnect
+ - name: Bootstrap
+ timeout-minutes: 10
+ run: scripts/build/gn_bootstrap.sh
- name: CI Examples NRFConnect
shell: bash
run: |
diff --git a/.github/workflows/cherry-picks.yaml b/.github/workflows/cherry-picks.yaml
new file mode 100644
index 00000000000000..ac113172aa4748
--- /dev/null
+++ b/.github/workflows/cherry-picks.yaml
@@ -0,0 +1,42 @@
+name: Cherry-Pick Merges
+
+on:
+ pull_request_target:
+ branches:
+ - master
+ types: ["closed"]
+
+jobs:
+ cherry_pick_release_v1_0:
+ runs-on: ubuntu-latest
+ name: Cherry-Pick into SVE
+ if: |
+ (github.event.pull_request.merged == true)
+ && (
+ (contains(github.event.pull_request.labels.*.name, 'sve'))
+ || (contains(github.event.pull_request.labels.*.name, 'cert blocker'))
+ || (contains(github.event.pull_request.labels.*.name, 'spec'))
+ || (contains(github.event.pull_request.labels.*.name, 'platform'))
+ || (contains(github.event.pull_request.labels.*.name, 'darwin'))
+ || (contains(github.event.pull_request.labels.*.name, 'android'))
+ || (contains(github.event.pull_request.labels.*.name, 'examples'))
+ || (contains(github.event.pull_request.labels.*.name, 'scripts'))
+ || (contains(github.event.pull_request.labels.*.name, 'workflows'))
+ || (contains(github.event.pull_request.labels.*.name, 'github'))
+ || (contains(github.event.pull_request.labels.*.name, 'sve cherry-pick'))
+ )
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Cherry-Pick into sve branch
+ uses: carloscastrojumo/github-cherry-pick-action@v1.0.1
+ with:
+ token: ${{ secrets.MATTER_PAT }}
+ branch: sve
+ reviewers: |
+ woody-apple
+ andy31415
+env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml
index cc8f6528d6520c..e867790820231a 100644
--- a/.github/workflows/cirque.yaml
+++ b/.github/workflows/cirque.yaml
@@ -38,7 +38,7 @@ jobs:
# need to run with privilege, which isn't supported by job.XXX.contaner
# https://github.com/actions/container-action/issues/2
# container:
- # image: connectedhomeip/chip-build-cirque:0.5.79
+ # image: connectedhomeip/chip-build-cirque:0.5.84
# volumes:
# - "/tmp:/tmp"
# - "/dev/pts:/dev/pts"
@@ -127,7 +127,7 @@ jobs:
-- scripts/tests/cirque_tests.sh run_all_tests
- name: Uploading Binaries
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: cirque_log-${{steps.outsuffix.outputs.value}}-logs
path: /tmp/cirque_test_output/
diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml
index b4c8efdd639e60..026071e76a9e48 100644
--- a/.github/workflows/darwin-tests.yaml
+++ b/.github/workflows/darwin-tests.yaml
@@ -20,8 +20,7 @@ on:
workflow_dispatch:
concurrency:
- group:
- ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name ==
+ 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
@@ -74,65 +73,84 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
- name:
- bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
+ name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- - name: Build Apps
- timeout-minutes: 60
+ - name: Delete Defaults
+ run: defaults delete com.apple.dt.xctest.tool
+ continue-on-error: true
+ - name: Run macOS Build
+ timeout-minutes: 40
+ # Enable -Werror by hand here, because the Xcode config can't
+ # enable it for various reasons. Keep whatever Xcode settings
+ # for OTHER_CFLAGS exist by using ${inherited}.
+ #
+ # Disable -Wmacro-redefined because CHIP_DEVICE_CONFIG_ENABLE_MDNS
+ # seems to be unconditionally defined in CHIPDeviceBuildConfig.h,
+ # which is apparently being included after CHIPDeviceConfig.h.
+ run: xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-macro-redefined'
+ working-directory: src/darwin/Framework
+ - name: Copying Framework to Temporary Path
+ continue-on-error: true
run: |
- ./scripts/run_in_build_env.sh \
- "./scripts/build/build_examples.py \
- --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT} \
- --target darwin-x64-all-clusters-${BUILD_VARIANT} \
- --target darwin-x64-lock-${BUILD_VARIANT} \
- --target darwin-x64-ota-provider-${BUILD_VARIANT} \
- --target darwin-x64-ota-requestor-${BUILD_VARIANT} \
- --target darwin-x64-tv-app-${BUILD_VARIANT} \
- build \
- --copy-artifacts-to objdir-clone \
- "
- - name: Run Tests
- timeout-minutes: 60
- run: |
- ./scripts/run_in_build_env.sh \
- "./scripts/tests/run_test_suite.py \
- --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \
- --target-skip-glob '{TestGroupMessaging}' \
- run \
- --iterations 1 \
- --test-timeout-seconds 120 \
- --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
- --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \
- --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \
- --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
- --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
- "
+ mkdir -p /tmp/macos_framework_output
+ ls -la /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/
+ mv /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/Matter.framework /tmp/macos_framework_output
+ ls -la /tmp/macos_framework_output
+ # Disabling for now
+ #
+ # - name: Build Apps
+ # timeout-minutes: 60
+ # run: |
+ # ./scripts/run_in_build_env.sh \
+ # "./scripts/build/build_examples.py \
+ # --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT} \
+ # --target darwin-x64-all-clusters-${BUILD_VARIANT} \
+ # --target darwin-x64-lock-${BUILD_VARIANT} \
+ # --target darwin-x64-ota-provider-${BUILD_VARIANT} \
+ # --target darwin-x64-ota-requestor-${BUILD_VARIANT} \
+ # --target darwin-x64-tv-app-${BUILD_VARIANT} \
+ # build \
+ # --copy-artifacts-to objdir-clone \
+ # "
+ # - name: Run Tests
+ # timeout-minutes: 60
+ # run: |
+ # ./scripts/run_in_build_env.sh \
+ # "./scripts/tests/run_test_suite.py \
+ # --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \
+ # --target-skip-glob '{TestGroupMessaging}' \
+ # run \
+ # --iterations 1 \
+ # --test-timeout-seconds 120 \
+ # --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
+ # --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \
+ # --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \
+ # --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
+ # --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
+ # "
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
+ name: crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: /cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading diagnostic logs
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
+ name: crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: ~/Library/Logs/DiagnosticReports/
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
+ name: crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5
diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml
index 258d2d66336833..f1c87eb9314547 100644
--- a/.github/workflows/darwin.yaml
+++ b/.github/workflows/darwin.yaml
@@ -57,7 +57,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -66,11 +66,11 @@ jobs:
- name: Run iOS Build Debug
timeout-minutes: 30
working-directory: src/darwin/Framework
- run: xcodebuild -target "CHIP" -sdk iphoneos
+ run: xcodebuild -target "Matter" -sdk iphoneos
- name: Run iOS Build Release
timeout-minutes: 30
working-directory: src/darwin/Framework
- run: xcodebuild -target "CHIP" -sdk iphoneos -configuration Release
+ run: xcodebuild -target "Matter" -sdk iphoneos -configuration Release
- name: Clean Build
run: xcodebuild clean
working-directory: src/darwin/Framework
@@ -78,7 +78,7 @@ jobs:
run: defaults delete com.apple.dt.xctest.tool
continue-on-error: true
- name: Run macOS Build
- timeout-minutes: 30
+ timeout-minutes: 40
# Enable -Werror by hand here, because the Xcode config can't
# enable it for various reasons. Keep whatever Xcode settings
# for OTHER_CFLAGS exist by using ${inherited}.
@@ -86,15 +86,23 @@ jobs:
# Disable -Wmacro-redefined because CHIP_DEVICE_CONFIG_ENABLE_MDNS
# seems to be unconditionally defined in CHIPDeviceBuildConfig.h,
# which is apparently being included after CHIPDeviceConfig.h.
- run: xcodebuild -target "CHIP" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-macro-redefined'
+ run: xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-macro-redefined'
working-directory: src/darwin/Framework
+ - name: Copying Framework to Temporary Path
+ continue-on-error: true
+ run: |
+ mkdir -p /tmp/macos_framework_output
+ ls -la /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/
+ mv /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/Matter.framework /tmp/macos_framework_output
+ ls -la /tmp/macos_framework_output
- name: Clean Build
run: xcodebuild clean
working-directory: src/darwin/Framework
- - name: Build example darwin-framework-tool
- timeout-minutes: 15
- run: |
- scripts/examples/gn_build_example.sh examples/darwin-framework-tool out/debug chip_config_network_layer_ble=false is_asan=true
+ # Disabling for now
+ # - name: Build example darwin-framework-tool
+ # timeout-minutes: 15
+ # run: |
+ # scripts/examples/gn_build_example.sh examples/darwin-framework-tool out/debug chip_config_network_layer_ble=false is_asan=true
- name: Build example All Clusters Server
timeout-minutes: 15
run: |
@@ -115,11 +123,11 @@ jobs:
run: |
mkdir -p /tmp/darwin/framework-tests
../../../out/debug/chip-all-clusters-app --interface-id -1 > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
- xcodebuild test -target "CHIP" -scheme "CHIP Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-incomplete-umbrella' > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
+ xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-incomplete-umbrella' > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
working-directory: src/darwin/Framework
- name: Uploading log files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: darwin-framework-test-logs
path: /tmp/darwin/framework-tests
diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml
index a9b503ac0f4835..ec6cb8671a44af 100644
--- a/.github/workflows/doxygen.yaml
+++ b/.github/workflows/doxygen.yaml
@@ -82,7 +82,7 @@ jobs:
runs-on: ubuntu-20.04
container:
- image: connectedhomeip/chip-build-doxygen:0.5.79
+ image: connectedhomeip/chip-build-doxygen:0.5.84
if: github.actor != 'restyled-io[bot]'
diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml
index b52f0c998157e3..08e8a0a46bac75 100644
--- a/.github/workflows/examples-ameba.yaml
+++ b/.github/workflows/examples-ameba.yaml
@@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-ameba:0.5.79
+ image: connectedhomeip/chip-build-ameba:0.5.84
options: --user root
steps:
diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml
index 885133547c3d54..3e9612c5823a0a 100644
--- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml
+++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-ti:0.5.79
+ image: connectedhomeip/chip-build-ti:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
@@ -58,7 +58,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-cyw30739.yaml b/.github/workflows/examples-cyw30739.yaml
index 458833b33bdfec..a3126dbba0442c 100644
--- a/.github/workflows/examples-cyw30739.yaml
+++ b/.github/workflows/examples-cyw30739.yaml
@@ -57,7 +57,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml
index 262d9b771795bc..2fa6e21cc2273d 100644
--- a/.github/workflows/examples-efr32.yaml
+++ b/.github/workflows/examples-efr32.yaml
@@ -35,7 +35,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-efr32:0.5.79
+ image: connectedhomeip/chip-build-efr32:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
@@ -61,7 +61,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml
index 61190b3a763a04..469ec1e9088df9 100644
--- a/.github/workflows/examples-esp32.yaml
+++ b/.github/workflows/examples-esp32.yaml
@@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-esp32:0.5.79
+ image: connectedhomeip/chip-build-esp32:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
@@ -59,7 +59,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -118,7 +118,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-esp32:0.5.79
+ image: connectedhomeip/chip-build-esp32:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
@@ -140,7 +140,7 @@ jobs:
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml
index 5f381cc180cd5e..bb2aea6a47e8b5 100644
--- a/.github/workflows/examples-infineon.yaml
+++ b/.github/workflows/examples-infineon.yaml
@@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-infineon:0.5.79
+ image: connectedhomeip/chip-build-infineon:0.5.84
steps:
- uses: Wandalen/wretry.action@v1.0.15
@@ -57,7 +57,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml
index e43db4cef5c77b..9885e1e43788b6 100644
--- a/.github/workflows/examples-k32w.yaml
+++ b/.github/workflows/examples-k32w.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-k32w:0.5.79
+ image: connectedhomeip/chip-build-k32w:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
@@ -60,7 +60,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml
index 369500947303e5..d8509480619562 100644
--- a/.github/workflows/examples-linux-arm.yaml
+++ b/.github/workflows/examples-linux-arm.yaml
@@ -31,7 +31,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-crosscompile:0.5.79
+ image: connectedhomeip/chip-build-crosscompile:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
@@ -58,7 +58,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml
index 2236761bc264ea..e1fb25379daf7a 100644
--- a/.github/workflows/examples-linux-imx.yaml
+++ b/.github/workflows/examples-linux-imx.yaml
@@ -31,6 +31,11 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
+ # TODO: this image SHOULD use a newer version.
+ #
+ # NOTE: After https://github.com/project-chip/connectedhomeip/pull/19941
+ # the image became large enough that github CI runs out of space.
+ # The image has increased from aroud 2.5GB to 10+GB
image: connectedhomeip/chip-build-imx:0.5.79
steps:
diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml
index 2e6e0edb3f40e4..6aefd6d6e4a4ff 100644
--- a/.github/workflows/examples-linux-standalone.yaml
+++ b/.github/workflows/examples-linux-standalone.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
@@ -61,7 +61,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml
index 65bf46ebfcdf71..5facc4ae1d6bba 100644
--- a/.github/workflows/examples-mbed.yaml
+++ b/.github/workflows/examples-mbed.yaml
@@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-mbed-os:0.5.79
+ image: connectedhomeip/chip-build-mbed-os:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
@@ -75,7 +75,7 @@ jobs:
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml
index b15ad7d4aa1da0..0e2c7f4c4f0090 100644
--- a/.github/workflows/examples-nrfconnect.yaml
+++ b/.github/workflows/examples-nrfconnect.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-nrf-platform:0.5.79
+ image: connectedhomeip/chip-build-nrf-platform:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
@@ -74,7 +74,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -196,7 +196,7 @@ jobs:
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build"
- name: Uploading Failed Test Logs
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: test-log
path: |
diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml
index e1e4b40b1f6d3c..b903c0d1d1ba66 100644
--- a/.github/workflows/examples-qpg.yaml
+++ b/.github/workflows/examples-qpg.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
@@ -60,7 +60,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml
index 1089f0a31af578..c74de0749c66ed 100644
--- a/.github/workflows/examples-telink.yaml
+++ b/.github/workflows/examples-telink.yaml
@@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-telink:0.5.79
+ image: connectedhomeip/chip-build-telink:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml
index 68186bfefd1d69..c238ebb2cf5be0 100644
--- a/.github/workflows/examples-tizen.yaml
+++ b/.github/workflows/examples-tizen.yaml
@@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-tizen:0.5.81
+ image: connectedhomeip/chip-build-tizen:0.5.84
options: --user root
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml
index 09960d78aaba1e..64f948db3973b1 100644
--- a/.github/workflows/full-android.yaml
+++ b/.github/workflows/full-android.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-android:0.5.79
+ image: connectedhomeip/chip-build-android:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
@@ -53,7 +53,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml
index dedc1b67b109c4..70f3a88f8fcc5a 100644
--- a/.github/workflows/fuzzing-build.yaml
+++ b/.github/workflows/fuzzing-build.yaml
@@ -31,7 +31,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
@@ -55,7 +55,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -113,7 +113,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml
index 60f620195025d4..30e70d95ec452d 100644
--- a/.github/workflows/qemu.yaml
+++ b/.github/workflows/qemu.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-esp32-qemu:0.5.79
+ image: connectedhomeip/chip-build-esp32-qemu:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
@@ -54,7 +54,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml
index de38d645157cd8..60c4cc1454c128 100644
--- a/.github/workflows/release_artifacts.yaml
+++ b/.github/workflows/release_artifacts.yaml
@@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: connectedhomeip/chip-build-esp32:0.5.79
+ image: connectedhomeip/chip-build-esp32:0.5.84
steps:
- uses: Wandalen/wretry.action@v1.0.15
@@ -47,7 +47,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
@@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: connectedhomeip/chip-build-efr32:0.5.79
+ image: connectedhomeip/chip-build-efr32:0.5.84
steps:
- uses: Wandalen/wretry.action@v1.0.15
name: Checkout
@@ -92,7 +92,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml
index dc800768554bd3..aae77701773fd1 100644
--- a/.github/workflows/smoketest-android.yaml
+++ b/.github/workflows/smoketest-android.yaml
@@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: connectedhomeip/chip-build-android:0.5.79
+ image: connectedhomeip/chip-build-android:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
@@ -54,7 +54,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 72fc925d80c3dc..08a23cb1c4b73c 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
@@ -69,7 +69,7 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: |
@@ -106,7 +106,7 @@ jobs:
"
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-core-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: /tmp/cores/
@@ -114,7 +114,7 @@ jobs:
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-objdir-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: objdir-clone/
@@ -170,14 +170,14 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build Apps
- timeout-minutes: 40
+ timeout-minutes: 60
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
@@ -208,7 +208,7 @@ jobs:
"
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: /cores/
@@ -216,13 +216,13 @@ jobs:
retention-days: 5
- name: Uploading diagnostic logs
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: ~/Library/Logs/DiagnosticReports/
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
name: crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: objdir-clone/
@@ -239,9 +239,8 @@ jobs:
runs-on: ubuntu-latest
container:
- image: connectedhomeip/chip-build:0.5.79
- options:
- --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
+ image: connectedhomeip/chip-build:0.5.84
+ options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
steps:
@@ -249,8 +248,7 @@ jobs:
uses: actions/checkout@v2
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- - name:
- Try to ensure the directories for core dumping exist and we
+ - name: Try to ensure the directories for core dumping exist and we
can write them.
run: |
mkdir /tmp/cores || true
@@ -261,43 +259,40 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
- name:
- bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
+ name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build Python REPL and example apps
timeout-minutes: 50
run: |
- scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
- ./scripts/run_in_build_env.sh \
- "./scripts/build/build_examples.py \
- --target linux-x64-all-clusters-no-ble-no-wifi-tsan-clang-test \
- --target linux-x64-python-bindings \
- build \
- --copy-artifacts-to objdir-clone \
- "
+ scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
+ ./scripts/run_in_build_env.sh \
+ "./scripts/build/build_examples.py \
+ --target linux-x64-all-clusters-no-ble-no-wifi-tsan-clang-test \
+ --target linux-x64-python-bindings \
+ build \
+ --copy-artifacts-to objdir-clone \
+ "
- name: Run Tests
timeout-minutes: 40
run: |
- scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"'
+ scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"'
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-core-linux-python-repl
+ name: crash-core-linux-python-repl
path: /tmp/cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-objdir-linux-python-repl
+ name: crash-objdir-linux-python-repl
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5
@@ -344,49 +339,45 @@ jobs:
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
- name:
- bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
+ name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build Python REPL and example apps
timeout-minutes: 50
run: |
- scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
- ./scripts/run_in_build_env.sh \
- "./scripts/build/build_examples.py \
- --target darwin-x64-all-clusters-${BUILD_VARIANT}-test \
- build \
- --copy-artifacts-to objdir-clone \
- "
+ scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
+ ./scripts/run_in_build_env.sh \
+ "./scripts/build/build_examples.py \
+ --target darwin-x64-all-clusters-${BUILD_VARIANT}-test \
+ build \
+ --copy-artifacts-to objdir-clone \
+ "
- name: Run Tests
timeout-minutes: 30
run: |
- scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"'
+ scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"'
- name: Uploading core files
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-core-darwin-python-repl
+ name: crash-core-darwin-python-repl
path: /cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading diagnostic logs
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-log-darwin-python-repl
+ name: crash-log-darwin-python-repl
path: ~/Library/Logs/DiagnosticReports/
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
- if: ${{ failure() }} && ${{ !env.ACT }}
+ if: ${{ failure() && !env.ACT }}
with:
- name:
- crash-objdir-darwin-python-repl
+ name: crash-objdir-darwin-python-repl
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5
diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml
index d13919cd245a64..c3f8d9224aedc0 100644
--- a/.github/workflows/unit_integration_test.yaml
+++ b/.github/workflows/unit_integration_test.yaml
@@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
container:
- image: connectedhomeip/chip-build:0.5.79
+ image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
@@ -60,7 +60,7 @@ jobs:
scripts/build/gn_bootstrap.sh ;
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
- if: ${{ always() }} && ${{ !env.ACT }}
+ if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml
index ebd49b363048a6..0f8a3bf232dc19 100644
--- a/.github/workflows/zap_regeneration.yaml
+++ b/.github/workflows/zap_regeneration.yaml
@@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-20.04
container:
- image: connectedhomeip/chip-build-zap:0.5.79
+ image: connectedhomeip/chip-build-zap:0.5.84
defaults:
run:
shell: sh
diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml
index 56355d7e351324..6d1b2f2e59682a 100644
--- a/.github/workflows/zap_templates.yaml
+++ b/.github/workflows/zap_templates.yaml
@@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-20.04
container:
- image: connectedhomeip/chip-build-zap:0.5.79
+ image: connectedhomeip/chip-build-zap:0.5.84
defaults:
run:
shell: sh
diff --git a/.gitmodules b/.gitmodules
index ed490c7ed0dd40..2a733a8e6a026e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -266,3 +266,6 @@
url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git
branch = master
platforms = efr32
+[submodule "editline"]
+ path = third_party/editline/repo
+ url = https://github.com/troglobit/editline.git
diff --git a/.restyled.yaml b/.restyled.yaml
index 937a8b4afa2a53..c45fe98588b7ec 100644
--- a/.restyled.yaml
+++ b/.restyled.yaml
@@ -72,6 +72,7 @@ exclude:
- "scripts/idl/tests/outputs/**/*" # Matches generated output 1:1
- "examples/chef/sample_app_util/test_files/*.yaml"
- "examples/chef/zzz_generated/**/*"
+ - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" # https://github.com/project-chip/connectedhomeip/issues/20236
changed_paths:
diff --git a/BUILD.gn b/BUILD.gn
index 7e3cc729bb96ea..b54672a8124a27 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -27,9 +27,12 @@ import("$dir_pw_build/python.gni")
# This build file should not be used in superproject builds.
assert(chip_root == "//")
+import("${chip_root}/build/chip/fuzz_test.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/build/chip/tools.gni")
+import("${build_root}/config/compiler/compiler.gni")
+
import("//src/crypto/crypto.gni")
if (current_toolchain != "${dir_pw_toolchain}/default:default") {
@@ -40,6 +43,16 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
enable_pylib = false
}
+ if (enable_fuzz_test_targets) {
+ group("fuzz_tests") {
+ deps = [
+ "${chip_root}/src/credentials/tests:fuzz-chip-cert",
+ "${chip_root}/src/lib/core/tests:fuzz-tlv-reader",
+ "${chip_root}/src/lib/dnssd/minimal_mdns/tests:fuzz-minmdns-packet-parsing",
+ ]
+ }
+ }
+
# Python packages for supporting specific targets.
pw_python_group("python_packages") {
python_deps = [
@@ -88,6 +101,10 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"${nlunit_test_root}:nlunit-test",
]
+ if (enable_fuzz_test_targets) {
+ deps += [ "//:fuzz_tests" ]
+ }
+
if (chip_device_platform != "none") {
deps += [ "${chip_root}/src/app/server" ]
}
@@ -210,7 +227,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
declare_args() {
# Enable building chip with clang.
- enable_host_clang_build = enable_default_builds && host_os != "win"
+ # Disabled on Mac arm64 but note that the "gcc" build uses Apple clang.
+ enable_host_clang_build = enable_default_builds && host_os != "win" &&
+ (host_os != "mac" || host_cpu != "arm64")
# Enable building chip with gcc.
enable_host_gcc_build = enable_default_builds && host_os != "win"
@@ -226,9 +245,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
enable_standalone_chip_tool_build =
enable_default_builds && host_os != "win"
- # Build the darwin-framework-tool example.
- enable_standalone_chip_tool_darwin_build =
- enable_default_builds && host_os == "mac"
+ # Build the darwin-framework-tool example. By default this is off, because
+ # it requires a preceding XCode build of the framework.
+ enable_standalone_chip_tool_darwin_build = false
# Build the shell example.
enable_standalone_shell_build = enable_default_builds && host_os != "win"
diff --git a/build/chip/fuzz_test.gni b/build/chip/fuzz_test.gni
new file mode 100644
index 00000000000000..3d101c21e03762
--- /dev/null
+++ b/build/chip/fuzz_test.gni
@@ -0,0 +1,64 @@
+# Copyright (c) 2020 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build_overrides/build.gni")
+import("//build_overrides/chip.gni")
+import("${build_root}/config/compiler/compiler.gni")
+
+declare_args() {
+ enable_fuzz_test_targets =
+ is_clang && (current_os == "linux" || current_os == "mac")
+}
+
+# Define a fuzz target for chip.
+#
+# Fuzz generally only apply on the following environments:
+# - linux and mac host builds when using clang
+#
+# Sample usage
+#
+# chip_fuzz_target("fuzz-target-name") {
+# sources = [
+# "FuzzTarget.cpp", # Fuzz target
+# ]
+#
+# public_deps = [
+# "${chip_root}/src/lib/foo", # add dependencies here
+# "${nlunit_test_root}:nlunit-test",
+# ]
+# }
+#
+#
+template("chip_fuzz_target") {
+ if (enable_fuzz_test_targets) {
+ executable(target_name) {
+ forward_variables_from(invoker, "*")
+
+ if (defined(public_configs)) {
+ public_configs += [
+ "//build/config/compiler:libfuzzer_fuzzing",
+ "//build/config/compiler:sanitize_address",
+ ]
+ } else {
+ public_configs = [
+ "//build/config/compiler:libfuzzer_fuzzing",
+ "//build/config/compiler:sanitize_address",
+ ]
+ }
+ if (!defined(oubput_dir)) {
+ output_dir = "${root_out_dir}/tests"
+ }
+ }
+ }
+}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 35c51811418096..c5f6392613b749 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -453,7 +453,7 @@ config("coverage_default") {
declare_args() {
# Enable Runtime Type Information (RTTI)
- enable_rtti = false
+ enable_rtti = current_os == "mac" || current_os == "ios"
}
config("no_rtti") {
diff --git a/build_overrides/editline.gni b/build_overrides/editline.gni
new file mode 100644
index 00000000000000..cd3133fdc3397b
--- /dev/null
+++ b/build_overrides/editline.gni
@@ -0,0 +1,18 @@
+# Copyright (c) 2022 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+declare_args() {
+ # Root directory for editline.
+ editline_root = "//third_party/editline"
+}
diff --git a/config/bouffalolab/bl602/lib/pw_rpc/BUILD.gn b/config/bouffalolab/bl602/lib/pw_rpc/BUILD.gn
index 66ab51fc23adf0..8f11811b370736 100644
--- a/config/bouffalolab/bl602/lib/pw_rpc/BUILD.gn
+++ b/config/bouffalolab/bl602/lib/pw_rpc/BUILD.gn
@@ -24,7 +24,7 @@ static_library("pw_rpc") {
public_deps = [
"$dir_pw_rpc:server",
"$dir_pw_rpc/nanopb:echo_service",
- "${chip_root}/examples/platform/bl602/pw_sys_io:pw_sys_io_bl602",
+ "${chip_root}/examples/platform/bouffalolab/bl602/pw_sys_io:pw_sys_io_bl602",
"${dir_pigweed}/pw_hdlc:pw_rpc",
dir_pw_assert,
dir_pw_checksum,
diff --git a/config/bouffalolab/bl602/lib/pw_rpc/pw_rpc.gni b/config/bouffalolab/bl602/lib/pw_rpc/pw_rpc.gni
index 172d2f366d3212..87e772e7c7ba96 100644
--- a/config/bouffalolab/bl602/lib/pw_rpc/pw_rpc.gni
+++ b/config/bouffalolab/bl602/lib/pw_rpc/pw_rpc.gni
@@ -16,9 +16,9 @@ import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
pw_log_BACKEND = "$dir_pw_log_basic"
-pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
+pw_assert_BACKEND = "$dir_pw_assert_log"
pw_sys_io_BACKEND =
- "${chip_root}/examples/platform/bl602/pw_sys_io:pw_sys_io_bl602"
+ "${chip_root}/examples/platform/bouffalolab/bl602/pw_sys_io:pw_sys_io_bl602"
pw_span_ENABLE_STD_SPAN_POLYFILL = false
pw_build_LINK_DEPS = [
diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig
index 9bf628cdb1a63e..2fe7f24571eaff 100644
--- a/config/nrfconnect/chip-module/Kconfig
+++ b/config/nrfconnect/chip-module/Kconfig
@@ -78,6 +78,7 @@ config CHIP_DEBUG_SYMBOLS
config CHIP_FACTORY_DATA
bool "Enable Factory Data support"
select ZCBOR
+ select FPROTECT
help
Enables support for reading factory data from flash memory partition.
It requires factory_data partition to exist in the partition manager
diff --git a/docs/guides/nrfconnect_factory_data_configuration.md b/docs/guides/nrfconnect_factory_data_configuration.md
index 786042f7c785a7..9e587c85030fdb 100644
--- a/docs/guides/nrfconnect_factory_data_configuration.md
+++ b/docs/guides/nrfconnect_factory_data_configuration.md
@@ -22,6 +22,12 @@ For the nRF Connect platform, the factory data is stored by default in a
separate partition of the internal flash memory. This helps to keep the factory
data secure by applying hardware write protection.
+> Note: Due to hardware limitations, in the nRF Connect platform, protection
+> against writing can be applied only to the internal memory partition. The
+> [Fprotect](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/others/fprotect.html)
+> is the hardware flash protection driver, and we used it to ensure write
+> protection of the factory data partition in internal flash memory.
+
diff --git a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
index 2db5f21cee2c85..259ff3d726f529 100644
--- a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
@@ -71,9 +71,6 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
OnInternetConnectivityChange(event);
break;
- case DeviceEventType::kSessionEstablished:
- OnSessionEstablished(event);
- break;
case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
(event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned))
@@ -140,14 +137,6 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
}
}
-void DeviceCallbacks::OnSessionEstablished(const ChipDeviceEvent * event)
-{
- if (event->SessionEstablished.IsCommissioner)
- {
- ChipLogProgress(DeviceLayer, "Commissioner detected!");
- }
-}
-
void DeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value)
{
VerifyOrExit(attributeId == ZCL_ON_OFF_ATTRIBUTE_ID,
diff --git a/examples/all-clusters-app/ameba/main/include/DeviceCallbacks.h b/examples/all-clusters-app/ameba/main/include/DeviceCallbacks.h
index 003b6e700db0eb..18ebb25ed75f36 100644
--- a/examples/all-clusters-app/ameba/main/include/DeviceCallbacks.h
+++ b/examples/all-clusters-app/ameba/main/include/DeviceCallbacks.h
@@ -39,7 +39,6 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
- void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event);
void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
};
diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni b/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni
index bd6e49f7871b4f..8f67c7f5edd0c7 100644
--- a/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni
+++ b/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni
@@ -33,6 +33,8 @@ chip_openthread_ftd = false
# Disable CHIP Logging
chip_progress_logging = false
+
+# Dsiable verbose logs for all-clusters app to save Flash
chip_detail_logging = false
chip_automation_logging = false
diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
index f99dd873e2fd60..b00e11a766a6da 100644
--- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -30,6 +30,13 @@
#include
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+#include
+#include
+#include
+#include
+#include
+#endif
#include
#include
@@ -62,6 +69,26 @@ AppTask AppTask::sAppTask;
constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+static DefaultOTARequestor sRequestorCore;
+static DefaultOTARequestorStorage sRequestorStorage;
+static DefaultOTARequestorDriver sRequestorUser;
+static BDXDownloader sDownloader;
+static OTAImageProcessorImpl sImageProcessor;
+
+void InitializeOTARequestor(void)
+{
+ // Initialize and interconnect the Requestor and Image Processor objects
+ SetRequestorInstance(&sRequestorCore);
+
+ sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage());
+ sRequestorCore.Init(Server::GetInstance(), sRequestorStorage, sRequestorUser, sDownloader);
+ sImageProcessor.SetOTADownloader(&sDownloader);
+ sDownloader.SetImageProcessorDelegate(&sImageProcessor);
+ sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
+}
+#endif
+
#ifdef AUTO_PRINT_METRICS
static void printMetrics(void)
{
@@ -93,14 +120,6 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
{
switch (event->Type)
{
- case DeviceEventType::kSessionEstablished: {
- if (event->SessionEstablished.IsCommissioner)
- {
- PLAT_LOG("Commissioning session established");
- }
- }
- break;
-
case DeviceEventType::kCHIPoBLEConnectionEstablished:
PLAT_LOG("CHIPoBLE connection established");
break;
@@ -238,6 +257,9 @@ int AppTask::Init()
// this function will happen on the CHIP event loop thread, not the app_main thread.
PlatformMgr().AddEventHandler(DeviceEventCallback, reinterpret_cast(nullptr));
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+ InitializeOTARequestor();
+#endif
// QR code will be used with CHIP Tool
PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE));
diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp
index 3095a00458d8da..ea2b7e5094c95e 100644
--- a/examples/all-clusters-app/linux/main-common.cpp
+++ b/examples/all-clusters-app/linux/main-common.cpp
@@ -31,12 +31,23 @@
#include
#include
#include
-#include
#include
+#include
#include
#include
#include
+#if CHIP_DEVICE_LAYER_TARGET_DARWIN
+#include
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
+#include
+#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI
+#endif // CHIP_DEVICE_LAYER_TARGET_DARWIN
+
+#if CHIP_DEVICE_LAYER_TARGET_LINUX
+#include
+#endif // CHIP_DEVICE_LAYER_TARGET_LINUX
+
#include
using namespace chip;
@@ -388,22 +399,33 @@ constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;
#if CHIP_DEVICE_LAYER_TARGET_LINUX
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
-NetworkCommissioning::LinuxThreadDriver sLinuxThreadDriver;
-Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(kNetworkCommissioningEndpointMain,
- &sLinuxThreadDriver);
-#endif
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
-NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver;
-Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointSecondary,
- &sLinuxWiFiDriver);
-#endif
-NetworkCommissioning::LinuxEthernetDriver sLinuxEthernetDriver;
-Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain,
- &sLinuxEthernetDriver);
-#else // CHIP_DEVICE_LAYER_TARGET_LINUX
-Clusters::NetworkCommissioning::NullNetworkDriver sNullNetworkDriver;
-Clusters::NetworkCommissioning::Instance sNullNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sNullNetworkDriver);
+NetworkCommissioning::LinuxThreadDriver sThreadDriver;
+#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
+
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
+NetworkCommissioning::LinuxWiFiDriver sWiFiDriver;
+#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI
+
+NetworkCommissioning::LinuxEthernetDriver sEthernetDriver;
#endif // CHIP_DEVICE_LAYER_TARGET_LINUX
+
+#if CHIP_DEVICE_LAYER_TARGET_DARWIN
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
+NetworkCommissioning::DarwinWiFiDriver sWiFiDriver;
+#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI
+
+NetworkCommissioning::DarwinEthernetDriver sEthernetDriver;
+#endif // CHIP_DEVICE_LAYER_TARGET_DARWIN
+
+#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
+Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sThreadDriver);
+#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
+
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
+Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointSecondary, &sWiFiDriver);
+#endif
+
+Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sEthernetDriver);
} // namespace
void ApplicationInit()
@@ -416,7 +438,6 @@ void ApplicationInit()
// Enable secondary endpoint only when we need it, this should be applied to all platforms.
emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false);
-#if CHIP_DEVICE_LAYER_TARGET_LINUX
const bool kThreadEnabled = {
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
LinuxDeviceOptions::GetInstance().mThread
@@ -426,7 +447,7 @@ void ApplicationInit()
};
const bool kWiFiEnabled = {
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
LinuxDeviceOptions::GetInstance().mWiFi
#else
false
@@ -438,7 +459,7 @@ void ApplicationInit()
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
sThreadNetworkCommissioningInstance.Init();
#endif
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
sWiFiNetworkCommissioningInstance.Init();
#endif
// Only enable secondary endpoint for network commissioning cluster when both WiFi and Thread are enabled.
@@ -452,23 +473,17 @@ void ApplicationInit()
}
else if (kWiFiEnabled)
{
-#if CHIP_DEVICE_CONFIG_ENABLE_WPA
+#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
// If we only enable WiFi on this device, "move" WiFi instance to main NetworkCommissioning cluster endpoint.
sWiFiNetworkCommissioningInstance.~Instance();
new (&sWiFiNetworkCommissioningInstance)
- Clusters::NetworkCommissioning::Instance(kNetworkCommissioningEndpointMain, &sLinuxWiFiDriver);
+ Clusters::NetworkCommissioning::Instance(kNetworkCommissioningEndpointMain, &sWiFiDriver);
sWiFiNetworkCommissioningInstance.Init();
#endif
}
else
-#endif // CHIP_DEVICE_LAYER_TARGET_LINUX
{
-#if CHIP_DEVICE_LAYER_TARGET_LINUX
sEthernetNetworkCommissioningInstance.Init();
-#else
- // Use NullNetworkCommissioningInstance to disable the network commissioning functions.
- sNullNetworkCommissioningInstance.Init();
-#endif
}
}
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 70297d01d4ac6d..0943510a9b81d6 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -2086,6 +2086,9 @@ server cluster WindowCovering = 258 {
readonly attribute OperationalStatus operationalStatus = 10;
readonly attribute EndProductType endProductType = 13;
attribute access(write: manage) Mode mode = 23;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
@@ -3590,6 +3593,9 @@ endpoint 1 {
ram attribute operationalStatus;
ram attribute endProductType;
persist attribute mode;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute attributeList;
ram attribute featureMap default = 1;
ram attribute clusterRevision default = 5;
}
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
index 4828e3e7b31699..8a0a01ca25588f 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
@@ -13880,6 +13880,54 @@
"maxInterval": 65344,
"reportableChange": 0
},
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
{
"name": "FeatureMap",
"code": 65532,
diff --git a/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp
index 8f18f730999cde..502057c88ae215 100644
--- a/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp
@@ -60,9 +60,6 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
OnInternetConnectivityChange(event);
break;
- case DeviceEventType::kSessionEstablished:
- OnSessionEstablished(event);
- break;
case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
(event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned))
@@ -117,14 +114,6 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
}
}
-void DeviceCallbacks::OnSessionEstablished(const ChipDeviceEvent * event)
-{
- if (event->SessionEstablished.IsCommissioner)
- {
- ChipLogProgress(DeviceLayer, "Commissioner detected!");
- }
-}
-
void DeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value)
{
VerifyOrExit(attributeId == ZCL_ON_OFF_ATTRIBUTE_ID,
diff --git a/examples/all-clusters-minimal-app/ameba/main/include/DeviceCallbacks.h b/examples/all-clusters-minimal-app/ameba/main/include/DeviceCallbacks.h
index 003b6e700db0eb..18ebb25ed75f36 100644
--- a/examples/all-clusters-minimal-app/ameba/main/include/DeviceCallbacks.h
+++ b/examples/all-clusters-minimal-app/ameba/main/include/DeviceCallbacks.h
@@ -39,7 +39,6 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
- void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event);
void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value);
};
diff --git a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/args.gni b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/args.gni
index e7438af247a9c2..8f67c7f5edd0c7 100644
--- a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/args.gni
+++ b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/args.gni
@@ -32,7 +32,9 @@ chip_enable_ota_requestor = false
chip_openthread_ftd = false
# Disable CHIP Logging
-#chip_progress_logging = false
+chip_progress_logging = false
+
+# Dsiable verbose logs for all-clusters app to save Flash
chip_detail_logging = false
chip_automation_logging = false
diff --git a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/AppTask.cpp
index f99dd873e2fd60..b00e11a766a6da 100644
--- a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -30,6 +30,13 @@
#include
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+#include
+#include
+#include
+#include
+#include
+#endif
#include
#include
@@ -62,6 +69,26 @@ AppTask AppTask::sAppTask;
constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+static DefaultOTARequestor sRequestorCore;
+static DefaultOTARequestorStorage sRequestorStorage;
+static DefaultOTARequestorDriver sRequestorUser;
+static BDXDownloader sDownloader;
+static OTAImageProcessorImpl sImageProcessor;
+
+void InitializeOTARequestor(void)
+{
+ // Initialize and interconnect the Requestor and Image Processor objects
+ SetRequestorInstance(&sRequestorCore);
+
+ sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage());
+ sRequestorCore.Init(Server::GetInstance(), sRequestorStorage, sRequestorUser, sDownloader);
+ sImageProcessor.SetOTADownloader(&sDownloader);
+ sDownloader.SetImageProcessorDelegate(&sImageProcessor);
+ sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
+}
+#endif
+
#ifdef AUTO_PRINT_METRICS
static void printMetrics(void)
{
@@ -93,14 +120,6 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
{
switch (event->Type)
{
- case DeviceEventType::kSessionEstablished: {
- if (event->SessionEstablished.IsCommissioner)
- {
- PLAT_LOG("Commissioning session established");
- }
- }
- break;
-
case DeviceEventType::kCHIPoBLEConnectionEstablished:
PLAT_LOG("CHIPoBLE connection established");
break;
@@ -238,6 +257,9 @@ int AppTask::Init()
// this function will happen on the CHIP event loop thread, not the app_main thread.
PlatformMgr().AddEventHandler(DeviceEventCallback, reinterpret_cast(nullptr));
+#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
+ InitializeOTARequestor();
+#endif
// QR code will be used with CHIP Tool
PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE));
diff --git a/examples/build_overrides/editline.gni b/examples/build_overrides/editline.gni
new file mode 100644
index 00000000000000..7f20e53733eeb7
--- /dev/null
+++ b/examples/build_overrides/editline.gni
@@ -0,0 +1,18 @@
+# Copyright (c) 2022 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+declare_args() {
+ # Root directory for editline.
+ editline_root = "//third_party/connectedhomeip/third_party/editline"
+}
diff --git a/examples/chef/README.md b/examples/chef/README.md
index cacd895b2c0342..07579f3791947a 100644
--- a/examples/chef/README.md
+++ b/examples/chef/README.md
@@ -1,25 +1,23 @@
# MATTER CHEF APP
-The purpose of the chef app is to to increase the coverage of device types in
-Matter.
+The purpose of the chef app is to to:
-It uses the shell app a starting point, adding the processing of ZAP files and
-the support of a few targets under a unified build script: `chef.py`.
+1. Increase the coverage of device types in Matter
+2. Provide a sample application that may have its data model easily configured.
+
+Chef uses the shell app a starting point, but processes the data model defined
+on ZAP files during build time. This procedure is handled by its unified build
+script: `chef.py`.
As it incorporates the processing of ZAP files as part of the build process, it
does not use `zzz_generated`, but rather places the auto-generated zap artifacts
-under its `zap-generated` temporary folder.
-
-All device types available (DM/IM .zap files) are found inside the `devices`
-folder.
+under its `out` temporary folder.
-## Building a Sample Application
-
-Run `chef.py -h` to see the available commands
+All device types available (.zap files) are found inside the `devices` folder.
## Building your first sample
-1. Make sure you have the toolchain installed for your desired target
+1. Make sure you have the toolchain installed for your desired target.
2. Run `chef.py` the first time to create a `config.yaml` configuration file. If
you already have SDK environment variables such as IDF_PATH (esp32) and
ZEPHYR_BASE (nrfconnect) it will use those values as default.
@@ -44,11 +42,12 @@ Run `chef.py -h` to see the available commands
TTY: /dev/ttyUSB0
```
-4. Run `$ chef.py -u` to update zap and the toolchain (on selected platforms)
+4. Run `$ chef.py -u` to update zap and the toolchain (on selected platforms).
5. Run `$ chef.py -gzbf -t -d lighting`. This command will run the
ZAP GUI opening the `devices/lighting.zap` file and will allow editing. It
will then generate the zap artifacts, place them on the `zap-generated`
- folder, run a build and flash the binary in your target
+ folder, run a build and flash the binary in your target.
+6. Run `chef.py -h` to see all available commands.
## Creating a new device type in your device library
@@ -59,6 +58,27 @@ Run `chef.py -h` to see the available commands
into the `devices` folder. This device is now available for the script. See
`chef.py -h` for a list of devices available.
+## Folder Structure and Guidelines
+
+- ``: build system and `main.cpp` file for every supported platform.
+ When porting a new platform, please minimize the source code in this folder,
+ favoring the `common` folder for code that is not platform related.
+- `common`: contains code shared between different platforms. It may contain
+ source code that enables specific features such as `LightingManager` class
+ or `LockManager`, as long as the application dynamically identify the
+ presence of the relevant cluster configurations and it doesn't break the use
+ cases where chef is built without these clusters.
+- `devices`: contains the data models that may be used with chef. As of Matter
+ 1.0 the data models are defined using .zap files.
+- `out`: temporary folder used for placing ZAP generated artifacts.
+- `sample_app_util`: guidelines and scripts for generating file names for new
+ device types committed to the `devices` folder.
+- `config.yaml`: contains general configuration for the `chef.py` script. As
+ of Matter 1.0 this is used exclusively for toolchain and TTY interface
+ paths.
+- `chef.py`: main script for generating samples. More info on its help
+ `chef.py -h`.
+
## CI
All CI jobs for chef can be found in `.github/workflows/chef.yaml`.
diff --git a/examples/chef/chef.py b/examples/chef/chef.py
index f570a95100b3cb..723861bbc35dbf 100755
--- a/examples/chef/chef.py
+++ b/examples/chef/chef.py
@@ -323,6 +323,11 @@ def main(argv: Sequence[str]) -> None:
dest="keep_going", action="store_true")
parser.add_option(
"", "--ci", help="Builds Chef examples defined in cicd_config. Uses --use_zzz. Uses specified target from -t. Chef exits after completion.", dest="ci", action="store_true")
+ parser.add_option(
+ "", "--ipv6only", help="Compile build which only supports ipv6. Linux only.",
+ action="store_true")
+ parser.add_option(
+ "", "--cpu_type", help="CPU type to compile for. Linux only.", choices=["arm64", "x64"])
options, _ = parser.parse_args(argv)
@@ -355,7 +360,10 @@ def main(argv: Sequence[str]) -> None:
#
if options.ci:
- for device_name in [d for d in _DEVICE_LIST if d in cicd_config["ci_allow_list"]]:
+ for device_name in cicd_config["ci_allow_list"]:
+ if device_name not in _DEVICE_LIST:
+ flush_print(f"{device_name} in CICD config but not {_DEVICE_FOLDER}!")
+ exit(1)
if options.build_target == "nrfconnect":
shell.run_cmd("export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"")
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}")
@@ -505,6 +513,7 @@ def main(argv: Sequence[str]) -> None:
if options.do_build:
sw_ver_string = ""
+
if options.do_automated_test_stamp:
branch = ""
for branch_text in shell.run_cmd("git branch", return_cmd_output=True).split("\n"):
@@ -596,17 +605,48 @@ def main(argv: Sequence[str]) -> None:
elif options.build_target == "linux":
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/linux")
+
+ linux_args = []
+ if options.do_rpc:
+ linux_args.append('import("//with_pw_rpc.gni")')
+ linux_args.extend([
+ 'import("//build_overrides/chip.gni")',
+ 'import("${chip_root}/config/standalone/args.gni")',
+ 'chip_shell_cmd_server = false',
+ 'chip_build_libshell = true',
+ 'chip_config_network_layer_ble = false',
+ f'target_defines = ["CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID={options.vid}", "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID={options.pid}", "CONFIG_ENABLE_PW_RPC={int(options.do_rpc)}"]',
+ ])
+ if options.cpu_type == "arm64":
+ uname_resp = shell.run_cmd("uname -m", return_cmd_output=True)
+ if "aarch" not in uname_resp and "arm" not in uname_resp:
+ if (
+ "aarch" not in uname_resp and
+ "arm" not in uname_resp and
+ "SYSROOT_AARCH64" not in shell.env):
+ flush_print(
+ "SYSROOT_AARCH64 env variable not set. "
+ "AARCH64 toolchain needed for cross-compiling for arm64.")
+ exit(1)
+ shell.env["PKG_CONFIG_PATH"] = (
+ f'{shell.env["SYSROOT_AARCH64"]}/lib/aarch64-linux-gnu/pkgconfig')
+ linux_args.append('target_cpu="arm64"')
+ linux_args.append('is_clang=true')
+ linux_args.append('chip_crypto="mbedtls"')
+ linux_args.append(f'sysroot="{shell.env["SYSROOT_AARCH64"]}"')
+ elif options.cpu_type == "x64":
+ uname_resp = shell.run_cmd("uname -m", return_cmd_output=True)
+ if "x64" not in uname_resp and "x86_64" not in uname_resp:
+ flush_print(f"Unable to cross compile for x64 on {uname_resp}")
+ exit(1)
+ if options.ipv6only:
+ linux_args.append("chip_inet_config_enable_ipv4=false")
+
+ if sw_ver_string:
+ linux_args.append(
+ f'chip_device_config_device_software_version_string = "{sw_ver_string}"')
with open(f"{_CHEF_SCRIPT_PATH}/linux/args.gni", "w") as f:
- sw_ver_string_config_text = f"chip_device_config_device_software_version_string = \"{sw_ver_string}\"" if sw_ver_string else ""
- f.write(textwrap.dedent(f"""\
- import("//build_overrides/chip.gni")
- import("${{chip_root}}/config/standalone/args.gni")
- chip_shell_cmd_server = false
- chip_build_libshell = true
- chip_config_network_layer_ble = false
- target_defines = ["CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID={options.vid}", "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID={options.pid}", "CONFIG_ENABLE_PW_RPC={'1' if options.do_rpc else '0'}"]
- {sw_ver_string_config_text}
- """))
+ f.write("\n".join(linux_args))
with open(f"{_CHEF_SCRIPT_PATH}/linux/sample.gni", "w") as f:
f.write(textwrap.dedent(f"""\
sample_zap_file = "{options.sample_device_type_name}.zap"
@@ -614,11 +654,7 @@ def main(argv: Sequence[str]) -> None:
"""))
if options.do_clean:
shell.run_cmd(f"rm -rf out")
- if options.do_rpc:
- shell.run_cmd(
- "gn gen out --args='import(\"//with_pw_rpc.gni\")'")
- else:
- shell.run_cmd("gn gen out --args=''")
+ shell.run_cmd("gn gen out")
shell.run_cmd("ninja -C out")
#
diff --git a/examples/chef/cicd_config.json b/examples/chef/cicd_config.json
index a8b7ca99bad84f..ab283ae2a4b10f 100644
--- a/examples/chef/cicd_config.json
+++ b/examples/chef/cicd_config.json
@@ -1,5 +1,5 @@
{
- "ci_allow_list": ["rootnode_dimmablelight_gY80DaqEUL"],
+ "ci_allow_list": ["rootnode_dimmablelight_bCwGYSDpoe"],
"cd_platforms": {
"linux": "linux_x86",
"esp32": "m5stack",
diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn
index 4161916a993f49..8016d069fb4b34 100644
--- a/examples/chef/efr32/BUILD.gn
+++ b/examples/chef/efr32/BUILD.gn
@@ -336,6 +336,11 @@ efr32_executable("chef_app") {
]
}
+ # Attestation Credentials
+ if (chip_build_platform_attestation_credentials_provider) {
+ deps += [ "${examples_plat_dir}:efr32-attestation-credentials" ]
+ }
+
output_dir = root_out_dir
}
diff --git a/examples/chef/efr32/src/AppTask.cpp b/examples/chef/efr32/src/AppTask.cpp
index 15ff91d64a5fa6..b6450ba696d126 100644
--- a/examples/chef/efr32/src/AppTask.cpp
+++ b/examples/chef/efr32/src/AppTask.cpp
@@ -43,9 +43,6 @@
#include
-#include
-#include
-
#include
#include
@@ -167,7 +164,6 @@ Identify gIdentify = {
} // namespace
using namespace chip::TLV;
-using namespace ::chip::Credentials;
using namespace ::chip::DeviceLayer;
AppTask AppTask::sAppTask;
@@ -205,11 +201,6 @@ CHIP_ERROR AppTask::Init()
sWiFiNetworkCommissioningInstance.Init();
#endif
- chip::DeviceLayer::PlatformMgr().LockChipStack();
- // Initialize device attestation config
- SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
- chip::DeviceLayer::PlatformMgr().UnlockChipStack();
-
// Create FreeRTOS sw timer for Function Selection.
sFunctionTimer = xTimerCreate("FnTmr", // Just a text name, not used by the RTOS kernel
1, // == default timer period (mS)
diff --git a/examples/chef/efr32/src/main.cpp b/examples/chef/efr32/src/main.cpp
index 920f51b8e5805d..1e658f4369c92d 100644
--- a/examples/chef/efr32/src/main.cpp
+++ b/examples/chef/efr32/src/main.cpp
@@ -25,12 +25,19 @@
#include "sl_system_kernel.h"
#include
#include
+#include
#include
+#ifdef EFR32_ATTESTATION_CREDENTIALS
+#include
+#else
+#include
+#endif
#define BLE_DEV_NAME "SiLabs-Chef-App"
using namespace ::chip;
using namespace ::chip::Inet;
using namespace ::chip::DeviceLayer;
+using namespace ::chip::Credentials;
#define UNUSED_PARAMETER(a) (a = a)
@@ -49,6 +56,15 @@ int main(void)
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
+ chip::DeviceLayer::PlatformMgr().LockChipStack();
+ // Initialize device attestation config
+#ifdef EFR32_ATTESTATION_CREDENTIALS
+ SetDeviceAttestationCredentialsProvider(EFR32::GetEFR32DacProvider());
+#else
+ SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+#endif
+ chip::DeviceLayer::PlatformMgr().UnlockChipStack();
+
EFR32_LOG("Starting App Task");
if (GetAppTask().StartAppTask() != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
diff --git a/examples/chef/esp32/main/main.cpp b/examples/chef/esp32/main/main.cpp
index f09a8a7ed3ca37..a3e8737289f4ef 100644
--- a/examples/chef/esp32/main/main.cpp
+++ b/examples/chef/esp32/main/main.cpp
@@ -98,13 +98,6 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
break;
- case DeviceEventType::kSessionEstablished:
- if (event->SessionEstablished.IsCommissioner)
- {
- ChipLogProgress(Shell, "Commissioner detected!");
- }
- break;
-
case DeviceEventType::kCHIPoBLEConnectionEstablished:
ChipLogProgress(Shell, "CHIPoBLE connection established");
break;
diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn
index 1e47fb4f2ed1bb..2c5880cea2d9a0 100644
--- a/examples/chip-tool/BUILD.gn
+++ b/examples/chip-tool/BUILD.gn
@@ -19,6 +19,10 @@ import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/examples/chip-tool/chip-tool.gni")
import("${chip_root}/src/lib/core/core.gni")
+if (config_use_interactive_mode) {
+ import("//build_overrides/editline.gni")
+}
+
assert(chip_build_tools)
config("config") {
@@ -37,10 +41,6 @@ config("config") {
]
cflags = [ "-Wconversion" ]
-
- if (config_use_interactive_mode) {
- libs = [ "readline" ]
- }
}
static_library("chip-tool-utils") {
@@ -77,8 +77,11 @@ static_library("chip-tool-utils") {
"config/PersistentStorage.cpp",
]
+ deps = []
+
if (config_use_interactive_mode) {
sources += [ "commands/interactive/InteractiveCommands.cpp" ]
+ deps += [ "${editline_root}:editline" ]
}
if (config_enable_yaml_tests) {
diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp
index 9c06ed70b0edd1..fd255abfe204b0 100644
--- a/examples/chip-tool/commands/clusters/ModelCommand.cpp
+++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp
@@ -66,7 +66,8 @@ void ModelCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CH
void ModelCommand::Shutdown()
{
- ResetArguments();
mOnDeviceConnectedCallback.Cancel();
mOnDeviceConnectionFailureCallback.Cancel();
+
+ CHIPCommand::Shutdown();
}
diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h
index 5a6bb4bf20c3b3..98f8f6de772051 100644
--- a/examples/chip-tool/commands/clusters/ReportCommand.h
+++ b/examples/chip-tool/commands/clusters/ReportCommand.h
@@ -411,3 +411,29 @@ class SubscribeEvent : public SubscribeCommand
chip::Optional mKeepSubscriptions;
chip::Optional> mIsUrgents;
};
+
+class ReadAll : public ReadCommand
+{
+public:
+ ReadAll(CredentialIssuerCommands * credsIssuerConfig) : ReadCommand("read-all", credsIssuerConfig)
+ {
+ AddArgument("fabric-filtered", 0, 1, &mFabricFiltered);
+ ReadCommand::AddArguments();
+ }
+
+ ~ReadAll() {}
+
+ void OnDone(chip::app::ReadClient * aReadClient) override
+ {
+ InteractionModelReports::CleanupReadClient(aReadClient);
+ SetCommandExitStatus(mError);
+ }
+
+ CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override
+ {
+ return ReadCommand::ReadAll(device, endpointIds, mFabricFiltered);
+ }
+
+private:
+ chip::Optional mFabricFiltered;
+};
diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h
index e4cebf6095cc35..7688a34873bfbe 100644
--- a/examples/chip-tool/commands/common/CHIPCommand.h
+++ b/examples/chip-tool/commands/common/CHIPCommand.h
@@ -101,7 +101,7 @@ class CHIPCommand : public Command
// Shut down the command. After a Shutdown call the command object is ready
// to be used for another command invocation.
- virtual void Shutdown() {}
+ virtual void Shutdown() { ResetArguments(); }
// Clean up any resources allocated by the command. Some commands may hold
// on to resources after Shutdown(), but Cleanup() will guarantee those are
diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp
index 1931d88e39752f..59812076cfde75 100644
--- a/examples/chip-tool/commands/common/Command.cpp
+++ b/examples/chip-tool/commands/common/Command.cpp
@@ -355,7 +355,7 @@ bool Command::InitArgument(size_t argIndex, char * argValue)
isValidArgument = HandleNullableOptional(arg, argValue, [&](auto * value) {
// We support two ways to pass an octet string argument. If it happens
// to be all-ASCII, you can just pass it in. Otherwise you can pass in
- // 0x followed by the hex-encoded bytes.
+ // "hex:" followed by the hex-encoded bytes.
size_t argLen = strlen(argValue);
static constexpr char hexPrefix[] = "hex:";
constexpr size_t prefixLen = ArraySize(hexPrefix) - 1; // Don't count the null
@@ -854,44 +854,154 @@ size_t Command::AddArgumentToList(Argument && argument)
return 0;
}
+namespace {
+template
+void ResetOptionalArg(const Argument & arg)
+{
+ VerifyOrDie(arg.isOptional());
+
+ if (arg.isNullable())
+ {
+ reinterpret_cast> *>(arg.value)->ClearValue();
+ }
+ else
+ {
+ reinterpret_cast *>(arg.value)->ClearValue();
+ }
+}
+} // anonymous namespace
+
void Command::ResetArguments()
{
for (size_t i = 0; i < mArgs.size(); i++)
{
const Argument arg = mArgs[i];
const ArgumentType type = arg.type;
- const uint8_t flags = arg.flags;
- if (type == ArgumentType::VectorBool && flags == Argument::kOptional)
+ if (arg.isOptional())
{
- auto vectorArgument = static_cast *>(arg.value);
- vectorArgument->clear();
- }
- else if (type == ArgumentType::Vector16 && flags != Argument::kOptional)
- {
- auto vectorArgument = static_cast *>(arg.value);
- vectorArgument->clear();
- }
- else if (type == ArgumentType::Vector32 && flags != Argument::kOptional)
- {
- auto vectorArgument = static_cast *>(arg.value);
- vectorArgument->clear();
- }
- else if (type == ArgumentType::Vector32 && flags == Argument::kOptional)
- {
- auto optionalArgument = static_cast> *>(arg.value);
- if (optionalArgument->HasValue())
+ // Must always clean these up so they don't carry over to the next
+ // command invocation in interactive mode.
+ switch (type)
{
- optionalArgument->Value().clear();
+ case ArgumentType::Complex: {
+ // No optional complex arguments so far.
+ VerifyOrDie(false);
+ break;
+ }
+ case ArgumentType::Custom: {
+ // No optional custom arguments so far.
+ VerifyOrDie(false);
+ break;
+ }
+ case ArgumentType::VectorBool: {
+ auto vectorArgument = static_cast *>(arg.value);
+ vectorArgument->clear();
+ break;
+ }
+ case ArgumentType::Vector16: {
+ // No optional Vector16 arguments so far.
+ VerifyOrDie(false);
+ break;
+ }
+ case ArgumentType::Vector32: {
+ ResetOptionalArg>(arg);
+ break;
+ }
+ case ArgumentType::VectorCustom: {
+ // No optional VectorCustom arguments so far.
+ VerifyOrDie(false);
+ break;
+ }
+ case ArgumentType::Attribute: {
+ // No optional Attribute arguments so far.
+ VerifyOrDie(false);
+ break;
+ }
+ case ArgumentType::String: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::CharString: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::OctetString: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Bool: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_uint8: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_uint16: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_uint32: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_uint64: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_int8: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_int16: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_int32: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Number_int64: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Float: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Double: {
+ ResetOptionalArg(arg);
+ break;
+ }
+ case ArgumentType::Address: {
+ ResetOptionalArg(arg);
+ break;
+ }
}
}
- else if (type == ArgumentType::VectorCustom && flags != Argument::kOptional)
+ else
{
- auto vectorArgument = static_cast *>(arg.value);
- for (auto & customArgument : *vectorArgument)
+ // Some non-optional arguments have state that needs to be cleaned
+ // up too.
+ if (type == ArgumentType::Vector16)
{
- delete customArgument;
+ auto vectorArgument = static_cast *>(arg.value);
+ vectorArgument->clear();
+ }
+ else if (type == ArgumentType::Vector32)
+ {
+ auto vectorArgument = static_cast *>(arg.value);
+ vectorArgument->clear();
+ }
+ else if (type == ArgumentType::VectorCustom)
+ {
+ auto vectorArgument = static_cast *>(arg.value);
+ for (auto & customArgument : *vectorArgument)
+ {
+ delete customArgument;
+ }
+ vectorArgument->clear();
}
- vectorArgument->clear();
}
}
}
diff --git a/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp b/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp
index 3cb3cf6153f129..b2fe353931328a 100644
--- a/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp
+++ b/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp
@@ -42,4 +42,6 @@ void DiscoverCommissionersCommand::Shutdown()
ChipLogProgress(chipTool, "Total of %d commissioner(s) discovered in %u sec", commissionerCount,
std::chrono::duration_cast(GetWaitDuration()).count());
+
+ CHIPCommand::Shutdown();
}
diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp
index dbb3a6fbc1c5f0..8a0235f7bb0fb3 100644
--- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp
+++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp
@@ -18,9 +18,8 @@
#include "InteractiveCommands.h"
+#include
#include
-#include
-#include
#include
char kInteractiveModeName[] = "";
diff --git a/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp b/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp
index a9f18be49cd1e6..74abe2a0d58d16 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp
+++ b/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp
@@ -17,6 +17,7 @@
*/
#include "SetupPayloadGenerateCommand.h"
+#include
#include
#include
#include
@@ -62,9 +63,14 @@ CHIP_ERROR SetupPayloadGenerateQRCodeCommand::Run()
{
SetupPayload payload;
- if (mPayload.HasValue())
+ if (mExistingPayload.HasValue())
{
- QRCodeSetupPayloadParser(mPayload.Value()).populatePayload(payload);
+ CHIP_ERROR err = QRCodeSetupPayloadParser(mExistingPayload.Value()).populatePayload(payload);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(chipTool, "Invalid existing payload: %" CHIP_ERROR_FORMAT, err.Format());
+ return err;
+ }
}
ConfigurePayload(payload);
@@ -74,23 +80,135 @@ CHIP_ERROR SetupPayloadGenerateQRCodeCommand::Run()
payload.rendezvousInformation.SetRaw(mRendezvous.Value());
}
+ if (mTLVBytes.HasValue())
+ {
+ CHIP_ERROR err = PopulatePayloadTLVFromBytes(payload, mTLVBytes.Value());
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(chipTool, "Unable to populate payload TLV: %" CHIP_ERROR_FORMAT, err.Format());
+ return err;
+ }
+ }
+
QRCodeSetupPayloadGenerator generator(payload);
generator.SetAllowInvalidPayload(mAllowInvalidPayload.ValueOr(false));
std::string code;
- ReturnErrorOnFailure(generator.payloadBase38Representation(code));
+ ReturnErrorOnFailure(generator.payloadBase38RepresentationWithAutoTLVBuffer(code));
ChipLogProgress(chipTool, "QR Code: %s", code.c_str());
return CHIP_NO_ERROR;
}
+CHIP_ERROR SetupPayloadGenerateQRCodeCommand::PopulatePayloadTLVFromBytes(SetupPayload & payload, const ByteSpan & tlvBytes)
+{
+ // First clear out all the existing TVL bits from the payload. Ignore
+ // errors here, because we don't care if those bits are not present.
+ payload.removeSerialNumber();
+
+ auto existingVendorData = payload.getAllOptionalVendorData();
+ for (auto & data : existingVendorData)
+ {
+ payload.removeOptionalVendorData(data.tag);
+ }
+
+ if (tlvBytes.empty())
+ {
+ // Used to just clear out the existing TLV.
+ return CHIP_NO_ERROR;
+ }
+
+ TLV::TLVReader reader;
+ reader.Init(tlvBytes);
+
+ // Data is a TLV structure.
+ ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag()));
+
+ TLV::TLVType outerType;
+ ReturnErrorOnFailure(reader.EnterContainer(outerType));
+
+ CHIP_ERROR err;
+ while ((err = reader.Next()) == CHIP_NO_ERROR)
+ {
+ TLV::Tag tag = reader.GetTag();
+ if (!TLV::IsContextTag(tag))
+ {
+ ChipLogError(chipTool, "Unexpected non-context TLV tag.");
+ return CHIP_ERROR_INVALID_TLV_TAG;
+ }
+
+ uint8_t tagNum = static_cast(TLV::TagNumFromTag(tag));
+ if (tagNum < 0x80)
+ {
+ // Matter-common tag.
+ if (tagNum != kSerialNumberTag)
+ {
+ ChipLogError(chipTool, "No support yet for Matter-common tags other than serial number");
+ return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
+ }
+
+ // Serial number can be a string or an unsigned integer.
+ if (reader.GetType() == TLV::kTLVType_UTF8String)
+ {
+ CharSpan data;
+ ReturnErrorOnFailure(reader.Get(data));
+ ReturnErrorOnFailure(payload.addSerialNumber(std::string(data.data(), data.size())));
+ continue;
+ }
+
+ if (reader.GetType() == TLV::kTLVType_UnsignedInteger)
+ {
+ uint32_t value;
+ ReturnErrorOnFailure(reader.Get(value));
+ ReturnErrorOnFailure(payload.addSerialNumber(value));
+ continue;
+ }
+
+ ChipLogError(chipTool, "Unexpected type for serial number: %d", to_underlying(reader.GetType()));
+ return CHIP_ERROR_WRONG_TLV_TYPE;
+ }
+
+ // Vendor tag. We support strings and signed integers.
+ if (reader.GetType() == TLV::kTLVType_UTF8String)
+ {
+ CharSpan data;
+ ReturnErrorOnFailure(reader.Get(data));
+ ReturnErrorOnFailure(payload.addOptionalVendorData(tagNum, std::string(data.data(), data.size())));
+ continue;
+ }
+
+ if (reader.GetType() == TLV::kTLVType_SignedInteger)
+ {
+ int32_t value;
+ ReturnErrorOnFailure(reader.Get(value));
+ ReturnErrorOnFailure(payload.addOptionalVendorData(tagNum, value));
+ continue;
+ }
+
+ ChipLogError(chipTool, "Unexpected type for vendor data: %d", to_underlying(reader.GetType()));
+ return CHIP_ERROR_WRONG_TLV_TYPE;
+ }
+
+ VerifyOrReturnError(err == CHIP_END_OF_TLV, err);
+
+ ReturnErrorOnFailure(reader.ExitContainer(outerType));
+ ReturnErrorOnFailure(reader.VerifyEndOfContainer());
+
+ return CHIP_NO_ERROR;
+}
+
CHIP_ERROR SetupPayloadGenerateManualCodeCommand::Run()
{
SetupPayload payload;
- if (mPayload.HasValue())
+ if (mExistingPayload.HasValue())
{
- ManualSetupPayloadParser(mPayload.Value()).populatePayload(payload);
+ CHIP_ERROR err = ManualSetupPayloadParser(mExistingPayload.Value()).populatePayload(payload);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(chipTool, "Invalid existing payload: %" CHIP_ERROR_FORMAT, err.Format());
+ return err;
+ }
}
ConfigurePayload(payload);
diff --git a/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.h b/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.h
index 9e0d13c7cef3b2..31a16e1d9940a5 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.h
+++ b/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.h
@@ -26,7 +26,7 @@ class SetupPayloadGenerateCommand : public Command
public:
SetupPayloadGenerateCommand(const char * name) : Command(name)
{
- AddArgument("payload", &mPayload);
+ AddArgument("existing-payload", &mExistingPayload, "An existing setup payload to modify based on the other arguments.");
AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator);
AddArgument("setup-pin-code", 0, UINT32_MAX, &mSetUpPINCode);
AddArgument("version", 0, UINT8_MAX, &mVersion);
@@ -44,7 +44,7 @@ class SetupPayloadGenerateCommand : public Command
chip::Optional mVersion;
chip::Optional mVendorId;
chip::Optional mProductId;
- chip::Optional mPayload;
+ chip::Optional mExistingPayload;
chip::Optional mCommissioningMode;
chip::Optional mAllowInvalidPayload;
};
@@ -55,11 +55,18 @@ class SetupPayloadGenerateQRCodeCommand : public SetupPayloadGenerateCommand
SetupPayloadGenerateQRCodeCommand() : SetupPayloadGenerateCommand("generate-qrcode")
{
AddArgument("rendezvous", 0, UINT8_MAX, &mRendezvous);
+ AddArgument(
+ "tlvBytes", &mTLVBytes,
+ "Pre-encoded TLV for the optional part of the payload. A nonempty value should be passed as \"hex:\" followed by the "
+ "bytes in hex encoding. Passing an empty string to override the TLV in an existing payload is allowed.");
}
CHIP_ERROR Run() override;
private:
+ static CHIP_ERROR PopulatePayloadTLVFromBytes(chip::SetupPayload & payload, const chip::ByteSpan & tlvBytes);
+
chip::Optional mRendezvous;
+ chip::Optional mTLVBytes;
};
class SetupPayloadGenerateManualCodeCommand : public SetupPayloadGenerateCommand
diff --git a/examples/chip-tool/config/PersistentStorage.cpp b/examples/chip-tool/config/PersistentStorage.cpp
index 8ec4eb35c256f0..f8ceb248095709 100644
--- a/examples/chip-tool/config/PersistentStorage.cpp
+++ b/examples/chip-tool/config/PersistentStorage.cpp
@@ -18,8 +18,7 @@
#include "PersistentStorage.h"
#include
-#include
-#include
+#include
#include
#include
@@ -30,6 +29,7 @@ using Sections = std::map;
using namespace ::chip;
using namespace ::chip::Controller;
+using namespace ::chip::IniEscaping;
using namespace ::chip::Logging;
constexpr const char kDefaultSectionName[] = "Default";
@@ -48,37 +48,6 @@ std::string GetFilename(const char * name)
return "/tmp/chip_tool_config." + std::string(name) + ".ini";
}
-namespace {
-
-std::string StringToBase64(const std::string & value)
-{
- std::unique_ptr buffer(new char[BASE64_ENCODED_LEN(value.length())]);
-
- uint32_t len =
- chip::Base64Encode32(reinterpret_cast(value.data()), static_cast(value.length()), buffer.get());
- if (len == UINT32_MAX)
- {
- return "";
- }
-
- return std::string(buffer.get(), len);
-}
-
-std::string Base64ToString(const std::string & b64Value)
-{
- std::unique_ptr buffer(new uint8_t[BASE64_MAX_DECODED_LEN(b64Value.length())]);
-
- uint32_t len = chip::Base64Decode32(b64Value.data(), static_cast(b64Value.length()), buffer.get());
- if (len == UINT32_MAX)
- {
- return "";
- }
-
- return std::string(reinterpret_cast(buffer.get()), len);
-}
-
-} // namespace
-
CHIP_ERROR PersistentStorage::Init(const char * name)
{
CHIP_ERROR err = CHIP_NO_ERROR;
@@ -95,6 +64,12 @@ CHIP_ERROR PersistentStorage::Init(const char * name)
mName = name;
mConfig.parse(ifs);
ifs.close();
+
+ // To audit the contents at init, uncomment the following:
+#if 0
+ DumpKeys();
+#endif
+
exit:
return err;
}
@@ -106,10 +81,11 @@ CHIP_ERROR PersistentStorage::SyncGetKeyValue(const char * key, void * value, ui
ReturnErrorCodeIf(((value == nullptr) && (size != 0)), CHIP_ERROR_INVALID_ARGUMENT);
auto section = mConfig.sections[kDefaultSectionName];
- auto it = section.find(key);
- ReturnErrorCodeIf(it == section.end(), CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
- ReturnErrorCodeIf(!inipp::extract(section[key], iniValue), CHIP_ERROR_INVALID_ARGUMENT);
+ ReturnErrorCodeIf(!SyncDoesKeyExist(key), CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
+
+ std::string escapedKey = EscapeKey(key);
+ ReturnErrorCodeIf(!inipp::extract(section[escapedKey], iniValue), CHIP_ERROR_INVALID_ARGUMENT);
iniValue = Base64ToString(iniValue);
@@ -126,8 +102,19 @@ CHIP_ERROR PersistentStorage::SyncGetKeyValue(const char * key, void * value, ui
CHIP_ERROR PersistentStorage::SyncSetKeyValue(const char * key, const void * value, uint16_t size)
{
+ ReturnErrorCodeIf((value == nullptr) && (size != 0), CHIP_ERROR_INVALID_ARGUMENT);
+
auto section = mConfig.sections[kDefaultSectionName];
- section[key] = StringToBase64(std::string(static_cast(value), size));
+
+ std::string escapedKey = EscapeKey(key);
+ if (value == nullptr)
+ {
+ section[escapedKey] = "";
+ }
+ else
+ {
+ section[escapedKey] = StringToBase64(std::string(static_cast(value), size));
+ }
mConfig.sections[kDefaultSectionName] = section;
return CommitConfig(mName);
@@ -136,15 +123,42 @@ CHIP_ERROR PersistentStorage::SyncSetKeyValue(const char * key, const void * val
CHIP_ERROR PersistentStorage::SyncDeleteKeyValue(const char * key)
{
auto section = mConfig.sections[kDefaultSectionName];
- auto it = section.find(key);
- ReturnErrorCodeIf(it == section.end(), CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
- section.erase(key);
+ ReturnErrorCodeIf(!SyncDoesKeyExist(key), CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
+
+ std::string escapedKey = EscapeKey(key);
+ section.erase(escapedKey);
mConfig.sections[kDefaultSectionName] = section;
return CommitConfig(mName);
}
+bool PersistentStorage::SyncDoesKeyExist(const char * key)
+{
+ std::string escapedKey = EscapeKey(key);
+ auto section = mConfig.sections[kDefaultSectionName];
+ auto it = section.find(escapedKey);
+ return (it != section.end());
+}
+
+void PersistentStorage::DumpKeys() const
+{
+#if CHIP_PROGRESS_LOGGING
+ for (const auto & section : mConfig.sections)
+ {
+ const std::string & sectionName = section.first;
+ const auto & sectionContent = section.second;
+
+ ChipLogProgress(chipTool, "[%s]", sectionName.c_str());
+ for (const auto & entry : sectionContent)
+ {
+ const std::string & keyName = entry.first;
+ ChipLogProgress(chipTool, " => %s", UnescapeKey(keyName).c_str());
+ }
+ }
+#endif // CHIP_PROGRESS_LOGGING
+}
+
CHIP_ERROR PersistentStorage::SyncClearAll()
{
ChipLogProgress(chipTool, "Clearing %s storage", kDefaultSectionName);
diff --git a/examples/chip-tool/config/PersistentStorage.h b/examples/chip-tool/config/PersistentStorage.h
index d26582ea9b9dfa..f2afde99355bf7 100644
--- a/examples/chip-tool/config/PersistentStorage.h
+++ b/examples/chip-tool/config/PersistentStorage.h
@@ -32,6 +32,9 @@ class PersistentStorage : public chip::PersistentStorageDelegate
CHIP_ERROR SyncGetKeyValue(const char * key, void * buffer, uint16_t & size) override;
CHIP_ERROR SyncSetKeyValue(const char * key, const void * value, uint16_t size) override;
CHIP_ERROR SyncDeleteKeyValue(const char * key) override;
+ bool SyncDoesKeyExist(const char * key) override;
+
+ void DumpKeys() const;
uint16_t GetListenPort();
chip::Logging::LogCategory GetLoggingLevel();
diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt
index 25c8a54859f471..2600ce10eeaa1f 100644
--- a/examples/chip-tool/templates/commands.zapt
+++ b/examples/chip-tool/templates/commands.zapt
@@ -137,6 +137,7 @@ void registerClusterAny(Commands & commands, CredentialIssuerCommands * credsIss
make_unique(credsIssuerConfig), //
make_unique(credsIssuerConfig), //
make_unique(credsIssuerConfig), //
+ make_unique(credsIssuerConfig), //
};
commands.Register(clusterName, clusterCommands);
diff --git a/examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.cpp b/examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.cpp
new file mode 100644
index 00000000000000..5061d53e768a6d
--- /dev/null
+++ b/examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.cpp
@@ -0,0 +1,27 @@
+/*
+ *
+ * Copyright (c) 2021 Project CHIP Authors
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PigweedLoggerMutex.h"
+
+namespace chip {
+namespace rpc {
+
+PigweedLoggerMutex logger_mutex;
+
+} // namespace rpc
+} // namespace chip
diff --git a/examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.h b/examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.h
new file mode 100644
index 00000000000000..4df8b616895e39
--- /dev/null
+++ b/examples/common/pigweed/bouffalolab/bl602/PigweedLoggerMutex.h
@@ -0,0 +1,54 @@
+/*
+ *
+ * Copyright (c) 2021 Project CHIP Authors
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "PigweedLogger.h"
+#include "pigweed/RpcService.h"
+#include "semphr.h"
+#include
+
+namespace chip {
+namespace rpc {
+class PigweedLoggerMutex : public ::chip::rpc::Mutex
+{
+
+public:
+ PigweedLoggerMutex() {}
+ void Lock() override
+ {
+ SemaphoreHandle_t * sem = PigweedLogger::GetSemaphore();
+ if (sem)
+ {
+ xSemaphoreTake(*sem, portMAX_DELAY);
+ }
+ }
+ void Unlock() override
+ {
+ SemaphoreHandle_t * sem = PigweedLogger::GetSemaphore();
+ if (sem)
+ {
+ xSemaphoreGive(*sem);
+ }
+ }
+};
+
+extern PigweedLoggerMutex logger_mutex;
+
+} // namespace rpc
+} // namespace chip
diff --git a/examples/common/pigweed/rpc_services/Device.h b/examples/common/pigweed/rpc_services/Device.h
index 67de5e3c3b3749..d3d5afd165810d 100644
--- a/examples/common/pigweed/rpc_services/Device.h
+++ b/examples/common/pigweed/rpc_services/Device.h
@@ -223,6 +223,7 @@ class Device : public pw_rpc::nanopb::Device::Service
virtual pw::Status TriggerOta(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
+#if CONFIG_CHIP_OTA_REQUESTOR
chip::DeviceLayer::PlatformMgr().ScheduleWork(
[](intptr_t) {
chip::OTARequestorInterface * requestor = chip::GetRequestorInstance();
@@ -237,6 +238,10 @@ class Device : public pw_rpc::nanopb::Device::Service
},
reinterpret_cast(nullptr));
return pw::OkStatus();
+#else
+ ChipLogError(AppServer, "Trigger OTA requested, but OTA requestor not compiled in.");
+ return pw::Status::Unimplemented();
+#endif
}
virtual pw::Status SetPairingState(const chip_rpc_PairingState & request, pw_protobuf_Empty & response)
diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn
index 58d4dd3dd18196..5469315293126e 100644
--- a/examples/darwin-framework-tool/BUILD.gn
+++ b/examples/darwin-framework-tool/BUILD.gn
@@ -18,16 +18,26 @@ import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/examples//chip-tool/chip-tool.gni")
+if (config_use_interactive_mode) {
+ import("//build_overrides/editline.gni")
+}
+
assert(chip_build_tools)
config("config") {
include_dirs = [
".",
+ "${chip_root}/src/darwin/Framework/CHIP/zap-generated",
+ "${chip_root}/src/darwin/Framework/CHIP",
+ "${chip_root}/examples/darwin-framework-tool/commands/common",
"${chip_root}/zzz_generated/darwin-framework-tool",
"${chip_root}/zzz_generated/controller-clusters",
"${chip_root}/examples/chip-tool/commands/clusters/ComplexArgument.h",
+ "/tmp/macos_framework_output",
]
+ framework_dirs = [ "/tmp/macos_framework_output" ]
+
defines = [
"CONFIG_ENABLE_YAML_TESTS=${config_enable_yaml_tests}",
"CONFIG_USE_INTERACTIVE_MODE=${config_use_interactive_mode}",
@@ -37,10 +47,6 @@ config("config") {
"-Wconversion",
"-fobjc-arc",
]
-
- if (config_use_interactive_mode) {
- libs = [ "readline" ]
- }
}
executable("darwin-framework-tool") {
@@ -51,6 +57,7 @@ executable("darwin-framework-tool") {
# privilege-storage.cpp.
"${chip_root}/src/app/util/privilege-storage.cpp",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
+ "${chip_root}/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h",
"commands/clusters/ClusterCommandBridge.h",
"commands/clusters/ModelCommandBridge.mm",
"commands/clusters/ReportCommandBridge.h",
@@ -58,11 +65,15 @@ executable("darwin-framework-tool") {
"commands/common/CHIPCommandBridge.mm",
"commands/common/CHIPCommandStorageDelegate.mm",
"commands/common/CHIPToolKeypair.mm",
+ "commands/common/MTRError.mm",
+ "commands/common/MTRError_Utils.h",
+ "commands/common/MTRLogging.h",
"commands/pairing/Commands.h",
"commands/pairing/OpenCommissioningWindowCommand.h",
"commands/pairing/OpenCommissioningWindowCommand.mm",
"commands/pairing/PairingCommandBridge.mm",
"commands/pairing/PairingDelegateBridge.mm",
+ "commands/payload/SetupPayloadParseCommand.mm",
"commands/storage/Commands.h",
"commands/storage/StorageManagementCommand.mm",
"main.mm",
@@ -70,22 +81,28 @@ executable("darwin-framework-tool") {
if (config_use_interactive_mode) {
sources += [ "commands/interactive/InteractiveCommands.mm" ]
+ deps += [ "${editline_root}:editline" ]
}
if (config_enable_yaml_tests) {
- sources += [ "${chip_root}/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm" ]
+ sources += [ "${chip_root}/zzz_generated/darwin-framework-tool/zap-generated/cluster/MTRTestClustersObjc.mm" ]
}
deps = [
"${chip_root}/examples/chip-tool:chip-tool-utils",
"${chip_root}/src/app/server",
- "${chip_root}/src/darwin/Framework/CHIP",
+ "${chip_root}/src/darwin/Framework/CHIP:static-matter",
"${chip_root}/src/lib",
"${chip_root}/src/platform",
"${chip_root}/third_party/inipp",
"${chip_root}/third_party/jsoncpp",
]
+ frameworks = [
+ "Matter.framework",
+ "Security.framework",
+ ]
+
public_configs = [ ":config" ]
output_dir = root_out_dir
diff --git a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h
index 4eac3990aba8c4..c7c71a324e2a0d 100644
--- a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h
@@ -18,8 +18,9 @@
#pragma once
-#import
-#import // For NSObjectFromCHIPTLV
+#import "MTRError_Utils.h"
+#import
+
#include
#include "ModelCommandBridge.h"
@@ -46,7 +47,7 @@ class ClusterCommand : public ModelCommand {
~ClusterCommand() {}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId) override
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override
{
chip::TLV::TLVWriter writer;
chip::TLV::TLVReader reader;
@@ -67,7 +68,7 @@ class ClusterCommand : public ModelCommand {
return ClusterCommand::SendCommand(device, endpointId, mClusterId, mCommandId, commandFields);
}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId,
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId,
chip::CommandId commandId, id _Nonnull commandFields)
{
uint16_t repeatCount = mRepeatCount.ValueOr(1);
diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h
index adb1d21dece650..ad86fa79aa690e 100644
--- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h
@@ -42,7 +42,7 @@ class ModelCommand : public CHIPCommandBridge
CHIP_ERROR RunCommand() override;
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); }
- virtual CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endPointId) = 0;
+ virtual CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endPointId) = 0;
private:
chip::NodeId mNodeId;
diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm
index 8a27391324cdc5..e039391b8e6289 100644
--- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm
+++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm
@@ -19,34 +19,37 @@
#include "ModelCommandBridge.h"
#include
+#import
+
using namespace ::chip;
CHIP_ERROR ModelCommand::RunCommand()
{
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip-tool.command", DISPATCH_QUEUE_SERIAL);
+ MTRDeviceController * commissioner = CurrentCommissioner();
ChipLogProgress(chipTool, "Sending command to node 0x" ChipLogFormatX64, ChipLogValueX64(mNodeId));
- [CurrentCommissioner() getConnectedDevice:mNodeId
- queue:callbackQueue
- completionHandler:^(CHIPDevice * _Nullable device, NSError * _Nullable error) {
- if (error != nil) {
- SetCommandExitStatus(error, "Error getting connected device");
- return;
- }
-
- CHIP_ERROR err;
- if (device == nil) {
- err = CHIP_ERROR_INTERNAL;
- } else {
- err = SendCommand(device, mEndPointId);
- }
-
- if (err != CHIP_NO_ERROR) {
- ChipLogError(chipTool, "Error: %s", chip::ErrorStr(err));
- SetCommandExitStatus(err);
- return;
- }
- }];
+ [commissioner getDevice:mNodeId
+ queue:callbackQueue
+ completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
+ if (error != nil) {
+ SetCommandExitStatus(error, "Error getting connected device");
+ return;
+ }
+
+ CHIP_ERROR err;
+ if (device == nil) {
+ err = CHIP_ERROR_INTERNAL;
+ } else {
+ err = SendCommand(device, mEndPointId);
+ }
+
+ if (err != CHIP_NO_ERROR) {
+ ChipLogError(chipTool, "Error: %s", chip::ErrorStr(err));
+ SetCommandExitStatus(err);
+ return;
+ }
+ }];
return CHIP_NO_ERROR;
}
diff --git a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h
index 17baa322ddc581..3357b12a8eada6 100644
--- a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h
@@ -50,10 +50,10 @@ class ReadAttribute : public ModelCommand {
~ReadAttribute() {}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId) override
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override
{
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
- CHIPReadParams * params = [[CHIPReadParams alloc] init];
+ MTRReadParams * params = [[MTRReadParams alloc] init];
params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil;
[device
readAttributeWithEndpointId:[NSNumber numberWithUnsignedShort:endpointId]
@@ -125,10 +125,10 @@ class SubscribeAttribute : public ModelCommand {
~SubscribeAttribute() {}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId) override
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override
{
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
- CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init];
+ MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init];
params.keepPreviousSubscriptions
= mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil;
[device subscribeAttributeWithEndpointId:[NSNumber numberWithUnsignedShort:endpointId]
@@ -195,11 +195,11 @@ class SubscribeEvent : public ModelCommand {
~SubscribeEvent() {}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId) override
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override
{
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
- CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init];
+ MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init];
params.keepPreviousSubscriptions
= mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil;
[device subscribeWithQueue:callbackQueue
diff --git a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h
index 69c52aa21797ac..37df173a8c417b 100644
--- a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h
@@ -22,6 +22,9 @@
#include "ModelCommandBridge.h"
+#import "MTRError_Utils.h"
+#import
+
class WriteAttribute : public ModelCommand {
public:
WriteAttribute()
@@ -44,7 +47,7 @@ class WriteAttribute : public ModelCommand {
~WriteAttribute() {}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId) override
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override
{
chip::TLV::TLVWriter writer;
chip::TLV::TLVReader reader;
@@ -66,7 +69,7 @@ class WriteAttribute : public ModelCommand {
return WriteAttribute::SendCommand(device, endpointId, mClusterId, mAttributeId, value);
}
- CHIP_ERROR SendCommand(CHIPDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId,
+ CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId,
chip::AttributeId attributeId, id _Nonnull value)
{
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h
index 2891a8f7e05e50..5892d21ec8f079 100644
--- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h
+++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h
@@ -17,7 +17,7 @@
*/
#pragma once
-#import
+#import
#include
#include
#include