Skip to content

Commit

Permalink
Pull request project-chip#63: UIC-2321: Moving the Unify Matter Bridg…
Browse files Browse the repository at this point in the history
…e to matter repo.

Merge in WMN_TOOLS/matter from feature/unify_matter_bridge to silabs

Squashed commit of the following:

commit daf32d2989c04e17911cd1a7379a887210e82ae8
Author: Anders Esbensen <[email protected]>
Date:   Tue Sep 13 13:29:45 2022 +0200

    Applied new formating.

commit 7d9e0b2f4ebed9919ae36776ab2536f8d11406ec
Author: Anders Esbensen <[email protected]>
Date:   Tue Sep 13 12:27:05 2022 +0200

    Added stograge persistance.

commit 354849c5861f15b70241abd2ca91f3d9db449e81
Author: Anders Esbensen <[email protected]>
Date:   Mon Sep 12 11:06:49 2022 +0200

    Only build efr32 examples in CI for now.

commit 6b72a5ac9c011cb0570e578e74e92ac7db76c883
Author: Anders Esbensen <[email protected]>
Date:   Thu Sep 8 12:09:55 2022 +0200

    UIC-2321: Use pkg_config instead.

commit 28afe77a4b9525909f12b5b04b36e86302dbb31c
Author: Anders Esbensen <[email protected]>
Date:   Fri Sep 2 09:47:11 2022 +0200

    UIC-2321: Moving the Unify Matter Bridge to matter repo.
  • Loading branch information
Anders Esbensen authored and jmartinez-silabs committed Oct 7, 2022
1 parent fd7502c commit b5f3242
Show file tree
Hide file tree
Showing 86 changed files with 16,807 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/platform/linux/NamedPipeCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <lib/core/CHIPError.h>
#include <pthread.h>
#include <string>
#include <pthread.h>
#include <errno.h>

class NamedPipeCommandDelegate
{
Expand Down
2 changes: 1 addition & 1 deletion silabs_ci_scripts/build_custom_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
BUILD_TYPES = {("standard", "")}
building_command = './scripts/examples/gn_efr32_example.sh ./silabs_examples/{app}/efr32 ./out/custom/{app}/{network} {board} {buildArguments}'

for examples in glob.glob("./silabs_examples/*"):
for examples in glob.glob("./silabs_examples/*/efr32"):
for build in BUILDS:
for board in BOARDS:
for build_type in BUILD_TYPES:
Expand Down
33 changes: 33 additions & 0 deletions silabs_examples/unify-matter-bridge/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG VERSION=latest
FROM connectedhomeip/chip-build:${VERSION}

# Rust Version to install
ENV RUST_VERSION=1.60.0
# Rust and Cargo home directories
ENV RUSTUP_HOME=/opt/rustup-home
ENV CARGO_HOME=/opt/cargo-home
# Install Rust and Cargo
RUN curl https://sh.rustup.rs -sSf --output /tmp/sh.rustup.rs \
&& cd /tmp && chmod +x sh.rustup.rs \
&& ./sh.rustup.rs -y --profile minimal --default-toolchain ${RUST_VERSION}\
&& rm /tmp/sh.rustup.rs \
&& /opt/cargo-home/bin/cargo install cargo2junit \
# remove the main branch reference once the maintainer tagged 81d73b4
&& /opt/cargo-home/bin/cargo install cargo-deb --git https://github.com/kornelski/cargo-deb.git --branch main \
&& chmod -R a+rw ${RUSTUP_HOME} ${CARGO_HOME} \
&& find ${RUSTUP_HOME} ${CARGO_HOME} -type d -exec chmod a+x {} \;
ENV PATH="${CARGO_HOME}/bin:${PATH}"

#Target dependencies
RUN apt update && \
apt install -y \
libsqlite3-dev libedit-dev libyaml-cpp0.6 libmosquitto-dev\
libyaml-cpp-dev \
libboost-atomic-dev libboost-chrono-dev libboost-date-time-dev \
libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev \
libboost-serialization-dev libboost-system-dev libboost-thread-dev \
libboost-log-dev nlohmann-json3-dev

#Build host dependencies
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN apt install -y ruby ruby-dev
25 changes: 25 additions & 0 deletions silabs_examples/unify-matter-bridge/linux/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2021 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.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
import("//args.gni")
}
53 changes: 53 additions & 0 deletions silabs_examples/unify-matter-bridge/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/build/config/linux/pkg_config.gni")

assert(chip_build_tools)

pkg_config("unify") {
packages = [ "libunify" ]
}

executable("unify-matter-bridge") {
include_dirs = [
"src",
"src/cluster_translator",
"src/device_type_mapper",
"src/matter_node_state_monitor",
"include",
]

sources = [
"src/matter_data_storage.cpp",
"src/attribute_state_cache.cpp",
"src/cluster_translator/bridged_device_basic_info_attribute_translator.cpp",
"src/cluster_translator/group_command_translator.cpp",
"src/cluster_translator/group_translator.cpp",
"src/cluster_translator/identify_attribute_translator.cpp",
"src/cluster_translator/identify_command_translator.cpp",

#"src/cluster_translator/level_attribute_translator.cpp",
#"src/cluster_translator/level_command_translator.cpp",
"src/cluster_translator/on_off_attribute_translator.cpp",
"src/cluster_translator/on_off_command_translator.cpp",
"src/demo_uic_cli.cpp",
"src/device_type_mapper/matter_device_translator.cpp",
"src/device_type_mapper/matter_device_types_clusters_list_updated.inc",
"src/dummy.cpp",
"src/matter_bridge_config.c",
"src/matter_bridge_main.cpp",
"src/matter_node_state_monitor/matter_cluster_interactor.cpp",
"src/matter_node_state_monitor/matter_endpoint_builder.cpp",
"src/matter_node_state_monitor/matter_node_state_monitor.cpp",
]

deps = [
"${chip_root}/examples/platform/linux:app-main",
"//../unify-matter-bridge-common",
]
configs += [ ":unify" ]
}

group("linux") {
deps = [ ":unify-matter-bridge" ]
}
38 changes: 38 additions & 0 deletions silabs_examples/unify-matter-bridge/linux/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2020 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.

import("//build_overrides/chip.gni")

import("${chip_root}/config/standalone/args.gni")

chip_device_project_config_include = "<CHIPProjectAppConfig.h>"
chip_project_config_include = "<CHIPProjectAppConfig.h>"
chip_system_project_config_include = "<SystemProjectConfig.h>"

chip_project_config_include_dirs =
[ "${chip_root}/examples/tv-app/tv-common/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

chip_build_libshell = true

chip_enable_additional_data_advertising = true

chip_enable_rotating_device_id = true

cpp_standard = "c++17"

enable_pic = false

default_configs_exceptions =
[ "//third_party/connectedhomeip/build/config/compiler:exceptions" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2021 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.

declare_args() {
# Root directory for build files.
build_root = "//third_party/connectedhomeip/build"
}
18 changes: 18 additions & 0 deletions silabs_examples/unify-matter-bridge/linux/build_overrides/chip.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 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.

declare_args() {
# Root directory for CHIP.
chip_root = "//third_party/connectedhomeip"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 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.

declare_args() {
# Root directory for nlassert.
nlassert_root = "//third_party/connectedhomeip/third_party/nlassert"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2020 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.

declare_args() {
# Root directory for nlfaultinjection.
nlfaultinjection_root =
"//third_party/connectedhomeip/third_party/nlfaultinjection"
}
18 changes: 18 additions & 0 deletions silabs_examples/unify-matter-bridge/linux/build_overrides/nlio.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 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.

declare_args() {
# Root directory for nlio.
nlio_root = "//third_party/connectedhomeip/third_party/nlio"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 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.

declare_args() {
# Root directory for nlunit-test.
nlunit_test_root = "//third_party/connectedhomeip/third_party/nlunit-test"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2020 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.

declare_args() {
openthread_root = "//third_party/openthread/repo"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2020 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.

declare_args() {
ot_br_posix_root = "//third_party/ot-br-posix"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2020 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.

declare_args() {
# Location of the Pigweed repository.
dir_pigweed = "//third_party/connectedhomeip/third_party/pigweed/repo"
}

import("$dir_pigweed/modules.gni")
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is automatically generated by Pigweed's environment setup. Do not
# edit it manually or check it in.
declare_args() {
pw_env_setup_CIPD_ARM = "//.environment/cipd/packages/arm"
dir_cipd_arm = "//.environment/cipd/packages/arm"
pw_env_setup_CIPD_PIGWEED = "//.environment/cipd/packages/pigweed"
dir_cipd_pigweed = "//.environment/cipd/packages/pigweed"
pw_env_setup_CIPD_PYTHON = "//.environment/cipd/packages/python"
dir_cipd_python = "//.environment/cipd/packages/python"
pw_env_setup_VIRTUAL_ENV = "//.environment/pigweed-venv"
pw_env_setup_PACKAGE_ROOT = "//.environment/packages"
}
Loading

0 comments on commit b5f3242

Please sign in to comment.