Skip to content

Commit

Permalink
Pull request #120: Unify develop
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from unify_develop to silabs

Squashed commit of the following:

commit 13e9430082964ada7ea0478566c9a08f462ec1e9
Author: Anders Esbensen <[email protected]>
Date:   Wed Oct 5 14:19:01 2022 +0000

    Pull request #141: Added MSLA license file

    Merge in WMN_TOOLS/matter from feature/added_msla_license to unify_develop

    Squashed commit of the following:

    commit f458f8544ed79bb5692ec04dbe01db544f650826
    Author: Anders Esbensen <[email protected]>
    Date:   Wed Oct 5 16:00:50 2022 +0200

        Added MSLA license file

commit 2cdc42127cf9fa9677cdc4fec7768c2360e4af83
Author: Dennis Jensen <[email protected]>
Date:   Wed Oct 5 14:06:10 2022 +0000

    Pull request #130: UIC-2300: Node state monitor tests

    Merge in WMN_TOOLS/matter from feature/UIC-2300_Unit_test_matter_node_state_monitor to unify_develop

    Squashed commit of the following:

    commit e0523a5a0536970c1a8d344304f3db3f7cfc0737
    Author: Dennis Jensen <[email protected]>
    Date:   Wed Sep 28 12:17:28 2022 +0200

        UIC-2300: Node state monitor tests

        Changes:
        * Testing the node state monitor.
        * Made the node state monitor more fail safe.
        * Added a wrapper around ember interface.
        * Testing the wrapper interface is called properly.

commit b7048f3d8cb1e9f833e7748afacc356bfb35da66
Author: Kei Shirakizawa <[email protected]>
Date:   Wed Oct 5 13:45:02 2022 +0000

    Pull request #140: UIC-2462 contd.: Fix comments for GN files

    Merge in WMN_TOOLS/matter from feature/UIC-2462-fix-gn-files to unify_develop

    Squashed commit of the following:

    commit d996c149eb3b130f9b1e540f3197cd185781e389
    Author: Kei Shirakizawa <[email protected]>
    Date:   Wed Oct 5 15:31:26 2022 +0200

        UIC-2462 contd.: Fix comments for GN files

... and 23 more commits
  • Loading branch information
jsloth authored and jmartinez-silabs committed May 3, 2023
1 parent a871a5a commit 368e929
Show file tree
Hide file tree
Showing 75 changed files with 74,221 additions and 2,570 deletions.
8 changes: 8 additions & 0 deletions silabs_examples/unify-matter-bridge/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**Copyright 2022 Silicon Laboratories Inc. www.silabs.com**

The licensor of this software is Silicon Laboratories Inc. Your use of this
software is governed by the terms of Silicon Labs Master Software License
Agreement (MSLA) available at
www.silabs.com/about-us/legal/master-software-license-agreement. This software
is distributed to you in Source Code format and is governed by the sections of
the MSLA applicable to Source Code.
80 changes: 62 additions & 18 deletions silabs_examples/unify-matter-bridge/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,77 @@
ARG VERSION=latest
FROM connectedhomeip/chip-build:${VERSION}
FROM debian:buster

ENV DEBIAN_FRONTEND=noninteractive

SHELL ["/bin/bash", "-c"]

ARG ARCH="armhf"

ARG TARGET_DEPS="libavahi-client-dev libssl-dev libsystemd-dev libwrap0-dev uthash-dev \
libsqlite3-dev libedit-dev libyaml-cpp0.6 libmosquitto-dev\
libreadline-dev libncurses5-dev libncursesw5-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 procps libmbedtls-dev libglib2.0-dev"

ARG HOST_DEPS="ninja-build git git-lfs curl pkg-config \
ruby ruby-dev \
gcc g++ gdb-multiarch \
build-essential \
clang nlohmann-json3-dev \
libdbus-glib-1-dev libssl-dev libgirepository1.0-dev"

# configure additional arches in dpkg/apt
RUN for arch in ${ARCH} ; do \
dpkg --add-architecture $arch ; \
echo $arch ; \
done

RUN apt-get update \
&& apt-get install --no-install-recommends -y curl gnupg2 ca-certificates \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
${HOST_DEPS} \
$(for dep in ${TARGET_DEPS} ; do \
for arch in ${ARCH} ; do echo $dep:$arch ; done ; \
done) \
$(for arch in ${ARCH} ; do echo crossbuild-essential-${arch} ; done)\
&& rm -rf /var/lib/apt/lists/*

# Install python 3.9
RUN curl -L https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh --output /tmp/Miniconda.sh \
&& cd /tmp \
&& echo 78f39f9bae971ec1ae7969f0516017f2413f17796670f7040725dd83fcff5689 Miniconda.sh > /tmp/Miniconda.sh.sha256 \
&& sha256sum -c /tmp/Miniconda.sh.sha256 \
&& bash /tmp/Miniconda.sh -b -p /usr/local/miniconda \
&& /usr/local/miniconda/condabin/conda init bash \
&& ln -sf /usr/local/miniconda/bin/python3.9 /usr/bin/python3 \
&& ln -sf /usr/local/miniconda/bin/pip3 /usr/bin/pip3

# Rust Version to install
ENV RUST_VERSION=1.60.0
ENV RUST_VERSION=1.64.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}\
&& if [[ $ARCH == *"armhf"* ]]; then export RUST_TRIPLES="$RUST_TRIPLES armv7-unknown-linux-gnueabihf"; fi \
&& if [[ $ARCH == *"amd64"* ]]; then export RUST_TRIPLES="$RUST_TRIPLES x86_64-unknown-linux-gnu"; fi \
&& ./sh.rustup.rs -y --profile minimal --target ${RUST_TRIPLES} --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
# Install cmake 1.19.2
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-Linux-x86_64.sh --output /tmp/cmake-3.19.2-Linux-x86_64.sh \
&& cd /tmp \
&& echo 2fc84c1bd5a5fa8850426905a76147fbf897cf67ef324b009bcdb7eceafa9662 cmake-3.19.2-Linux-x86_64.sh > /tmp/cmake-3.19.2-Linux-x86_64.sh.sha256 \
&& sha256sum -c cmake-3.19.2-Linux-x86_64.sh.sha256 \
&& chmod +x /tmp/cmake*.sh \
&& /tmp/cmake*.sh --prefix=/usr/local --skip-license \
&& rm /tmp/cmake*
28 changes: 15 additions & 13 deletions silabs_examples/unify-matter-bridge/linux/.gn
Original file line number Diff line number Diff line change
@@ -1,18 +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.
# ******************************************************************************
# * # License
# * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
# ******************************************************************************
# * The licensor of this software is Silicon Laboratories Inc. Your use of this
# * software is governed by the terms of Silicon Labs Master Software License
# * Agreement (MSLA) available at
# * www.silabs.com/about-us/legal/master-software-license-agreement. This
# * software is distributed to you in Source Code format and is governed by the
# * sections of the MSLA applicable to Source Code.
# *
# ******************************************************************************

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

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
Expand All @@ -21,5 +21,7 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn"
check_system_includes = true

default_args = {
pw_unit_test_AUTOMATIC_RUNNER = "$dir_pigweed/targets/host/run_test"

import("//args.gni")
}
65 changes: 54 additions & 11 deletions silabs_examples/unify-matter-bridge/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,53 +1,96 @@
# ******************************************************************************
# * # License
# * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
# ******************************************************************************
# * The licensor of this software is Silicon Laboratories Inc. Your use of this
# * software is governed by the terms of Silicon Labs Master Software License
# * Agreement (MSLA) available at
# * www.silabs.com/about-us/legal/master-software-license-agreement. This
# * software is distributed to you in Source Code format and is governed by the
# * sections of the MSLA applicable to Source Code.
# *
# ******************************************************************************

import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/build/config/linux/pkg_config.gni")
import("${chip_root}/build/config/compiler/compiler.gni")

assert(chip_build_tools)

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

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

ldflags = [ "-lboost_system" ]

}

static_library("unify-matter-bridge-lib") {

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_bridge_cli.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",
"zap-handlers/gen/command_translator.cpp",
"zap-handlers/gen/attribute_translator.cpp",
"zap-handlers/gen/unify_accessors.cpp",
"src/uic_mqtt_wrapper.cpp"
]

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

output_dir = root_out_dir

public_configs = [ ":unify-config" , ":unify" ]

}

executable("unify-matter-bridge") {
sources = [
"src/matter_bridge_main.cpp",
]

deps = [
":unify-matter-bridge-lib"
]
}

group("linux") {
deps = [ ":unify-matter-bridge" ]
}


if (chip_build_tests) {
group("check") {
deps = [
"//src/tests",
]
}
}
37 changes: 17 additions & 20 deletions silabs_examples/unify-matter-bridge/linux/args.gni
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# 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.
# ******************************************************************************
# * # License
# * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
# ******************************************************************************
# * The licensor of this software is Silicon Laboratories Inc. Your use of this
# * software is governed by the terms of Silicon Labs Master Software License
# * Agreement (MSLA) available at
# * www.silabs.com/about-us/legal/master-software-license-agreement. This
# * software is distributed to you in Source Code format and is governed by the
# * sections of the MSLA applicable to Source Code.
# *
# ******************************************************************************

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

Expand All @@ -21,18 +20,16 @@ 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" ]
[ "//../unify-matter-bridge-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
chip_build_libshell = false
chip_enable_additional_data_advertising = false
chip_enable_rotating_device_id = false

cpp_standard = "c++17"

enable_pic = false
is_debug = true

default_configs_exceptions =
[ "//third_party/connectedhomeip/build/config/compiler:exceptions" ]
25 changes: 12 additions & 13 deletions silabs_examples/unify-matter-bridge/linux/build_overrides/build.gni
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# 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.
# ******************************************************************************
# * # License
# * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
# ******************************************************************************
# * The licensor of this software is Silicon Laboratories Inc. Your use of this
# * software is governed by the terms of Silicon Labs Master Software License
# * Agreement (MSLA) available at
# * www.silabs.com/about-us/legal/master-software-license-agreement. This
# * software is distributed to you in Source Code format and is governed by the
# * sections of the MSLA applicable to Source Code.
# *
# ******************************************************************************

declare_args() {
# Root directory for build files.
Expand Down
25 changes: 12 additions & 13 deletions silabs_examples/unify-matter-bridge/linux/build_overrides/chip.gni
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# 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.
# ******************************************************************************
# * # License
# * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
# ******************************************************************************
# * The licensor of this software is Silicon Laboratories Inc. Your use of this
# * software is governed by the terms of Silicon Labs Master Software License
# * Agreement (MSLA) available at
# * www.silabs.com/about-us/legal/master-software-license-agreement. This
# * software is distributed to you in Source Code format and is governed by the
# * sections of the MSLA applicable to Source Code.
# *
# ******************************************************************************

declare_args() {
# Root directory for CHIP.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ******************************************************************************
# * # License
# * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b>
# ******************************************************************************
# * The licensor of this software is Silicon Laboratories Inc. Your use of this
# * software is governed by the terms of Silicon Labs Master Software License
# * Agreement (MSLA) available at
# * www.silabs.com/about-us/legal/master-software-license-agreement. This
# * software is distributed to you in Source Code format and is governed by the
# * sections of the MSLA applicable to Source Code.
# *
# ******************************************************************************

declare_args() {
jsoncpp_root = "//third_party/connectedhomeip/third_party/jsoncpp"
}
Loading

0 comments on commit 368e929

Please sign in to comment.