Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into bugfix/uart_read
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-silabs authored Apr 4, 2023
2 parents 110cffd + d81d4e3 commit 2a63a59
Show file tree
Hide file tree
Showing 201 changed files with 2,313 additions and 2,065 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ exclude = third_party
src/controller/python/chip/yaml/__init__.py
src/controller/python/chip/yaml/format_converter.py
src/controller/python/chip/yaml/runner.py
src/controller/python/py_matter_yamltest_repl_adapter/matter_yamltest_repl_adapter/runner.py
src/lib/asn1/gen_asn1oid.py
src/pybindings/pycontroller/build-chip-wheel.py
src/pybindings/pycontroller/pychip/__init__.py
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Build example OTA Requestor
timeout-minutes: 10
run: |
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0
- name: Delete Defaults
run: defaults delete com.apple.dt.xctest.tool
continue-on-error: true
Expand All @@ -139,9 +139,12 @@ 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) &
# Make sure ota-requestor is using a different port, discriminator, and KVS from all-clusters-app.
# And a different one from the test harness too; the test harness uses port 5541.
../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5542 --discriminator 1111 --KVS /tmp/chip-ota-requestor-kvs > >(tee /tmp/darwin/framework-tests/ota-requestor-app.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err.log >&2) &
# Make each ota-requestor is using a different port, discriminator, and KVS from
# all-clusters-app and from other requestors.
#
# And a different port from the test harness too; the test harness uses port 5541.
../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5542 --discriminator 1111 --KVS /tmp/chip-ota-requestor-kvs1 > >(tee /tmp/darwin/framework-tests/ota-requestor-app-1.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-1.log >&2) &
../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5543 --discriminator 1112 --KVS /tmp/chip-ota-requestor-kvs2 > >(tee /tmp/darwin/framework-tests/ota-requestor-app-2.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-2.log >&2) &
xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-incomplete-umbrella -Wno-unguarded-availability-new' > >(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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ jobs:
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check"
- name: Run unit tests of factory data generation script
timeout-minutes: 15
run: scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py"
run: |
scripts/run_in_build_env.sh 'pip3 install -r scripts/setup/requirements.nrfconnect.txt'
scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py"
- name: Build example nRF Connect SDK Lock App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-android:0.6.47
image: connectedhomeip/chip-build-android:0.6.51
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-android:0.6.47
image: connectedhomeip/chip-build-android:0.6.51
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
2 changes: 1 addition & 1 deletion build/config/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ declare_args() {
android_ndk_root = ""

# Version of the Android SDK.
android_sdk_version = 21
android_sdk_version = 26
}
3 changes: 3 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ endif()

if (CONFIG_CHIP_ENABLE_EXTERNAL_PLATFORM)
chip_gn_arg_append("chip_device_platform" "\"external\"")
if (CONFIG_ENABLE_CHIP_SHELL)
chip_gn_arg_append("chip_shell_platform" "\"esp32\"")
endif()
chip_gn_arg_append("chip_platform_target" "\"//${CONFIG_CHIP_EXTERNAL_PLATFORM_DIR}\"")
endif()

Expand Down
8 changes: 8 additions & 0 deletions config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE
when flashing the firmware using the west tool, includes the factory data
as well.

config CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES
bool "Generate onboarding codes during the generation of a factory data set"
help
Enables generation of onboarding codes (manual pairing code and QR code)
during the generation of a factory data set. You can provide the
onboarding codes a Matter controller to commission a device to a Matter
network.

# Select source of the certificates
choice CHIP_FACTORY_DATA_CERT_SOURCE
prompt "Attestation certificate file source"
Expand Down
4 changes: 4 additions & 0 deletions config/nrfconnect/chip-module/generate_factory_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n")
string(APPEND script_args "--include_passcode\n")
string(APPEND script_args "--overwrite\n")

if(CONFIG_CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES)
string(APPEND script_args "--generate_onboarding\n")
endif()

# check if spake2 verifier should be generated using script
if(NOT CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER)
# Spake2 verifier should be provided using kConfig
Expand Down
1 change: 0 additions & 1 deletion docs/ERROR_CODES.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ This file was **AUTOMATICALLY** generated by
| 49 | 0x31 | `CHIP_ERROR_INVALID_DATA_LIST` |
| 50 | 0x32 | `CHIP_ERROR_TIMEOUT` |
| 51 | 0x33 | `CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR` |
| 53 | 0x35 | `CHIP_ERROR_END_OF_INPUT` |
| 56 | 0x38 | `CHIP_ERROR_INVALID_PASE_PARAMETER` |
| 59 | 0x3B | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY` |
| 60 | 0x3C | `CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY` |
Expand Down
55 changes: 55 additions & 0 deletions docs/guides/nrfconnect_factory_data_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ data secure by applying hardware write protection.
- [Option 1: Using the php-json-schema tool](#option-1-using-the-php-json-schema-tool)
- [Option 2: Using a website validator](#option-2-using-a-website-validator)
- [Option 3: Using the nRF Connect Python script](#option-3-using-the-nrf-connect-python-script)
- [Generating onboarding codes](#generating-onboarding-codes)
- [Enabling onboarding codes generation within the build system](#enabling-onboarding-codes-generation-within-the-build-system)
- [Preparing factory data partition on a device](#preparing-factory-data-partition-on-a-device)
- [Creating a factory data partition with the second script](#creating-a-factory-data-partition-with-the-second-script)
- [Building an example with factory data](#building-an-example-with-factory-data)
Expand Down Expand Up @@ -493,6 +495,59 @@ as an additional argument. To do this, complete the following steps:
> **Note:** To learn more about the JSON schema, visit
> [this unofficial JSON Schema tool usage website](https://json-schema.org/understanding-json-schema/).
### Generating onboarding codes
The
[generate_nrfconnect_chip_factory_data.py](../../scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py)
script lets you generating a manual code and a QR code from the given factory
data parameters. You can use these codes to perform commissioning to the Matter
network over Bluetooth LE since they include all the pairing data required by
the Matter controller. You can place these codes on the device packaging or on
the device itself during production.
To generate a manual pairing code and a QR code, complete the following steps:
1. Install all required Python dependencies for Matter:
```
$ python -m pip install -r ./scripts/setup/requirements.nrfconnect.txt
```
2. Complete steps 1, 2, and 3 from the
[Creating the factory data JSON file with the first script](#creating-the-factory-data-json-file-with-the-first-script)
section to prepare the final invocation of the Python script.
3. Add the `--generate_onboarding` argument to the Python script final
invocation.
4. Run the script.
5. Navigate to the output directory provided as the `-o` argument.
The output directory contains the following files you need:
- JSON file containing the latest factory data set.
- Test file containing the generated manual code and the text version of the
QR Code.
- PNG file containing the generated QR Code as an image.
#### Enabling onboarding codes generation within the build system
You can generate onboarding codes using the nRF Connect platform build system
described in
[Building an example with factory data](#building-an-example-with-factory-data),
and build an example with the following additional option:
`-DCONFIG_CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES=y`.
For example, the build command for the nRF52840 DK could look like this:
```
$ west build -b nrf52840dk_nrf52840 -- \
-DCONFIG_CHIP_FACTORY_DATA=y \
-DCONFIG_CHIP_FACTORY_DATA_BUILD=y \
-DCONFIG_CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES=y
```
### Preparing factory data partition on a device
The factory data partition is an area in the device's persistent storage where a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
bitmap GroupsFeature : BITMAP32 {
kGroupNames = 0x1;
}

Expand Down Expand Up @@ -116,14 +116,14 @@ server cluster Groups = 4 {
}

server cluster Scenes = 5 {
bitmap SceneFeatures : BITMAP32 {
kSceneNames = 0x1;
}

bitmap ScenesCopyMode : BITMAP8 {
kCopyAllScenes = 0x1;
}

bitmap ScenesFeature : BITMAP32 {
kSceneNames = 0x1;
}

struct ExtensionFieldSet {
cluster_id clusterID = 0;
AttributeValuePair attributeValueList[] = 1;
Expand Down Expand Up @@ -2734,14 +2734,6 @@ server cluster WindowCovering = 258 {
kTiltEncoderControlled = 0x40;
}

bitmap Feature : BITMAP32 {
kLift = 0x1;
kTilt = 0x2;
kPositionAwareLift = 0x4;
kAbsolutePosition = 0x8;
kPositionAwareTilt = 0x10;
}

bitmap Mode : BITMAP8 {
kMotorDirectionReversed = 0x1;
kCalibrationMode = 0x2;
Expand Down Expand Up @@ -2770,6 +2762,14 @@ server cluster WindowCovering = 258 {
kProtection = 0x800;
}

bitmap WindowCoveringFeature : BITMAP32 {
kLift = 0x1;
kTilt = 0x2;
kPositionAwareLift = 0x4;
kAbsolutePosition = 0x8;
kPositionAwareTilt = 0x10;
}

readonly attribute Type type = 0;
readonly attribute int16u physicalClosedLimitLift = 1;
readonly attribute int16u physicalClosedLimitTilt = 2;
Expand Down Expand Up @@ -2861,7 +2861,7 @@ server cluster PumpConfigurationAndControl = 512 {
kLocal = 3;
}

bitmap PumpFeature : BITMAP32 {
bitmap PumpConfigurationAndControlFeature : BITMAP32 {
kConstantPressure = 0x1;
kCompensatedPressure = 0x2;
kConstantFlow = 0x4;
Expand Down Expand Up @@ -3487,7 +3487,7 @@ server cluster TemperatureMeasurement = 1026 {
}

server cluster PressureMeasurement = 1027 {
bitmap PressureFeature : BITMAP32 {
bitmap PressureMeasurementFeature : BITMAP32 {
kExtended = 0x1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
bitmap GroupsFeature : BITMAP32 {
kGroupNames = 0x1;
}

Expand Down Expand Up @@ -115,14 +115,14 @@ server cluster Groups = 4 {
}

server cluster Scenes = 5 {
bitmap SceneFeatures : BITMAP32 {
kSceneNames = 0x1;
}

bitmap ScenesCopyMode : BITMAP8 {
kCopyAllScenes = 0x1;
}

bitmap ScenesFeature : BITMAP32 {
kSceneNames = 0x1;
}

struct ExtensionFieldSet {
cluster_id clusterID = 0;
AttributeValuePair attributeValueList[] = 1;
Expand Down Expand Up @@ -2376,14 +2376,6 @@ server cluster WindowCovering = 258 {
kTiltEncoderControlled = 0x40;
}

bitmap Feature : BITMAP32 {
kLift = 0x1;
kTilt = 0x2;
kPositionAwareLift = 0x4;
kAbsolutePosition = 0x8;
kPositionAwareTilt = 0x10;
}

bitmap Mode : BITMAP8 {
kMotorDirectionReversed = 0x1;
kCalibrationMode = 0x2;
Expand Down Expand Up @@ -2412,6 +2404,14 @@ server cluster WindowCovering = 258 {
kProtection = 0x800;
}

bitmap WindowCoveringFeature : BITMAP32 {
kLift = 0x1;
kTilt = 0x2;
kPositionAwareLift = 0x4;
kAbsolutePosition = 0x8;
kPositionAwareTilt = 0x10;
}

readonly attribute Type type = 0;
readonly attribute ConfigStatus configStatus = 7;
readonly attribute OperationalStatus operationalStatus = 10;
Expand Down Expand Up @@ -2446,7 +2446,7 @@ server cluster PumpConfigurationAndControl = 512 {
kLocal = 3;
}

bitmap PumpFeature : BITMAP32 {
bitmap PumpConfigurationAndControlFeature : BITMAP32 {
kConstantPressure = 0x1;
kCompensatedPressure = 0x2;
kConstantFlow = 0x4;
Expand Down Expand Up @@ -2813,7 +2813,7 @@ server cluster TemperatureMeasurement = 1026 {
}

server cluster PressureMeasurement = 1027 {
bitmap PressureFeature : BITMAP32 {
bitmap PressureMeasurementFeature : BITMAP32 {
kExtended = 0x1;
}

Expand Down
Loading

0 comments on commit 2a63a59

Please sign in to comment.