Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Command processing #1581

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
10e1df4
Prefix simulated datamodel with 'App' to avoid conflicts
kedars Jul 10, 2020
4cca13d
Create baseline classes for 'Value' and 'Attribute'
kedars Jul 2, 2020
3d409c8
Use enum instead of template
kedars Jul 3, 2020
eb9c412
Get a basic Cluster Server structure
kedars Jul 5, 2020
a43a2c9
Let LEDWidget class in wifi-echo implement the OnOff Cluster
kedars Jul 7, 2020
ed27179
Restyled by clang-format
restyled-commits Jul 7, 2020
dc2f1d9
Fix incorrect data type
kedars Jul 7, 2020
1e4612c
Endpoint 0 is reserved
kedars Jul 8, 2020
2a33054
Eliminate CHIP prefix from the datatype/function names
kedars Jul 8, 2020
71f575f
Move to lib/datamodel from lib/core
kedars Jul 8, 2020
825133e
Use a static allocation of the Basic Cluster instead of on the heap
kedars Jul 8, 2020
8ef76bf
add skeleton tests directory, tweaks to make system
Jul 8, 2020
3424e9e
fixup
Jul 8, 2020
d4e4f54
remove CHIP for files that live in datamodel/ subdir
Jul 8, 2020
5fd8f44
more little renames
Jul 8, 2020
16d7861
Add tests for ClusterServer
kedars Jul 9, 2020
19133b5
Use CHIPError.h for errors
kedars Jul 9, 2020
9b5a74d
Move standard clusters in their own files
kedars Jul 9, 2020
679cc6b
Documentation updates
kedars Jul 9, 2020
5eee74d
Missed the change in the test file
kedars Jul 9, 2020
725ddca
* add Deque.h
Jul 10, 2020
300cf24
fixups
Jul 10, 2020
8e8e293
add documentation
Jul 10, 2020
adfc032
Minor fixes
kedars Jul 10, 2020
38ef849
Include Dequeue.h to the build system
kedars Jul 10, 2020
bc6f68e
Fix tests
kedars Jul 10, 2020
b520ca1
Restyled fixes
restyled-commits Jul 10, 2020
d2178f4
Add 'gn' support
kedars Jul 10, 2020
f878cec
Fixes from review feedback
kedars Jul 11, 2020
94c7525
include lib/datamodel/.. -> include datamodel/...
Jul 13, 2020
087e036
Move the ZCLVersion/StackVersion within the SDK
kedars Jul 14, 2020
8a84cfb
restyle
kedars Jul 14, 2020
3e390b8
functor instead of std::function
Jul 15, 2020
4901e06
Use 'g' prefix for globals
kedars Jul 19, 2020
41fe827
Introduce ClusterId_t and AttributeId_t
kedars Jul 19, 2020
f42189d
Don't embed 'enum' or min/max in the Attribute class
kedars Jul 21, 2020
fc06418
Fix GN build warnings due to objects with no symbols on Mac (#1552)
mspang Jul 10, 2020
5b26501
[gn] Vscode integration. Fixes #1526. (#1527)
turon Jul 10, 2020
3a784e3
Bloat check scheduling: update timing to 5 minutes, checkout code sin…
andy31415 Jul 10, 2020
651634d
Move screen framework into component (#1555)
mlepage-google Jul 10, 2020
b80015e
Fix GN examples workflow not saving the outputs (#1559)
mspang Jul 10, 2020
bc69486
Fix CFLAGS in Makefile (#1562)
mlepage-google Jul 10, 2020
02ba5b7
Update version for android image, fix dpkg install error in nrf conne…
andy31415 Jul 11, 2020
5716706
Add default build with linux device layer (#1568)
mspang Jul 13, 2020
8a4e6b4
Fix TestPlatformTime under load (#1571)
mspang Jul 13, 2020
783dcfe
Fix nRF5 lock app build instructions (#1572)
mspang Jul 13, 2020
2733a12
Add missing headers to //src/platform (#1569)
mspang Jul 13, 2020
1a24b07
[OpenThread] ReceivePacket should use PBUF_LINK when allocating pbuf …
erjiaqing Jul 14, 2020
7cf0d80
Fix data race in GenericPlatformManagerImpl_POSIX.ipp (#1588)
mspang Jul 14, 2020
741db9d
Fix activate.sh to find CHIP_ROOT (#1585)
Jul 14, 2020
ef6ff7b
Fix some configuration differences between GN & automake (#1582)
mspang Jul 14, 2020
37d58ad
Fix AC_DEFINE description message to align with macro define value (#…
yufengwangca Jul 14, 2020
7f0cd95
[nrf5] build with internal OpenThread (#1579)
bukepo Jul 14, 2020
5861fce
[shell] Add device layer commands: start, get, config. (#1574)
turon Jul 14, 2020
ef9b7cf
dont need bsdtar (#1598)
Jul 14, 2020
f815825
[shell] Add documentation for CHIP shell commands. (#1596)
turon Jul 14, 2020
9987ae5
Remove recursive mutex & fix unbalanced locking in TestPlatformMgr (#…
mspang Jul 14, 2020
9f920f4
[shell] Add handling of escape and tabs. (#1604)
turon Jul 15, 2020
926adda
[linux] Add GDBus support in PlatformMgr to drive DBUS communication.…
yufengwangca Jul 15, 2020
b5725f3
[linux] Use new chip SHA256 class to re-implement CHIP provisioning H…
yufengwangca Jul 16, 2020
bf11b41
EFR32 fix lock app build (#1628)
jepenven-silabs Jul 16, 2020
dcc1419
Pull submodules (#1583)
mspang Jul 16, 2020
76bb6b5
Glue standalone application to a device layer for POSIX platforms (#1…
vivien-apple Jul 16, 2020
f710f8b
Adapt System layer to Zephyr OS (#1594)
Damian-Nordic Jul 17, 2020
a035dd9
Improve CHIP error constant defines to be consistent and accurate (#1…
yufengwangca Jul 17, 2020
5fca166
error: invalid conversion from 'const char*' to 'char*' [-fpermissive…
vivien-apple Jul 17, 2020
5eaf5df
Introduce a command handler
kedars Jul 12, 2020
b2dcc91
Minor renames
kedars Jul 13, 2020
a3ec967
Incorporate command processing
kedars Jul 13, 2020
3969595
Fix return conditions
kedars Jul 15, 2020
9fe09b8
Extend the 'Command' object to ZCLCommand
kedars Jul 15, 2020
e84a59f
Create CommandId_t
kedars Jul 19, 2020
d0fca83
Fix test
kedars Jul 19, 2020
0223a36
Temporary commit: Cluster DummyEcho
kedars Jul 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get -fy install git vim emacs sudo \
iproute2 procps lsb-release \
bash-completion \
build-essential cmake cppcheck valgrind \
wget curl telnet bsdtar \
wget curl telnet \
docker.io
RUN groupadd -g $USER_GID $USERNAME
RUN useradd -s /bin/bash -u $USER_UID -g $USER_GID -G docker -m $USERNAME
Expand All @@ -27,7 +27,8 @@ RUN chmod 0440 /etc/sudoers.d/$USERNAME

RUN mkdir -p /var/downloads
RUN cd /var/downloads
RUN curl -JL https://github.com/microsoft/vscode-cpptools/releases/download/0.27.0/cpptools-linux.vsix | bsdtar -xvf - extension
RUN curl -JL https://github.com/microsoft/vscode-cpptools/releases/download/0.27.0/cpptools-linux.vsix > extension.zip
RUN unzip extension.zip
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions
RUN mv extension /home/$USERNAME/.vscode-server/extensions/ms-vscode.cpptools-0.27.0
RUN mkdir -p /home/$USERNAME/bin
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/bloat_check.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bloat Check
on:
schedule:
- cron: '*/10 * * * *'
- cron: '*/5 * * * *'


jobs:
Expand All @@ -11,9 +11,12 @@ jobs:
runs-on: ubuntu-latest

container:
image: "connectedhomeip/chip-build-openssl:0.2.18"
image: connectedhomeip/chip-build:0.3.0

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Report
run: |
scripts/helpers/bloat_check.py \
Expand Down
44 changes: 30 additions & 14 deletions .github/workflows/gn_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: nRF

env:
BUILD_TYPE: nrf
BUILD_TYPE: gn_nrf
BUILD_VERSION: 0.2.14
BUILD_IMAGE: chip-build-nrf-platform
BUILD_ORG: connectedhomeip
Expand All @@ -33,18 +33,26 @@ jobs:
run: scripts/examples/gn_nrf_example.sh examples/lock-app/nrf5 out/lock_app_debug
- name: Build example nRF5 Lighting App
run: scripts/examples/gn_nrf_example.sh examples/lighting-app/nrf5 out/lighting_app_debug
- name: Preserve artifacts
run: |
mkdir -p example_binaries/nrf-build
cp out/lock_app_debug/chip-nrf52840-lock-example \
out/lighting_app_debug/chip-nrf52840-lighting-example \
example_binaries/nrf-build/
- name: Binary artifact suffix
id: outsuffix
uses: haya14busa/[email protected]
with:
cond: ${{ github.event.pull_request.number == '' }}
if_true: "${{ github.sha }}"
if_false: "pull-${{ github.event.pull_request.number }}"
- name: Uploading Binaries
uses: actions/upload-artifact@v2
with:
name: ${{ env.BUILD_TYPE }}-example-build-${{ steps.outsuffix.outputs.value }}
path: |
out/lock_app_debug/chip-nrf52840-lock-example
out/lighting_app_debug/chip-nrf52840-lighting-example

linux-standalone:
name: Linux Standalone

env:
BUILD_TYPE: linux
BUILD_TYPE: gn_linux
BUILD_VERSION: 0.2.14
BUILD_IMAGE: chip-build
BUILD_ORG: connectedhomeip
Expand All @@ -68,9 +76,17 @@ jobs:
run: scripts/examples/gn_build_example.sh examples/chip-tool out/chip_tool_debug
- name: Build example Standalone Shell
run: scripts/examples/gn_build_example.sh examples/shell out/shell_debug
- name: Preserve artifacts
run: |
mkdir -p example_binaries/$BUILD_TYPE
cp out/chip_tool_debug/bin/chip-standalone-demo \
out/shell_debug/bin/chip-shell \
example_binaries/$BUILD_TYPE/
- name: Binary artifact suffix
id: outsuffix
uses: haya14busa/[email protected]
with:
cond: ${{ github.event.pull_request.number == '' }}
if_true: "${{ github.sha }}"
if_false: "pull-${{ github.event.pull_request.number }}"
- name: Uploading Binaries
uses: actions/upload-artifact@v2
with:
name: ${{ env.BUILD_TYPE }}-example-build-${{ steps.outsuffix.outputs.value }}
path: |
out/chip_tool_debug/chip-standalone-demo
out/shell_debug/chip-shell
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@
url = https://github.com/jeremyjh/ESP32_TFT_library.git
branch = master
ignore = dirty
commit = 35be9760b4edf485287f78c0cf652beb19c047f0
commit = 42cadf2de25fa7e9b5d5d5189e90756cf9938df2
[submodule "pigweed"]
path = third_party/pigweed/repo
url = https://pigweed.googlesource.com/pigweed/pigweed
branch = master
ignore = dirty
commit = 023f35bab59c73c498377d1be1b4e60534ce7b20
commit = ce87bc01d82d813506ece5122250a1b909d78e68
[submodule "openthread"]
path = third_party/openthread/repo
url = https://github.com/openthread/openthread.git
branch = master
ignore = dirty
commit = 5f0e36eeb236a507631e9c822e43f742b7b6738a
commit = c6d5c4aae0ff9f891ec9f734f6b44598e569c48d
[submodule "ot-br-posix"]
path = third_party/ot-br-posix/repo
url = https://github.com/openthread/ot-br-posix.git
branch = master
ignore = dirty
commit = 38e91052d1fb12a55c4e34073f9e399471650b4b
commit = 250c6d605b83910f86fa61fcdbde9ba67dcc7d93
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
},
"problemMatcher": ["$gcc"]
},
{
"label": "GN Build",
"type": "shell",
"command": "./gn_build.sh",
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": false,
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": ["$gcc"]
},
{
"label": "Auto-enforce coding style",
"type": "shell",
Expand Down
27 changes: 23 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
"${chip_root}/src/inet",
"${chip_root}/src/lib",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/datamodel",
"${chip_root}/src/lib/shell",
"${chip_root}/src/lib/support",
"${chip_root}/src/lwip:all",
Expand All @@ -59,6 +60,7 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
deps += [
"${chip_root}/src/qrcodetool",
"${chip_root}/src/setup_payload",
"${chip_root}/examples/shell",
]
}
}
Expand All @@ -73,6 +75,7 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
"${chip_root}/src/crypto/tests",
"${chip_root}/src/inet/tests",
"${chip_root}/src/lib/core/tests",
"${chip_root}/src/lib/datamodel/tests",
"${chip_root}/src/lib/support/tests",
"${chip_root}/src/lwip/tests",
"${chip_root}/src/platform/tests",
Expand Down Expand Up @@ -104,8 +107,11 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
# Enable building chip with gcc.
enable_host_gcc_build = enable_default_builds

# Build building chip with gcc & mbedtls.
enable_host_gcc_mbdtls_build = enable_default_builds
# Enable building chip with gcc & mbedtls.
enable_host_gcc_mbedtls_build = enable_default_builds

# Enable building chip for linux embedded.
enable_linux_embedded_build = enable_default_builds && host_os == "linux"

# Build the chip-tool example.
enable_standalone_chip_tool_build = enable_default_builds
Expand All @@ -132,6 +138,13 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
toolchain = "${chip_root}/config/mbedtls/toolchain:${host_os}_${host_cpu}_gcc_mbedtls"
}

if (host_os == "linux") {
chip_build("linux_embedded") {
toolchain =
"${chip_root}/config/linux/toolchain:linux_${host_cpu}_gcc_embedded"
}
}

standalone_toolchain = "${chip_root}/config/standalone/toolchain:standalone"

group("standalone_chip_tool") {
Expand Down Expand Up @@ -162,9 +175,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_host_gcc_build) {
deps += [ ":all_host_gcc" ]
}
if (enable_host_gcc_mbdtls_build) {
if (enable_host_gcc_mbedtls_build) {
deps += [ ":all_host_gcc_mbedtls" ]
}
if (enable_linux_embedded_build) {
deps += [ ":all_linux_embedded" ]
}
if (enable_standalone_chip_tool_build) {
deps += [ ":standalone_chip_tool" ]
}
Expand All @@ -188,9 +204,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_host_gcc_build) {
deps += [ ":check_host_gcc" ]
}
if (enable_host_gcc_mbdtls_build) {
if (enable_host_gcc_mbedtls_build) {
deps += [ ":check_host_gcc_mbedtls" ]
}
if (enable_linux_embedded_build) {
deps += [ ":check_linux_embedded" ]
}
}
}
}
9 changes: 6 additions & 3 deletions config/efr32/efr32-app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ EXTRA_SRCS += \
$(EFR32_SDK_ROOT)/util/third_party/segger/systemview/SEGGER/SEGGER_RTT.c

STD_INC_DIRS += \
$(CHIP_ROOT)/src/include/platform/EFR32 \
$(CHIP_ROOT)/src/include/platform \
$(CHIP_ROOT)/src/platform/EFR32 \
$(FREERTOS_ROOT)/Source/include \
$(FREERTOS_ROOT)/Source/portable/GCC/ARM_CM3 \
$(EFR32_SDK_ROOT) \
Expand Down Expand Up @@ -252,13 +253,15 @@ ifeq ($(EFR32FAMILY), efr32mg12)
STD_LIBS += \
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG12P/GCC/libbluetooth.a \
$(EFR32_SDK_ROOT)/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg12_gcc_release.a \
$(EFR32_SDK_ROOT)/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a
$(EFR32_SDK_ROOT)/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a \
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG12P/GCC/libmbedtls.a
else
ifeq ($(EFR32FAMILY), efr32mg21)
STD_LIBS += \
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG21/GCC/libbluetooth.a \
$(EFR32_SDK_ROOT)/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg21_gcc_release.a \
$(EFR32_SDK_ROOT)/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a
$(EFR32_SDK_ROOT)/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a \
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG21/GCC/libmbedtls.a
endif
endif

Expand Down
26 changes: 26 additions & 0 deletions config/linux/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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("//build/toolchain/gcc_toolchain.gni")

gcc_toolchain("linux_${host_cpu}_gcc_embedded") {
toolchain_args = {
current_os = "linux"
current_cpu = host_cpu
is_clang = false
import("${chip_root}/src/platform/Linux/args.gni")
}
}
2 changes: 1 addition & 1 deletion config/nrf5/nrf5-chip.mk
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ CHIP_CONFIGURE_OPTIONS = \
--with-chip-ble-project-includes=$(CHIP_PROJECT_CONFIG) \
--with-chip-warm-project-includes=$(CHIP_PROJECT_CONFIG) \
--with-chip-device-project-includes=$(CHIP_PROJECT_CONFIG) \
--with-openthread=$(NRF5_SDK_ROOT)/external/openthread \
--with-openthread=internal \
--disable-ipv4 \
--disable-tests \
--disable-tools \
Expand Down
11 changes: 5 additions & 6 deletions config/standalone/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Options from standalone-chip.mk that differ from configure defaults. These
# options are used from examples/.
chip_build_tests = false

config_network_layer_ble = false
inet_config_enable_async_dns_sockets = false

project_config_include_dirs = rebase_path([ "." ])
chip_project_config_include = "<CHIPProjectConfig.h>"
system_project_config_include = "<SystemProjectConfig.h>"
inet_config_enable_tun_endpoint = false
inet_config_enable_raw_endpoint = false
inet_config_enable_dns_resolver = false
11 changes: 9 additions & 2 deletions config/standalone/standalone-chip.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ CHIP_OUTPUT_DIR = $(OUTPUT_DIR)/chip
# An optional file containing application-specific configuration overrides.
CHIP_PROJECT_CONFIG = $(wildcard $(PROJECT_ROOT)/include/CHIPProjectConfig.h)

# Architcture on which CHIP is being built.
# Architecture on which CHIP is being built.
CHIP_BUILD_ARCH = $(shell $(CHIP_ROOT)/third_party/nlbuild-autotools/repo/third_party/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g')

# Archtecture for which CHIP will be built.
# Architecture for which CHIP will be built.
CHIP_HOST_ARCH := $(CHIP_BUILD_ARCH)


Expand Down Expand Up @@ -135,12 +135,18 @@ STD_LDFLAGS += -L$(CHIP_OUTPUT_DIR)/lib
# Add CHIP libraries to standard libraries list.
STD_LIBS += \
-lCHIP \
-lDeviceLayer \
-lInetLayer \
-lnlfaultinjection \
-lSystemLayer

STD_LIBS += $(shell pkg-config --libs openssl)

ifeq ($(findstring linux,$(CHIP_HOST_ARCH)),linux)
STD_LIBS += $(shell pkg-config --libs gio-2.0)
STD_CFLAGS += $(shell pkg-config --cflags gio-2.0)
endif

# Add the appropriate CHIP target as a prerequisite to all application
# compilation targets to ensure that CHIP gets built and its header
# files installed prior to compiling any dependent source files.
Expand All @@ -149,6 +155,7 @@ STD_COMPILE_PREREQUISITES += install-chip
# Add the CHIP libraries as prerequisites for linking the application.
STD_LINK_PREREQUISITES += \
$(CHIP_OUTPUT_DIR)/lib/libCHIP.a \
$(CHIP_OUTPUT_DIR)/lib/libDeviceLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libInetLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libnlfaultinjection.a \
$(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a
Expand Down
Loading