Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into layerimpl-select-poll
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhqwang authored Jan 21, 2022
2 parents 3cdd00a + c24c34b commit 8d6632c
Show file tree
Hide file tree
Showing 254 changed files with 12,193 additions and 4,040 deletions.
6 changes: 6 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ DataFrame
dataset
datasets
dbf
DBG
dBm
DBUILD
dbus
Expand Down Expand Up @@ -316,6 +317,7 @@ DMM
DNS
Dnsmasq
dnsmasqd
DNSSD
DNSStubListener
Dockerfile
Dockerfiles
Expand Down Expand Up @@ -650,6 +652,7 @@ MoveToSaturation
MoveWithOnOff
MPSL
MRP
MTD
MTU
Multiband
Multicast
Expand Down Expand Up @@ -940,6 +943,7 @@ submodules
subprocess
SubscribeResponse
SubscriptionId
subtype
sudo
svg
SVR
Expand Down Expand Up @@ -978,6 +982,7 @@ testws
texinfo
textboxes
TFT
threadOperationalDataset
ThreadStackManager
ThreadStackManagerImpl
Thunderboard
Expand All @@ -988,6 +993,7 @@ TLV
tmp
tngvndl
TODO
tokenized
toolchain
toolchains
topologies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Build Android CHIPTool and CHIPTest
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target-glob 'android-{arm,arm64,x64,x86}-chip-*' build"
"./scripts/build/build_examples.py --no-log-timestamps --target-glob 'android-{arm,arm64}-chip-*' build"
# - name: Build Android Studio build (arm64 only)
# run: |
# ./scripts/run_in_build_env.sh \
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ jobs:
- name: Run Build Without Progress Logging
timeout-minutes: 20
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Setup Build Without Error Logging
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false"
- name: Run Build Without Error Logging
timeout-minutes: 20
run: scripts/run_in_build_env.sh "ninja -C ./out"
build_linux:
name: Build on Linux (fake, gcc_release, clang, mbedtls, simulated)
timeout-minutes: 90
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
timeout-minutes: 10
run: |
scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug_rpc BRD4161A \
-args='import("//with_pw_rpc.gni")'
'import("//with_pw_rpc.gni")'
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \
out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/
- name: Build example EFR32 Window Covering for BRD4161A
Expand Down
131 changes: 131 additions & 0 deletions .github/workflows/fuzzing-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Copyright (c) 2021 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.

name: Fuzzing Builds

on:
# For now, only manual triggers.
workflow_dispatch:

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

jobs:
build_linux_fuzzing:
name: Build on Linux
timeout-minutes: 90

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.5.48
volumes:
- "/tmp/log_output:/tmp/test_logs"

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- run: apt-get update
- run: apt-get install --fix-missing llvm-10 clang-10
- name:
Try to ensure the objdir-clone dir exists
run: |
mkdir objdir-clone || true
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
if: ${{ always() }} && ${{ !env.ACT }}
with:
name: bootstrap-logs
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build all-clusters-app
timeout-minutes: 20
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-all-clusters-no-ble-libfuzzer-test-group \
build \
--copy-artifacts-to objdir-clone \
"
- name: Uploading binaries
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name:
objdir-linux
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5

build_darwin_fuzzing:
name: Build on Darwin
timeout-minutes: 90
runs-on: macos-latest
if: github.actor != 'restyled-io[bot]'

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Environment
run: brew install openssl pkg-config llvm
- name: Try to ensure the objdir-clone dir exists
run: |
mkdir objdir-clone || true
- name: Fix pkgconfig link
working-directory: /usr/local/lib/pkgconfig
run: |
pwd
ls -la /usr/local/Cellar/
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
if: ${{ always() }} && ${{ !env.ACT }}
with:
name: bootstrap-logs
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build all-clusters-app
timeout-minutes: 20
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target darwin-x64-all-clusters-no-ble-asan-libfuzzer \
build \
--copy-artifacts-to objdir-clone \
"
- name: Uploading binaries
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name:
crash-darwin
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,6 @@
[submodule "p6/lwip"]
path = third_party/p6/p6_sdk/libs/lwip
url = https://github.com/lwip-tcpip/lwip.git
[submodule "third_party/jsoncpp/repo"]
path = third_party/jsoncpp/repo
url = https://github.com/open-source-parsers/jsoncpp.git
3 changes: 0 additions & 3 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ declare_args() {
# enable undefined behavior sanitizer
is_ubsan = false

# enable libfuzzer
is_libfuzzer = false

# Exit on sanitize error. Generally standard libraries may get errors
# so not stopping on the first error is often useful
is_sanitize_fatal = true
Expand Down
3 changes: 3 additions & 0 deletions build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ declare_args() {

# C++ standard level (value for -std flag).
cpp_standard = "gnu++14"

# enable libfuzzer
is_libfuzzer = false
}
6 changes: 6 additions & 0 deletions config/efr32/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ arm_toolchain("efr32_window_app") {
import("${chip_root}/examples/window-app/efr32/args.gni")
}
}
arm_toolchain("rs911x_lock_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/lock-app/rs911x/args.gni")
}
}
1 change: 1 addition & 0 deletions config/esp32/components/chip/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ ifeq ($(is_debug),false)
endif
if [[ "$(CONFIG_ENABLE_PW_RPC)" = "y" ]]; then \
echo "chip_build_pw_rpc_lib = true" >> $(OUTPUT_DIR)/args.gn ;\
echo "chip_build_pw_trace_lib = true" >> $(OUTPUT_DIR)/args.gn ;\
echo "remove_default_configs = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:cpp17\"]" >> $(OUTPUT_DIR)/args.gn ;\
echo "pw_log_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"" >> $(OUTPUT_DIR)/args.gn ;\
echo "pw_assert_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"" >> $(OUTPUT_DIR)/args.gn ;\
Expand Down
14 changes: 14 additions & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@ config CHIP_ROTATING_DEVICE_ID
Enables rotating device identifier that provides a non-trackable identifier
which is unique per device and rotates at pre-defined moments.

config CHIP_COMMISSIONABLE_DEVICE_TYPE
bool "Enable the device type subtype in commissionable node discovery record"
depends on CHIP_ENABLE_DNSSD_SRP
help
Enables including device type subtype in the commissionable node discovery record,
which allows filtering of the results to find the nodes that match the device type.

config CHIP_DEVICE_TYPE
int "Device type"
default 65535
range 0 65535
help
Type of device that uses the CHIP Device Type Identifier. The default value means invalid device type.

config CHIP_OPERATIONAL_TIME_SAVE_INTERVAL
int "Interval of saving node operation time to flash in hours unit"
default 10
Expand Down
82 changes: 82 additions & 0 deletions docs/guides/nrfconnect_examples_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,85 @@ Read the
guide in the nRF Connect SDK's Zephyr documentation if you are interested in
getting more advanced and detailed information about the configuration
structure.

<hr>

## Configuring Matter in nRF Connect platform

### Mandatory configuration

To use the Matter protocol, you need to set the `CONFIG_CHIP` Kconfig option.
Setting this option enables the Matter protocol stack and other associated
Kconfig options, including `CONFIG_CHIP_ENABLE_DNSSD_SRP` that is required for
the Matter device to be discoverable using DNS-SD.

After that, make sure to set the `CONFIG_CHIP_PROJECT_CONFIG` Kconfig option and
define the path to the configuration file that specifies Vendor ID, Product ID,
and other project-specific Matter settings.

<hr>

### Optional configuration

After enabling the Matter protocol and defining the path to the Matter
configuration file, you can enable additional options in Kconfig.

**Sleepy End Device support**

You can enable the support for Thread Sleepy End Device in Matter by setting the
following Kconfig options:

- `CONFIG_OPENTHREAD_MTD`
- `CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT`

**Commissioning with NFC support**

You can configure the Matter protocol to use an NFC tag for commissioning,
instead of using a QR code, which is the default configuration.

To enable NFC for commissioning and share the onboarding payload in an NFC tag,
set the `CONFIG_CHIP_NFC_COMMISSIONING` option.

**Logging**

You can enable logging for both the stack and Zephyr’s
[Logging](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/logging/index.html#logging-api)
API by setting the `CONFIG_LOG` option.

Zephyr allows you to configure log levels of different software modules
independently. To change the log level configuration for the Matter module, set
one of the available options:

- `CONFIG_MATTER_LOG_LEVEL_ERR`
- `CONFIG_MATTER_LOG_LEVEL_INFO`
- `CONFIG_MATTER_LOG_LEVEL_DBG`

**Shell**

You can enable the Matter shell library using the `CONFIG_CHIP_LIB_SHELL`
Kconfig option. This option lets you use the Matter specific shell commands. See
[Using CLI in nRF Connect examples](nrfconnect_examples_cli.md) for the list of
available Matter shell commands.

**Matter device identification**

Matter has many mandatory and optional ways to identify a specific device. These
can be used for various purposes, such as dividing devices into groups (by
function, by vendor or by location), device commissioning or vendor-specific
cases before the device was commissioned (for example, identifying factory
software version or related features).

Only some part of these features can be configured using Kconfig options and
only those were listed below:

- `CONFIG_CHIP_DEVICE_TYPE` - type of device that uses the Matter Device Type
Identifier, for example Door Lock (0x000A) or Dimmable Light Bulb (0x0101).
- `CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE` - enables including optional device
type subtype in the commissionable node discovery record, which allows
filtering of the discovery results to find the nodes that match the device
type.
- `CONFIG_CHIP_ROTATING_DEVICE_ID` - enables rotating device identifier, an
optional feature that provides an additional unique identifier for each
device. This identifier is similar to the serial number, but it additionally
changes at predefined times to protect against long-term tracking of the
device.
Loading

0 comments on commit 8d6632c

Please sign in to comment.