Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-validation-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov authored Jul 26, 2024
2 parents ecb30bc + 6180583 commit b7ab173
Show file tree
Hide file tree
Showing 176 changed files with 14,845 additions and 1,412 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ jobs:
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) Pump App
- name: Build example Telink (B91 USB) Pump App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump' build"
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-usb' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d pump-app \
out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \
telink tlsr9518adk80d pump-app-usb \
out/telink-tlsr9518adk80d-pump-usb/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/ecosystem-information-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \
Expand Down Expand Up @@ -502,6 +503,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_5.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_AccessChecker.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CGEN_2_4.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CNET_1_4.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_DA_1_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_DA_1_5.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_DA_1_7.py'
Expand Down Expand Up @@ -577,6 +579,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_RVCOPSTATE_2_3.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_RVCOPSTATE_2_4.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_SC_7_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_SWTCH.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestConformanceSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestSpecParsingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
Expand Down
1 change: 1 addition & 0 deletions docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Generally regenerate using one of:
| 1294 | 0x50E | AccountLogin |
| 1295 | 0x50F | ContentControl |
| 1296 | 0x510 | ContentAppObserver |
| 1872 | 0x750 | EcosystemInformation |
| 1873 | 0x751 | CommissionerControl |
| 2820 | 0xB04 | ElectricalMeasurement |
| 4294048773 | 0xFFF1FC05 | UnitTesting |
Expand Down
36 changes: 26 additions & 10 deletions examples/air-quality-sensor-app/telink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ You can use this example as a reference for creating your own application.

![Telink B91 EVK](http://wiki.telink-semi.cn/wiki/assets/Hardware/B91_Generic_Starter_Kit_Hardware_Guide/connection_chart.png)

## Supported devices

The example supports building and running on the following devices:

| Board/SoC | Build target | Zephyr Board Info |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [B91](https://wiki.telink-semi.cn/wiki/Hardware/B91_Generic_Starter_Kit_Hardware_Guide) [TLSR9518ADK80D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR951x-Series) | `tlsr9518adk80d`, `tlsr9518adk80d-mars`, `tlsr9518adk80d-usb` | [TLSR9518ADK80D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9518adk80d/doc/index.rst) |
| [B92](https://wiki.telink-semi.cn/wiki/Hardware/B92_Generic_Starter_Kit_Hardware_Guide) [TLSR9528A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR952x-Series) | `tlsr9528a`, `tlsr9528a_retention` | [TLSR9528A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9528a/doc/index.rst) |
| [B95](https://wiki.telink-semi.cn/wiki/Hardware/B95_Generic_Starter_Kit_Hardware_Guide) [TLSR9258A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR925x-Series) | `tlsr9258a` | [TLSR9258A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9258a/doc/index.rst) |
| [W91](https://wiki.telink-semi.cn/wiki/Hardware/W91_Generic_Starter_Kit_Hardware_Guide) [TLSR9118BDK40D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR911x-Series) | `tlsr9118bdk40d` | [TLSR9118BDK40D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9118bdk40d/doc/index.rst) |

## Build and flash

1. Run the Docker container:
Expand All @@ -12,7 +23,7 @@ You can use this example as a reference for creating your own application.
$ docker run -it --rm -v $PWD:/host -w /host ghcr.io/project-chip/chip-build-telink:$(wget -q -O - https://raw.githubusercontent.com/project-chip/connectedhomeip/master/.github/workflows/examples-telink.yaml 2> /dev/null | grep chip-build-telink | awk -F: '{print $NF}')
```

Compatible docker image version can be found in next file:
You can find the compatible Docker image version in the file:

```bash
$ .github/workflows/examples-telink.yaml
Expand All @@ -24,8 +35,8 @@ You can use this example as a reference for creating your own application.
$ source ./scripts/activate.sh -p all,telink
```

3. In the example dir run (replace _<build_target>_ with your board name, for
example, `tlsr9118bdk40d`, `tlsr9518adk80d`, `tlsr9528a` or `tlsr9258a`):
3. Build the example (replace _<build_target>_ with your board name, see
[Supported devices](#supported-devices)):

```bash
$ west build -b <build_target>
Expand All @@ -35,9 +46,12 @@ You can use this example as a reference for creating your own application.
MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=4m`:

```bash
$ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m
$ west build -b <build_target> -- -DFLASH_SIZE=4m
```

You can find the target built file called **_zephyr.bin_** under the
**_build/zephyr_** directory.

4. Flash binary:

```
Expand All @@ -56,16 +70,18 @@ To get output from device, connect UART to following pins:
| TX | PB2 (pin 16 of J34 connector) |
| GND | GND |

Baud rate: 115200 bits/s

### Buttons

The following buttons are available on **tlsr9518adk80d** board:

| Name | Function | Description |
| :------- | :--------------------- | :----------------------------------------------------------------------------------------------------- |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and back to uncommissioned state |
| Button 2 | `AirQuality` control | Manually triggers the `AirQuality` state |
| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |
| Name | Function | Description |
| :------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and return to a decommissioned state (to activate, push the button 3 times) |
| Button 2 | `AirQuality` control | Manually triggers the `AirQuality` state |
| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |

### LEDs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4582,6 +4582,56 @@ cluster EnergyEvseMode = 157 {
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
cluster WaterHeaterMode = 158 {
revision 1;

enum ModeTag : enum16 {
kOff = 16384;
kManual = 16385;
kTimed = 16386;
}

bitmap Feature : bitmap32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute optional nullable int8u startUpMode = 2;
attribute optional nullable int8u onMode = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
int8u newMode = 0;
}

response struct ChangeToModeResponse = 1 {
enum8 status = 0;
optional char_string statusText = 1;
}

/** This command is used to change device modes.
On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional cluster DeviceEnergyManagementMode = 159 {
revision 1;
Expand Down Expand Up @@ -8479,6 +8529,22 @@ endpoint 1 {
handle command ChangeToModeResponse;
}

server cluster WaterHeaterMode {
callback attribute supportedModes;
callback attribute currentMode;
ram attribute startUpMode;
ram attribute onMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;

handle command ChangeToMode;
handle command ChangeToModeResponse;
}

server cluster DeviceEnergyManagementMode {
callback attribute supportedModes;
callback attribute currentMode;
Expand Down
Loading

0 comments on commit b7ab173

Please sign in to comment.