Skip to content

Commit

Permalink
Merge pull request #95 from project-chip/master
Browse files Browse the repository at this point in the history
[pull] master from project-chip:master
  • Loading branch information
woody-apple authored Oct 19, 2020
2 parents f2dd5a8 + 33927fe commit 131b5e7
Show file tree
Hide file tree
Showing 252 changed files with 6,449 additions and 2,436 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
*) ;;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
scripts/build/gn_gen.sh --args="$GN_ARGS chip_enable_happy_tests=true"
- name: Run Build
run: scripts/build/gn_build.sh
- name: Run Tests
Expand Down
23 changes: 20 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
}

# We don't always want to run happy tests, make them a seperate group.
group("happy_tests") {
if (chip_link_tests) {
deps = [ "//src:happy_tests" ]
if (chip_enable_happy_tests) {
group("happy_tests") {
if (chip_link_tests) {
deps = [ "//src:happy_tests" ]
}
}
}
} else {
Expand All @@ -115,6 +117,9 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {

# Set this to true to enable qpg6100 builds by default.
enable_qpg6100_builds = false

# Set this to true to enable k32w builds by default.
enable_k32w_builds = false
}

declare_args() {
Expand Down Expand Up @@ -150,6 +155,9 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {

# Build the efr32 lighting app example.
enable_efr32_lighting_app_build = enable_efr32_builds

# Build the k32w lock app example.
enable_k32w_lock_app_build = enable_k32w_builds
}

chip_build("host_clang") {
Expand Down Expand Up @@ -228,6 +236,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
}
}

if (enable_k32w_lock_app_build) {
group("k32w_lock_app") {
deps = [ "${chip_root}/examples/lock-app/k32w(${chip_root}/config/k32w/toolchain:k32w_lock_app)" ]
}
}

group("default") {
deps = []
if (enable_host_clang_build) {
Expand Down Expand Up @@ -265,6 +279,9 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_efr32_lock_app_build) {
deps += [ ":efr32_lock_app" ]
}
if (enable_k32w_lock_app_build) {
deps += [ ":k32w_lock_app" ]
}
}

group("check") {
Expand Down
2 changes: 2 additions & 0 deletions build/chip/happy_test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/tests.gni")

assert(chip_build_tests)
assert(chip_enable_happy_tests)

template("happy_test") {
_suite_name = target_name
Expand All @@ -35,6 +36,7 @@ template("happy_test") {
# GN will run python under virtual env, which will cause test failed to run
args = [
"--ci=True",
"--silent=True",
"--test-bin-dir",
rebase_path("${_test_output_dir}"),
rebase_path("${_test}.py"),
Expand Down
3 changes: 3 additions & 0 deletions build/chip/tests.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import("${chip_root}/src/platform/device.gni")
declare_args() {
# Enable building tests.
chip_build_tests = current_os != "freertos"

# Enable happy tests.
chip_enable_happy_tests = false
}

declare_args() {
Expand Down
24 changes: 24 additions & 0 deletions config/k32w/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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/arm_gcc/arm_toolchain.gni")

arm_toolchain("k32w_lock_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/lock-app/k32w/args.gni")
}
}
3 changes: 2 additions & 1 deletion config/nrfconnect/chip-lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function(chip_configure TARGET_NAME)
convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS)

zephyr_get_compile_flags(CHIP_CXXFLAGS CXX)
list(FILTER CHIP_CXXFLAGS EXCLUDE REGEX -std.*) # CHIP adds gnu++11 anyway...
list(FILTER CHIP_CXXFLAGS EXCLUDE REGEX -std.*)
list(APPEND CHIP_CXXFLAGS "-std=gnu++11")
convert_list_of_flags_to_string_of_flags(CHIP_CXXFLAGS CHIP_CXXFLAGS)

set(GN_ARGS "")
Expand Down
3 changes: 3 additions & 0 deletions config/nrfconnect/nrfconnect-app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ endif()
# ==================================================
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

# This is temporary solution and should be removed after merging including fix in Zephyr
zephyr_include_directories("${ZEPHYR_BASE}/../nrfxlib/crypto/nrf_cc310_platform/include")

# ==================================================
# General settings
# ==================================================
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libg

#### How to install prerequisites on macOS

On MacOS, first install Xcode from the Mac App Store. The remaining dependencies
On macOS, first install Xcode from the Mac App Store. The remaining dependencies
can be installed and satisfied using [Brew](https://brew.sh/):

```
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Some tools and utilities are dependent on third party tools, such as Docker.
environments that don't pollute the host OS. It is also much easier to maintain
stability across multiple host environments. Install stable version of
[Docker Desktop](https://www.docker.com/products/docker-desktop) relevant to
your native OS (MacOS or Windows). Once installed, you can run docker commands
your native OS (macOS or Windows). Once installed, you can run docker commands
from the shell/terminal.
2 changes: 1 addition & 1 deletion docs/VSCODE_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ workflow [here](https://code.visualstudio.com/docs/remote/containers).

Tested on:

- MacOS 10.5
- macOS 10.5
- Windows 10 Pro + WSL + Ubuntu 18 LTS

## Setup Steps
Expand Down
18 changes: 18 additions & 0 deletions examples/build_overrides/k32w_sdk.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 k32w SDK.
k32w_sdk_build_root = "//third_party/connectedhomeip/third_party/k32w_sdk"
}
3 changes: 3 additions & 0 deletions examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ executable("chip-tool") {
"commands/common/Command.cpp",
"commands/common/Commands.cpp",
"commands/common/EchoCommand.cpp",
"commands/common/Logging.cpp",
"commands/common/ModelCommand.cpp",
"commands/common/NetworkCommand.cpp",
"main.cpp",
Expand All @@ -34,6 +35,8 @@ executable("chip-tool") {
defines = [ "BUILD_RELEASE=1" ]
}

cflags = [ "-Wconversion" ]

public_deps = [ "${chip_root}/src/lib" ]

output_dir = root_out_dir
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

from generic_node_image

RUN apt-get install -y libglib2.0
COPY out/debug/chip-tool /usr/bin/
COPY entrypoint.sh /

Expand Down
41 changes: 34 additions & 7 deletions examples/chip-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ pass it the discriminator and pairing code of the remote device. The command
below uses the default values hard-coded into the debug versions of the ESP32
wifi-echo app:

$ chip-tool echo-ble 3840 12345678
$ chip-tool echo ble 3840 12345678

### Ping a device over IP

To start the Client in echo mode, run the built executable and pass it the IP
address and port of the server to talk to, as well as the command "echo".

$ chip-tool 192.168.0.30 8000 echo
$ chip-tool echo ip 192.168.0.30 8000

If valid values are supplied, it will begin to periodically send messages to the
server address provided.
Expand All @@ -55,12 +55,39 @@ Stop the Client at any time with `Ctrl + C`.

## Using the Client to Send CHIP Commands

To use the Client to send a CHIP comands, run the built executable and pass it
the IP address and port of the server to talk to, the name of the command to
send, as well as an enpoint id. Right now the "off", "on", and "toggle" commands
are supported, from the On/Off cluster. The endpoint id must be between 1
To use the Client to send a CHIP commands, run the built executable and pass it
the target cluster name, the target command name, an endpoint id as well as the
IP address and port of the server to talk to. The endpoint id must be between 1
and 240.

$ chip-tool 192.168.0.30 8000 on 1
$ chip-tool onoff on 1 192.168.0.30 11095

The client will send a single command packet and then exit.

### How to get the list of supported clusters

To get the list of supported clusters, run the built executable without any
arguments.

$ chip-tool

### How to get the list of supported commands for a specific cluster

To get the list of commands for a specific cluster, run the built executable
with the target cluster name.

$ chip-tool onoff

### How to get the list of supported attributes for a specific cluster

To the the list of attributes for a specific cluster, run the built executable
with the target cluster name and the `read` command name.

$ chip-tool onoff read

### How to get the list of parameters for a command

To get the list of parameters for a specific command, run the built executable
with the target cluster name and the target command name

$ chip-tool onoff on
62 changes: 0 additions & 62 deletions examples/chip-tool/commands/clusters/BarrierControl/Commands.h

This file was deleted.

Loading

0 comments on commit 131b5e7

Please sign in to comment.