Skip to content

Commit

Permalink
Merge branch 'master' into telink_matter_update
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Mar 7, 2023
2 parents 2c80556 + 69ec3ea commit b2a9b98
Show file tree
Hide file tree
Showing 122 changed files with 3,813 additions and 1,151 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exclude = third_party
# temporarily scan only directories with fixed files
# TODO: Remove the paths below when all bugs are fixed
src/tools/chip-cert/*
src/test_driver/openiotsdk/*
src/test_driver/mbed/*
src/test_driver/linux-cirque/*
build/chip/java/tests/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-cc32xx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- uses: Wandalen/[email protected].15
- uses: Wandalen/[email protected].36
name: Checkout
with:
action: actions/checkout@v3
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ jobs:
out/telink-tlsr9518adk80d-all-clusters/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink All Clusters Minimal App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -88,6 +91,9 @@ jobs:
out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Contact Sensor App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -97,6 +103,9 @@ jobs:
out/telink-tlsr9518adk80d-contact-sensor/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Lighting App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -106,15 +115,21 @@ jobs:
out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Lighting App with RPC
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d lighting-app-rpc \
out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \
out/telink-tlsr9518adk80d-light-rpc/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Light Switch App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -124,6 +139,9 @@ jobs:
out/telink-tlsr9518adk80d-light-switch/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Lock App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -133,6 +151,9 @@ jobs:
out/telink-tlsr9518adk80d-lock/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink OTA Requestor App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -142,6 +163,9 @@ jobs:
out/telink-tlsr9518adk80d-ota-requestor/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Pump App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -151,6 +175,9 @@ jobs:
out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Pump Controller App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -160,6 +187,9 @@ jobs:
out/telink-tlsr9518adk80d-pump-controller/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Temperature Measurement App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -169,6 +199,9 @@ jobs:
out/telink-tlsr9518adk80d-temperature-measurement/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Thermostat App
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -178,6 +211,9 @@ jobs:
out/telink-tlsr9518adk80d-thermostat/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Uploading Size Reports
uses: actions/upload-artifact@v3
if: ${{ !env.ACT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
.environment/pigweed-venv/*.log
- name: Artifact suffix
id: outsuffix
uses: haya14busa/action-cond@v1.0.0
uses: haya14busa/action-cond@v1
if: ${{ !env.ACT }}
with:
cond: ${{ github.event.pull_request.number == '' }}
Expand Down
13 changes: 10 additions & 3 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)

set(CHIP_REQUIRE_COMPONENTS freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash spi_flash)

if((NOT "${IDF_TARGET}" STREQUAL "esp32h2") AND (NOT "${IDF_TARGET}" STREQUAL "esp32c2"))
if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND CHIP_REQUIRE_COMPONENTS mdns)
endif()

Expand Down Expand Up @@ -314,8 +314,15 @@ if(CONFIG_OPENTHREAD_ENABLED)
list(APPEND chip_libraries $<TARGET_FILE:${openthread_lib}>)
endif()

if((NOT CONFIG_USE_MINIMAL_MDNS) AND (NOT CONFIG_IDF_TARGET_ESP32H2) AND (NOT CONFIG_IDF_TARGET_ESP32C2))
idf_component_get_property(mdns_lib mdns COMPONENT_LIB)
if((NOT CONFIG_USE_MINIMAL_MDNS) AND (NOT CONFIG_IDF_TARGET_ESP32H2))
idf_build_get_property(build_components BUILD_COMPONENTS)
# For IDF v5.x, the mdns component was moved to idf_managed_components.
# We should use 'espressif__mdns' for 'idf_component_get_property'.
if("espressif__mdns" IN_LIST build_components)
idf_component_get_property(mdns_lib espressif__mdns COMPONENT_LIB)
elseif("mdns" IN_LIST build_components)
idf_component_get_property(mdns_lib mdns COMPONENT_LIB)
endif()
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
endif()

Expand Down
2 changes: 0 additions & 2 deletions config/python/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1

// Uncomment this for a large Tunnel MTU.
//#define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)

Expand Down
2 changes: 0 additions & 2 deletions config/standalone/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1

// Uncomment this for a large Tunnel MTU.
// #define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS
*
* Enable recording UTC timestamps.
*/
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1

/**
* CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
*
Expand Down
7 changes: 7 additions & 0 deletions examples/chef/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"

/**
* CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS
*
* Enable recording UTC timestamps.
*/
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1

/**
* CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
*
Expand Down
2 changes: 0 additions & 2 deletions examples/chip-tool/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1

// Uncomment this for a large Tunnel MTU.
//#define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)

Expand Down
26 changes: 20 additions & 6 deletions examples/java-matter-controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/java/rules.gni")
import("${chip_root}/build/chip/tools.gni")

java_binary("java-matter-controller") {
output_name = "java-matter-controller"
java_library("java") {
output_name = "JavaMatterController.jar"
deps = [
"${chip_root}/src/controller/java",
"${chip_root}/src/setup_payload/java",
"${chip_root}/third_party/java_deps:annotation",
]

sources = [
"java/src/com/matter/controller/Main.java",
"java/src/com/matter/controller/commands/common/Argument.java",
"java/src/com/matter/controller/commands/common/ArgumentType.java",
"java/src/com/matter/controller/commands/common/Command.java",
Expand All @@ -37,9 +36,6 @@ java_binary("java-matter-controller") {
"java/src/com/matter/controller/commands/common/IPAddress.java",
"java/src/com/matter/controller/commands/common/MatterCommand.java",
"java/src/com/matter/controller/commands/common/RealResult.java",
"java/src/com/matter/controller/commands/discover/DiscoverCommand.java",
"java/src/com/matter/controller/commands/discover/DiscoverCommissionablesCommand.java",
"java/src/com/matter/controller/commands/discover/DiscoverCommissionersCommand.java",
"java/src/com/matter/controller/commands/pairing/CloseSessionCommand.java",
"java/src/com/matter/controller/commands/pairing/DiscoveryFilterType.java",
"java/src/com/matter/controller/commands/pairing/PairAddressPaseCommand.java",
Expand All @@ -55,6 +51,7 @@ java_binary("java-matter-controller") {
"java/src/com/matter/controller/commands/pairing/PairOnNetworkFabricCommand.java",
"java/src/com/matter/controller/commands/pairing/PairOnNetworkInstanceNameCommand.java",
"java/src/com/matter/controller/commands/pairing/PairOnNetworkLongCommand.java",
"java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImWriteCommand.java",
"java/src/com/matter/controller/commands/pairing/PairOnNetworkShortCommand.java",
"java/src/com/matter/controller/commands/pairing/PairOnNetworkVendorCommand.java",
"java/src/com/matter/controller/commands/pairing/PairingCommand.java",
Expand All @@ -66,6 +63,23 @@ java_binary("java-matter-controller") {
javac_flags = [ "-Xlint:deprecation" ]
}

kotlin_binary("java-matter-controller") {
output_name = "java-matter-controller"
deps = [
":java",
"${chip_root}/third_party/java_deps:kotlin-stdlib",
]

sources = [
"java/src/com/matter/controller/Main.kt",
"java/src/com/matter/controller/commands/discover/DiscoverCommand.kt",
"java/src/com/matter/controller/commands/discover/DiscoverCommissionablesCommand.kt",
"java/src/com/matter/controller/commands/discover/DiscoverCommissionersCommand.kt",
]

kotlinc_flags = [ "-Xlint:deprecation" ]
}

group("default") {
deps = [ ":java-matter-controller" ]
}
4 changes: 2 additions & 2 deletions examples/java-matter-controller/Manifest.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Main-Class: com.matter.controller.Main
Class-Path: ../lib/third_party/connectedhomeip/src/controller/java/CHIPController.jar ../lib/third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar ../lib/third_party/connectedhomeip/third_party/java_deps/stub_src/Android.jar ../lib/third_party/connectedhomeip/third_party/java_deps/json-20220924.jar ../lib/third_party/connectedhomeip/third_party/java_deps/jsr305-3.0.2.jar
Main-Class: com.matter.controller.MainKt
Class-Path: ../lib/third_party/connectedhomeip/src/controller/java/CHIPController.jar ../lib/third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar ../lib/third_party/connectedhomeip/third_party/java_deps/stub_src/Android.jar ../lib/third_party/connectedhomeip/third_party/java_deps/json-20220924.jar ../lib/third_party/connectedhomeip/third_party/java_deps/jsr305-3.0.2.jar ../lib/third_party/connectedhomeip/third_party/java_deps/kotlin-stdlib-1.8.10.jar

53 changes: 48 additions & 5 deletions examples/java-matter-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You need to have the following two software installed on your Ubuntu system:
1. Java Runtime Environment (JRE)
2. Java Development Kit (JDK)

```
```shell
java -version
```

Expand All @@ -36,20 +36,63 @@ sudo apt install default-jre Install Java default JRE
After installing the JRE, let us check if we have the Java Development Kit
installed on our system or not.

```
```shell
javac -version
```

The above output shows that I need to install the Java compiler or the JDK on my
system. You can install it through the following command as root:

```
```shell
sudo apt install default-jdk
```

### Linux
You also need to install kotlin compiler on your Ubuntu system:

kotlin compiler version 1.8.10 or above is needed to compile
java-matter-controller, if you already have lower version kotlin compiler
installed on your Ubuntu from apt,
you need to remove the Kotlin compiler package, run the following command:

```shell
sudo apt-get remove kotlin
```

Wait for the removal process to complete. Once it's done, the Kotlin compiler
will be removed from your system.

(Optional) If you want to remove any configuration files associated with Kotlin,
run the following command:

```shell
sudo apt-get purge kotlin
```

Install kotlin compiler 1.8.10 or above, such as
[kotlin-compiler-1.8.10-url](https://github.com/JetBrains/kotlin/releases/download/v1.8.10/kotlin-compiler-1.8.10.zip)

```shell
cd /usr/lib \
&& sudo wget -q [kotlin-compiler-1.8.10-url] \
&& sudo unzip kotlin-compiler-*.zip \
&& sudo rm kotlin-compiler-*.zip \
&& sudo rm -f kotlinc/bin/*.bat
```

Add a directory to PATH permanently by editing the `.bashrc` file located in the
Home directory. Follow these steps:

1. Open the `.bashrc` file using a text editor.
2. Go to the end of the file.
3. Paste the export syntax at the end of the file.

```shell
export PATH="/usr/lib/kotlinc/bin:$PATH"
```

### Linux

```shell
export JAVA_PATH=[JDK path]
```

Expand Down Expand Up @@ -81,6 +124,6 @@ The Java executable file `java-matter-controller` will be generated at

Run the java-matter-controller

```
```shell
java -Djava.library.path=../lib/jni -jar java-matter-controller
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1

// Enable support functions for parsing command-line arguments
#define CHIP_CONFIG_ENABLE_ARG_PARSER 1

Expand Down
Loading

0 comments on commit b2a9b98

Please sign in to comment.