Skip to content

Commit

Permalink
Merge branch 'master' into nullable_is_std_optional
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Apr 25, 2024
2 parents 4796bf6 + 8b21ecf commit e846720
Show file tree
Hide file tree
Showing 328 changed files with 13,438 additions and 13,781 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
runs-on: macos-latest
runs-on: macos-13
if: github.actor != 'restyled-io[bot]'

steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/check-data-model-directory-updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024 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: Check for changes to data_model directory without a sha update

on:
pull_request:
paths:
- "data_model/**"

jobs:
check-submodule-update-label:
name: Check for changes to data_model directory without a sha update
runs-on: ubuntu-latest
if: "git diff --name-only HEAD^..HEAD data_model/ | grep -q spec_sha"
steps:
- name: Error Message
run: echo This pull request attempts to update data_model directory, but is missing updates to spec_sha file with the latest version of the sha. Files in the data_model directory are generated automatically and should not be updated manually.
- name: Fail Job
run: exit 1
2 changes: 1 addition & 1 deletion .github/workflows/fuzzing-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

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

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ jobs:
LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt

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

steps:
- name: Checkout
Expand Down Expand Up @@ -588,7 +588,7 @@ jobs:
TSAN_OPTIONS: "halt_on_error=1"

if: github.actor != 'restyled-io[bot]' && false
runs-on: macos-latest
runs-on: macos-13

steps:
- name: Checkout
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/third-party-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2024 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: Check for Unintentional Submodule Updates

on:
pull_request:
branches-ignore:
- 'dependabot/**'
paths:
- "third_party/**"
- ".gitmodules"

jobs:
check-submodule-update-label:
name: Check For Submodule Update Label
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose')"
steps:
- name: Error Message
run: echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes.
- name: Fail Job
run: exit 1
13 changes: 7 additions & 6 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,13 @@ menu "CHIP Device Layer"
should not start advertising automatically after power-up.

config USE_BLE_ONLY_FOR_COMMISSIONING
bool "Use BLE only for commissioning"
default y
help
Disable this flag if BLE is used for any other purpose than commissioning.
When enabled, it deinitialized the BLE on successful commissioning, and on
bootup do not initialize the BLE if device is already provisioned with Wi-Fi/Thread credentials.
depends on BT_ENABLED
bool "Use BLE only for commissioning"
default y
help
Disable this flag if BLE is used for any other purpose than commissioning.
When enabled, it deinitialized the BLE on successful commissioning, and on
bootup do not initialize the BLE if device is already provisioned with Wi-Fi/Thread credentials.

endmenu

Expand Down
40 changes: 26 additions & 14 deletions docs/guides/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,20 @@ Complete the following steps:
1. Reboot your Raspberry Pi after installing `pi-bluetooth`.
#### Enable experimental Bluetooth support in BlueZ
#### Enable experimental Bluetooth support and disable battery plugin in BlueZ
The Matter application on Linux uses BlueZ to communicate with the Bluetooth
controller. The BlueZ version that comes with Ubuntu 22.04 does not support all
the features required by the Matter application by default. To enable these
features, you need to enable experimental Bluetooth support in BlueZ.
Also disable the battery plugin from BlueZ, because iOS devices advertises a
battery service via BLE, which requires pairing if accessed. BlueZ includes a
battery plugin by default which tries to connect to the battery service. The
authentication fails, because in this case no BLE pairing has been done. If the
BlueZ battery plugin is not disabled, the BLE connection will be terminated
during the Matter commissioning process.
1. Edit the `bluetooth.service` unit by running the following command:
```sh
Expand All @@ -153,7 +160,7 @@ features, you need to enable experimental Bluetooth support in BlueZ.
```ini
[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd -E
ExecStart=/usr/lib/bluetooth/bluetoothd -E -P battery
```
1. Restart the Bluetooth service by running the following command:
Expand Down Expand Up @@ -199,22 +206,27 @@ permanently, you need to make the following changes:
## Installing ZAP tool
`bootstrap.sh` will download a compatible ZAP tool version and set it up in
`$PATH`. If you want to install or use a different version of the tool, you may
download one from the ZAP project's
[Releases](https://github.com/project-chip/zap/releases) page.
For platforms defined in [`scripts/setup/zap.json`](/scripts/setup/zap.json),
`bootstrap.sh` will download a compatible ZAP tool version from CIPD and set it
up in `$PATH`.
ZAP releases are copied to CIPD by an automated bot. You can check if a release
was copied by looking at tags created for
[ZAP CIPD Packages](https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/zap)
in various platforms.
### Linux ARM
### Custom ZAP
Zap does not provide binary releases for arm. Rosetta solves this for Darwin,
however for linux arm you will have to use a local ZAP, generally through
setting `$ZAP_DEVELOPMENT_PATH` (see the section `Which zap to use` below).
If you want to install or use a different version of the tool, you may download
one from the [ZAP releases](https://github.com/project-chip/zap/releases) or
build it from source.
The file `scripts/setup/zap.json` contains the version that CIPD would download,
so you can download a compatible version from the zap project
[Releases](https://github.com/project-chip/zap/releases). To checkout as source
code the corresponding tag should exist in the zap
[repository tags](https://github.com/project-chip/zap/tags) list.
so you can refer to it to find a compatible version. The version is also
maintained at [`scripts/setup/zap.version`](/scripts/setup/zap.version).
To check out as source code, the corresponding tag should exist in the
[ZAP repository tags](https://github.com/project-chip/zap/tags) list.
Example commands:
Expand Down
3 changes: 1 addition & 2 deletions docs/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
- [nRF Connect - Factory Data Configuration](./nrfconnect_factory_data_configuration.md)
- [nRF Connect - Platform Overview](./nrfconnect_platform_overview.md)
- [nRF Connect - Software Update](./nrfconnect_examples_software_update.md)
- [NXP - Android Commissioning](./nxp_k32w_android_commissioning.md)
- [NXP - Linux Examples](./nxp_imx8m_linux_examples.md)
- [NXP - Getting Started Guide](./nxp/README.md)
- [Silicon Labs - Documentation](https://siliconlabs.github.io/matter/latest/index.html)
- [Silicon Labs - Getting Started](./silabs_getting_started.md)
- [Silicon Labs - Software Update](./silabs_efr32_software_update.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/darwin.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Example:
- [mbedOS](/examples/all-clusters-app/mbed/README.md)
- [nRF Connect All Clusters](./nrfconnect_examples_configuration.md)
- [nRF Connect Pump](/examples/pump-app/nrfconnect/README.md)
- [NXP Examples](./nxp_imx8m_linux_examples.md)
- [NXP Examples](./nxp/nxp_imx8m_linux_examples.md)
- [NXP](/examples/all-clusters-app/nxp/mw320/README.md)
- [Infineon CYW30739 Lighting](/examples/lighting-app/infineon/cyw30739/README.md)
- [Infineon PSoC6](/examples/all-clusters-app/infineon/psoc6/README.md)
Expand Down
1 change: 1 addition & 0 deletions docs/guides/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ example on ESP32 series of SoCs
- [Matter OTA](ota.md)
- [Generating and Using ESP Secure Cert Partition](secure_cert_partition.md)
- [BLE Settings](ble_settings.md)
- [Providers](providers.md)
10 changes: 3 additions & 7 deletions docs/guides/esp32/factory_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,9 @@ Following data can be added to the manufacturing partition using
- Serial Number
- Unique identifier

- Device information
- Fixed Labels
- Supported locales
- Supported calendar types
- Supported modes
- Note: As per spec at max size of label should be 64 and `\0` will be
added at the end.
- Supported modes
- Note: As per spec at max size of label should be 64 and `\0` will be
added at the end.

### Configuration Options

Expand Down
76 changes: 76 additions & 0 deletions docs/guides/esp32/providers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
## Providers Implemented for ESP32 Platform

The ESP32 platform has implemented several providers that can be used with data
stored in the factory or by setting fixed data.

Below are the providers that have been implemented:

- [Commissionable Data Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L47)
This provider reads the discriminator and setup pincode related parameters
from the factory partition.
- [Device Attestation Credentials Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L56)
This provider manages the attestation data.
- [Device Instance Info Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L86)
This provider reads basic device information from the factory partition.
- [Device Info Provider](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32DeviceInfoProvider.h#L31)
This provider provides fixed labels, supported calendar types, and supported
locales from the factory partition.
- [Supported Modes](https://github.com/project-chip/connectedhomeip/blob/master/examples/platform/esp32/mode-support/static-supported-modes-manager.h#L28)
This provider offers the supported modes for the mode-select cluster.

More information can be found in the [factory data guide](factory_data.md).

### Device Info Provider

Currently, there are two implementations for this provider:

1. [Reads data stored in the factory partition](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/ESP32FactoryDataProvider.h#L56)
_(This will be deprecated in the future)_
2. [Provides APIs to set fixed data that gets read later](https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/StaticESP32DeviceInfoProvider.h)

- New products should use the `StaticESP32DeviceInfoProvider`. Utilize the
`Set...()` APIs to set the fixed data.
- Existing products using the first implementation can continue to use it if
they do not wish to change the data.
- For products using the first implementation and wanting to change the fixed
data via OTA, they should switch to the second implementation in the OTA
image and use the `Set...()` APIs to set the fixed data.

#### Example:

```cpp
#include <platform/ESP32/StaticESP32FactoryDataProvider.h>

DeviceLayer::StaticESP32DeviceInfoProvider deviceInfoProvider;

// Define array for Supported Calendar Types
using namespace chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum;
CalendarTypeEnum supportedCalendarTypes[] = {
CalendarTypeEnum::kGregorian, CalendarTypeEnum::kCoptic,
CalendarTypeEnum::kEthiopian, CalendarTypeEnum::kChinese,
};

// Define array for Supported Locales
const char* supportedLocales[] = {
"en-US",
"en-EU",
};

// Define array for Fixed labels { EndpointId, Label, Value }
struct StaticESP32DeviceInfoProvider::FixedLabelEntry fixedLabels[] = {
{ 0, "Room", "Bedroom 2" },
{ 0, "Orientation", "North" },
{ 0, "Direction", "Up" },
};

Span<CalendarTypeEnum> sSupportedCalendarTypes(supportedCalendarTypes);
Span<const char*> sSupportedLocales(supportedLocales);
Span<StaticESP32DeviceInfoProvider::FixedLabelEntry> sFixedLabels(fixedLabels);

{
deviceInfoProvider.SetSupportedLocales(sSupportedLocales);
deviceInfoProvider.SetSupportedCalendarTypes(sSupportedCalendarTypes);
deviceInfoProvider.SetFixedLabels(sFixedLabels);
DeviceLayer::SetDeviceInfoProvider(&deviceInfoProvider);
}
```
5 changes: 2 additions & 3 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and features.
*
esp32/README
nxp/README
ti/ti_platform_overview
```

Expand All @@ -34,9 +35,7 @@ ti/ti_platform_overview
- [nRF Connect - Factory Data Configuration](./nrfconnect_factory_data_configuration.md)
- [nRF Connect - Platform Overview](./nrfconnect_platform_overview.md)
- [nRF Connect - Software Update](./nrfconnect_examples_software_update.md)
- [NXP - Android Commissioning](./nxp_k32w_android_commissioning.md)
- [NXP - Linux Examples](./nxp_imx8m_linux_examples.md)
- [NXP - Manufacturing Data](./nxp_manufacturing_flow.md)
- [NXP - Getting Started Guide](./nxp/README.md)
- [Silicon Labs - Documentation](https://siliconlabs.github.io/matter/latest/index.html)
- [Silicon Labs - Getting Started](./silabs_getting_started.md)
- [Silicon Labs - Software Update](./silabs_efr32_software_update.md)
Expand Down
14 changes: 14 additions & 0 deletions docs/guides/nxp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```{toctree}
:glob:
:maxdepth: 1
*
```

# NXP Getting Started Guide

- [NXP - Android Commissioning](nxp_k32w_android_commissioning.md)
- [NXP - Linux Examples](nxp_imx8m_linux_examples.md)
- [NXP - Manufacturing Data](nxp_manufacturing_flow.md)
- [NXP - RW61x OTA Software Update Guide](nxp_rw61x_ota_software_update.md)
- [NXP - Zephyr OTA Software Update Guide](nxp_zephyr_ota_software_update.md)
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This document describes how to build below Linux examples with the NXP embedded
Linux Yocto SDK and then run the output executable files on the **NXP i.MX 8M**
**Mini EVK** development board.

- [CHIP Linux All-clusters Example](../../examples/all-clusters-app/linux/README.md)
- [CHIP Linux Lighting Example](../../examples/lighting-app/linux/README.md)
- [CHIP Linux All-clusters Example](../../../examples/all-clusters-app/linux/README.md)
- [CHIP Linux Lighting Example](../../../examples/lighting-app/linux/README.md)
- [CHIP Linux Thermostat Example](https://github.com/project-chip/connectedhomeip/tree/master/examples/thermostat/linux)
- [CHIP Linux CHIP-tool Example](../../examples/chip-tool/README.md)
- [CHIP Linux OTA-provider Example](../../examples/ota-provider-app/linux/README.md)
- [CHIP Linux CHIP-tool Example](../../../examples/chip-tool/README.md)
- [CHIP Linux OTA-provider Example](../../../examples/ota-provider-app/linux/README.md)

This document has been tested on:

Expand Down Expand Up @@ -234,8 +234,8 @@ Thermostat-app is used as an example below.

In order to test the CHIP protocol functions, another device on the same
network is needed to run the
[ChipDeviceController](../../src/controller/python) tool to communicate with
the **i.MX 8M Mini EVK**.
[ChipDeviceController](../../../src/controller/python) tool to communicate
with the **i.MX 8M Mini EVK**.

The ChipDeviceController can be a laptop / workstation. Bluetooth
functionality is mandatory on this device.
Expand All @@ -252,7 +252,7 @@ Thermostat-app is used as an example below.
- Boot up Ubuntu on the Raspberry Pi
- Clone this connectedhomeip project
- Follow Python ChipDeviceController
[README.md](../../src/controller/python/README.md) document. Refer to
[README.md](../../../src/controller/python/README.md) document. Refer to
the "Building and installing" part to build the tool.

- Running
Expand Down Expand Up @@ -283,7 +283,7 @@ Thermostat-app is used as an example below.
/home/root/thermostat-app --ble-device 0 --wifi # The bluetooth device used is hci0 and support wifi network
```

- Run [ChipDeviceController](../../src/controller/python) on the
- Run [ChipDeviceController](../../../src/controller/python) on the
controller device to communicate with **i.MX 8M Mini EVK** running the
example.

Expand Down
Loading

0 comments on commit e846720

Please sign in to comment.