Skip to content

Commit

Permalink
Merge branch 'master' into enable_thermostat_client_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Mar 21, 2023
2 parents 3b463a0 + 5a0811e commit 6884b55
Show file tree
Hide file tree
Showing 112 changed files with 25,153 additions and 803 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ exclude = third_party
scripts/tools/memory/memdf/__init__.py
scripts/tools/memory/report_summary.py
scripts/tools/silabs/FactoryDataProvider.py
scripts/tools/telink/mfg_tool.py
scripts/tools/zap/generate.py
scripts/tools/zap/prune_outputs.py
scripts/tools/zap/version_update.py
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-efr32:0.6.47
image: connectedhomeip/chip-build-efr32:0.6.50
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -52,7 +52,7 @@ jobs:
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform efr32
run: scripts/checkout_submodules.py --shallow --platform silabs_docker

# - name: Out of Tree verification
# run: third_party/silabs/out_of_tree_verification.sh
Expand Down Expand Up @@ -114,15 +114,15 @@ jobs:
- name: Build example EFR32+WF200 WiFi Lock app for BRD4161A
timeout-minutes: 15
run: |
scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false chip_logging=false --wifi wf200
scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false chip_logging=false --wifi wf200 --docker
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+wf200 lock-app \
out/lock_app_wifi_wf200/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/
- name: Clean out build output
run: rm -rf ./out
- name: Build example EFR32+RS9116 WiFi Lighting app for BRD4161A
timeout-minutes: 15
run: |
scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32/ out/lighting_app_wifi_rs9116 BRD4161A --wifi rs9116
scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32/ out/lighting_app_wifi_rs9116 BRD4161A --wifi rs9116 --docker
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rs9116 lighting-app \
out/lighting_app_wifi_rs9116/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/
- name: Clean out build output
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,11 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test"
- name: Build Android arm64-tv-casting-app
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target android-arm64-tv-casting-app build"
- name: Build Android arm64-tv-server
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target android-arm64-tv-server build"
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx
platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx,silabs_docker
[submodule "simw-top-mini"]
path = third_party/simw-top-mini/repo
url = https://github.com/NXP/plug-and-trust.git
Expand All @@ -76,7 +76,7 @@
path = third_party/openthread/ot-efr32
url = https://github.com/SiliconLabs/ot-efr32.git
branch = matter_sve
platforms = efr32
platforms = efr32,silabs_docker
[submodule "third_party/openthread/ot-ifx"]
path = third_party/openthread/ot-ifx
url = https://github.com/Infineon/ot-ifx-release.git
Expand Down Expand Up @@ -238,7 +238,7 @@
path = third_party/silabs/matter_support
url = https://github.com/SiliconLabs/sdk_support.git
branch = main
platforms = efr32
platforms = efr32,silabs_docker
[submodule "third_party/silabs/gecko_sdk"]
path = third_party/silabs/gecko_sdk
url = https://github.com/SiliconLabs/gecko_sdk.git
Expand All @@ -248,7 +248,7 @@
path = third_party/silabs/wiseconnect-wifi-bt-sdk
url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git
branch = master
platforms = efr32
platforms = efr32,silabs_docker
[submodule "editline"]
path = third_party/editline/repo
url = https://github.com/troglobit/editline.git
Expand Down
7 changes: 7 additions & 0 deletions docs/guides/android_building.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,16 @@ JDK version on MacOS for Apple Silicon is 'openjdk 17.0.1' or above.

Using JDK bundled with Android Studio will help with that.

Android Studio Dolphin and below:

```shell
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home/
```
Android Studio Electric Eel 2022.1.1 and above:

```shell
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home/
```

<hr>

Expand Down
73 changes: 40 additions & 33 deletions docs/guides/simulated_device_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@ is defined by a ZAP config file and tests can be added with a

- [Building Prerequisites](./BUILDING.md#prerequisites)
- [Prepare For Building](./BUILDING.md#prepare-for-building)
- [Code Generate](../code_generation.md)
- [ZAP Installed](../code_generation.md#installing-zap-and-environment-variables)

## Generating and building the default Simulated App with Script
## Building the default Simulated App with Script

In order to utilize the app against a commissioner or controller, the app will
need to be specifically built.

1. To generate the ZAP files, and build the `chip-app1` binary completing the
following steps:
1. To build the `chip-app1` binary completing the following steps:

```
./scripts/examples/gn_build_test_example.sh app1
./scripts/examples/gn_build_example.sh examples/placeholder/linux out/debug/simulated/ chip_tests_zap_config=\"app1\"
```
## Build the App only
## Build the App with gn and ninja
In order to utilize the app against a commissioner or controller, the app will
need to be specifically built.
Expand All @@ -46,13 +47,7 @@ need to be specifically built.
```
source scripts/activate.sh
CHIP_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
GN_ARGS="chip_tests_zap_config=\"app1\""
GN_ARGS+="chip_project_config_include_dirs=[\"$CHIP_ROOT/examples/placeholder/linux/apps/app1/include\", \"$CHIP_ROOT/config/standalone\"]"
GN_ARGS+="chip_config_network_layer_ble=false"
gn gen --check --fail-on-unused-args --root=examples/placeholder/linux out/simulated --args="$GN_ARGS"
gn gen --check --root=examples/placeholder/linux out/simulated --args="chip_tests_zap_config=\"app1\""
ninja -C out/simulated
```
Expand All @@ -61,24 +56,18 @@ need to be specifically built.
Now that the building is completed there is a `chip-app1` binary created. This
binary can be executed on a linux os.
1. To generate the ZAP files, and build the `chip-app1` binary completing the
following steps:
```
./out/simulated/chip-app1
```
```
./out/simulated/chip-app1
```
## Running the app with test parameter
Now that the building is completed there is a `chip-app1` binary created. This
binary can be executed on a linux os with test commands.
1. To generate the ZAP files, and build the `chip-app1` binary completing the
following steps:
```
./out/simulated/chip-app1 --command [TEST NAME]
```
```
./out/simulated/chip-app1 --command [TEST NAME]
```
## Interacting with the simulated app
Expand All @@ -88,11 +77,13 @@ interact with it using chip-tool
1. Follow the instruction to build chip-tool in the
[chip-tool readme](../../examples/chip-tool/README.md).
2. Run this command to commission.
2. Run this command to commission with whatever is listed on the "SetupQRCode:"
line in the log output:
```
./out/debug/standalone/chip-tool pairing code 0x654321 MT:-24J0AFN00KA0648G00
./out/debug/standalone/chip-tool pairing code 0x654321 MT:-24J0AFN00KA0648G00
```
or whatever is listed on the "SetupQRCode:" line in the log output.
3. Most tests will start at this point and now an send cluster commands with
chip-tool as follow.
Expand All @@ -113,14 +104,18 @@ new code is generated.
1. YAML test file are located in
[YAML folder](../../src/app/tests/suites/certification/)
2. Test names must follow a strict format dues to CI of test recognition. The
format is as follows:
- Test_TC\_[`CATEGORY ABBREVIATION`]\_[`SECTION NUMBER`]\_[`SUBSECTION
NUMBER`]\_Simulated.yaml
- <strong>`IMPORTANT`: The test name must end in Simulated with the
capital.</strong>
3. Available properties can be found in
[YAML Test Name](../../src/app/tests/suites/README.md)
4. An Additional property is as follows:
| Name | Description |
Expand All @@ -129,14 +124,26 @@ new code is generated.
5. [Test_TC_DM_1_3_Simulated](../../src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml)
is an example of a written test that runs on the simulated device.
6. Next, it will need to be added to
[examples/placeholder/linux/apps/app1/tests.js](../../examples/placeholder/linux/apps/app1/tests.js).
in the following array
[examples/placeholder/linux/apps/app1/tests.js](../../examples/placeholder/linux/apps/app1/tests.js)
in the following array:
```javascript
const tests = ["Test_TC_DM_1_3_Simulated"];
```
7. Then, the code will be generated using ZAP. Follow
[Gen Script](#generating-and-building-the-default-simulated-app-with-script)
to do so.
8. When submitting code for review, create 2 commits. One for YAML changes and
7. Then, the code will be generated using ZAP.
```
./scripts/tools/zap/generate.py examples/placeholder/linux/apps/app1/config.zap -t examples/placeholder/templates/templates.json -o zzz_generated/placeholder/app1/zap-generated
```
The following command can be used to generate and compile:
```
./scripts/examples/gn_build_test_example.sh app1
```
8) When submitting code for review, create 2 commits. One for YAML changes and
second for generated code.
Original file line number Diff line number Diff line change
Expand Up @@ -4208,7 +4208,7 @@ server cluster UnitTesting = 4294048773 {
attribute int16s rangeRestrictedInt16s = 41;
attribute LONG_OCTET_STRING listLongOctetString[] = 42;
attribute TestFabricScoped listFabricScoped[] = 43;
attribute boolean timedWriteBoolean = 48;
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
attribute nullable boolean nullableBoolean = 16384;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3528,7 +3528,7 @@ server cluster UnitTesting = 4294048773 {
attribute int16s rangeRestrictedInt16s = 41;
attribute LONG_OCTET_STRING listLongOctetString[] = 42;
attribute TestFabricScoped listFabricScoped[] = 43;
attribute boolean timedWriteBoolean = 48;
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
attribute nullable boolean nullableBoolean = 16384;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ class MultiAdminClientFragment : Fragment() {
val testIteration = 1000
val devicePointer =
ChipClient.getConnectedDevicePointer(requireContext(), addressUpdateFragment.deviceId)

var setupPinCode: Long? = null
if (!binding.setupPinCodeEd.text.toString().isEmpty()) {
setupPinCode = binding.setupPinCodeEd.text.toString().toULong().toLong()
}
deviceController.openPairingWindowWithPINCallback(
devicePointer, testDuration, testIteration.toLong(),
binding.discriminatorEd.text.toString().toInt(), binding.setupPinCodeEd.text.toString().toULong().toLong(),
binding.discriminatorEd.text.toString().toInt(), setupPinCode,
object:OpenCommissioningCallback {
override fun onError(status: Int, deviceId: Long) {
showMessage("OpenCommissioning Fail! \nDevice ID : $deviceId\nErrorCode : $status")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,12 @@ class WildcardFragment : Fragment() {
private val TLV_MAP = mapOf(
"UnsignedInt" to object:TlvWriterInterface {
override fun generate(writer : TlvWriter, value: String, tag: chip.tlv.Tag) {
writer.put(tag, value.toUInt())
writer.put(tag, value.toULong())
}
},
"Int" to object:TlvWriterInterface {
override fun generate(writer : TlvWriter, value: String, tag: chip.tlv.Tag) {
writer.put(tag, value.toInt())
writer.put(tag, value.toLong())
}
},
"Boolean" to object:TlvWriterInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@

#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1

#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test Bulb"
#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Contact sensor"
10 changes: 5 additions & 5 deletions examples/darwin-framework-tool/templates/commands.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private:
{{/unless}}
{{/chip_cluster_commands}}

{{#chip_server_cluster_attributes}}
{{#zcl_attributes_server removeKeys='isOptional'}}
{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}}
{{#*inline "cluster"}}Cluster{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline}}
{{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}}
Expand Down Expand Up @@ -201,7 +201,7 @@ private:
{{else if (isCharString type)}}
chip::ByteSpan mValue;
{{else}}
{{chipType}} mValue;
{{as_underlying_zcl_type type}} mValue;
{{/if_chip_complex}}
};

Expand Down Expand Up @@ -246,7 +246,7 @@ public:

{{/if}}
{{/unless}}
{{/chip_server_cluster_attributes}}
{{/zcl_attributes_server}}
{{/unless}}
{{/chip_client_clusters}}

Expand All @@ -268,7 +268,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands)
make_unique<{{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}>(), //
{{/unless}}
{{/chip_cluster_commands}}
{{#chip_server_cluster_attributes}}
{{#zcl_attributes_server removeKeys='isOptional'}}
{{#first}}
make_unique<ReadAttribute>(Id), //
{{/first}}
Expand All @@ -291,7 +291,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands)
make_unique<SubscribeAttribute{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}>(), //
{{/if}}
{{/unless}}
{{/chip_server_cluster_attributes}}
{{/zcl_attributes_server}}
{{#zcl_events}}
{{#first}}
make_unique<ReadEvent>(Id), //
Expand Down
Loading

0 comments on commit 6884b55

Please sign in to comment.