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

Merge master to rotating-id-generation #17

Merged
merged 25 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
651cb99
BufferWriter revisions (#4721)
kpschoedel Feb 10, 2021
9947c03
Start a script-friendly CHIP REPL for python (#4696)
andy31415 Feb 10, 2021
69270c0
Add CHIP copyright (#4782)
markus-becker-tridonic-com Feb 10, 2021
381bed1
Use the type system for the size of the buffer arg to IPAddress::ToSt…
bzbarsky-apple Feb 10, 2021
56fead3
Use the type system for the size of the buffer arg to header encoding…
bzbarsky-apple Feb 8, 2021
eb1cfd9
Add a convenience API for encoding/decoding headers into a packet buf…
bzbarsky-apple Feb 8, 2021
ccb0aba
Use the type system for the size of the buffer arg to PeerAddress::To…
bzbarsky-apple Feb 10, 2021
2c22ad9
Fix seg fault if we do network provisioning twice (#4770)
yufengwangca Feb 10, 2021
31b720c
[examples] Clean Status LED handling (#4764)
Damian-Nordic Feb 10, 2021
226b9c9
Add missing path to templates helper inside examples/chip-tool/templa…
vivien-apple Feb 10, 2021
55793d8
Pigweed-app example: nrfconnect SDK logs redirect to pw_hdlc (#4775)
szatmz Feb 10, 2021
1813d23
Set optimal CHIP task stack size for ESP32 (#4757)
sweetymhaiske Feb 10, 2021
dee43f2
Bump cryptography from 3.3.1 to 3.3.2 in /scripts (#4780)
dependabot[bot] Feb 10, 2021
e861a51
[server] Use test pairing without rendezvous bypass (#4723)
Damian-Nordic Feb 10, 2021
72a368b
Add Silabs SDK as a submodule for backward compatibility (#4733)
jepenven-silabs Feb 10, 2021
c918c34
Update Samsung SmartThings reviewers (#4787)
BroderickCarlin Feb 10, 2021
36030d7
Mobly integration for esp32 (#4745)
szatmz Feb 10, 2021
b3d32e0
Move ChipExceptions into chip.exeptions for python (#4790)
andy31415 Feb 10, 2021
819c1e9
[nrfconnect] Explicitly configure python to be used by GN (#4724)
Damian-Nordic Feb 10, 2021
1b6a96b
Fix and test heap allocation of PacketBuffers (#4632)
kpschoedel Feb 10, 2021
ac22f1b
Use Default Critical (Non-Critical) Marks for CHIP Cert Extensions. (…
emargolis Feb 10, 2021
e2590b8
[controller] Deprecate old DeviceController in python binding (#4678)
erjiaqing Feb 10, 2021
cca2045
Convert all for loop to ranged for loops for CRMP (#4714)
yufengwangca Feb 10, 2021
8be7e84
nrfconnect: Fix printing BLE error on regular session disconnection. …
kkasperczyk-no Feb 10, 2021
76c3fd2
Move tlv implementation into a separate module for python (#4789)
andy31415 Feb 10, 2021
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2020-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.
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Setup Build
run: |
case $BUILD_TYPE in
"main") GN_ARGS='';;
"main") GN_ARGS='chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=true';;
"clang") GN_ARGS='is_clang=true';;
"mbedtls") GN_ARGS='chip_crypto="mbedtls"';;
*) ;;
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
[submodule "third_party/efr32_sdk/repo"]
path = third_party/efr32_sdk/repo
url = https://github.com/SiliconLabs/sdk_support.git
22 changes: 11 additions & 11 deletions REVIEWERS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
The following individuals can be chosen as, and act as required reviewers on any
PR

| Name | Company |
| ----------------------------------------------------- | ------------------- |
| [anush-apple](https://github.com/anush-apple) | Apple, Inc. |
| [BroderickCarlin](https://github.com/BroderickCarlin) | Samsung SmartThings |
| [chrisdecenzo](https://github.com/chrisdecenzo) | Amazon, Inc. |
| [hawk248](https://github.com/hawk248) | Comcast, Inc. |
| [jelderton](https://github.com/jelderton) | Comcast, Inc. |
| [andy31415](https://github.com/andy31415) | Google, Inc. |
| [robszewczyk](https://github.com/robszewczyk) | Google, Inc. |
| [saurabhst](https://github.com/saurabhst) | Samsung SmartThings |
| [woody-apple](https://github.com/woody-apple) | Apple, Inc. |
| Name | Company |
| ----------------------------------------------- | ------------------- |
| [anush-apple](https://github.com/anush-apple) | Apple, Inc. |
| [msandstedt](https://github.com/msandstedt) | Samsung SmartThings |
| [chrisdecenzo](https://github.com/chrisdecenzo) | Amazon, Inc. |
| [hawk248](https://github.com/hawk248) | Comcast, Inc. |
| [jelderton](https://github.com/jelderton) | Comcast, Inc. |
| [andy31415](https://github.com/andy31415) | Google, Inc. |
| [robszewczyk](https://github.com/robszewczyk) | Google, Inc. |
| [saurabhst](https://github.com/saurabhst) | Samsung SmartThings |
| [woody-apple](https://github.com/woody-apple) | Apple, Inc. |
4 changes: 2 additions & 2 deletions config/android/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2020-2021 Project CHIP Authors
* Copyright (c) 2016-2017 Nest Labs, Inc.
* Copyright (c) 2019-2020 Google LLC.
* All rights reserved.
Expand Down Expand Up @@ -44,7 +44,7 @@

#define CHIP_CONFIG_LEGACY_KEY_EXPORT_DELEGATE 0

#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC 300
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 300

#define CHIP_CONFIG_ENABLE_FUNCT_ERROR_LOGGING 1

Expand Down
2 changes: 1 addition & 1 deletion config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ menu "CHIP Device Layer"
config CHIP_TASK_STACK_SIZE
int "CHIP Task Stack Size"
range 0 65535
default 8192
default 5120
help
The size (in bytes) of the CHIP task stack.

Expand Down
4 changes: 2 additions & 2 deletions config/ios/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2020-2021 Project CHIP Authors
* Copyright (c) 2016-2017 Nest Labs, Inc.
* Copyright (c) 2019-2020 Google LLC.
* All rights reserved.
Expand Down Expand Up @@ -44,7 +44,7 @@

#define CHIP_CONFIG_LEGACY_KEY_EXPORT_DELEGATE 0

#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC 300
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 300

#define CHIP_CONFIG_ENABLE_FUNCT_ERROR_LOGGING 1

Expand Down
9 changes: 8 additions & 1 deletion config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ else()
endif()
endif()

find_package(Python3 REQUIRED)

# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand Down Expand Up @@ -244,7 +246,12 @@ ExternalProject_Add(
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR ${CHIP_ROOT}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}
CONFIGURE_COMMAND ${GN_EXECUTABLE} --root=${CHIP_ROOT} --root-target=${GN_ROOT_TARGET} --dotfile=${GN_ROOT_TARGET}/.gn gen --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR}
CONFIGURE_COMMAND ${GN_EXECUTABLE}
--root=${CHIP_ROOT}
--root-target=${GN_ROOT_TARGET}
--dotfile=${GN_ROOT_TARGET}/.gn
--script-executable=${Python3_EXECUTABLE}
gen --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR}
BUILD_COMMAND ninja
INSTALL_COMMAND ""
BUILD_BYPRODUCTS ${CHIP_LIBRARIES}
Expand Down
4 changes: 2 additions & 2 deletions config/standalone/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2020-2021 Project CHIP Authors
* Copyright (c) 2016-2017 Nest Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -65,7 +65,7 @@

#define CHIP_CONFIG_LEGACY_KEY_EXPORT_DELEGATE 0

#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC 300
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 0

#define CHIP_CONFIG_ENABLE_FUNCT_ERROR_LOGGING 1

Expand Down
1 change: 1 addition & 0 deletions examples/chip-tool/templates/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"helpers": [
"../../../src/app/zap-templates/partials/helper.js",
"../../../src/app/zap-templates/common/StringHelper.js",
"../../../src/app/zap-templates/templates/app/helper.js",
"../../../src/app/zap-templates/templates/chip/helper.js",
"helper.js"
],
Expand Down
27 changes: 27 additions & 0 deletions examples/common/pigweed/nrfconnect/PigweedLoggerMutex.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
*
* Copyright (c) 2021 Project CHIP Authors
* All rights reserved.
*
* 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.
*/

#include "PigweedLoggerMutex.h"

namespace chip {
namespace rpc {

PigweedLoggerMutex logger_mutex;

} // namespace rpc
} // namespace chip
52 changes: 52 additions & 0 deletions examples/common/pigweed/nrfconnect/PigweedLoggerMutex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
*
* Copyright (c) 2021 Project CHIP Authors
* All rights reserved.
*
* 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.
*/

#pragma once

#include "PigweedLogger.h"
#include "pigweed/RpcService.h"
#include <kernel.h>

namespace chip {
namespace rpc {
class PigweedLoggerMutex : public ::chip::rpc::Mutex
{
public:
PigweedLoggerMutex() {}
void Lock() override
{
k_sem * sem = PigweedLogger::GetSemaphore();
if (sem)
{
k_sem_take(sem, K_FOREVER);
}
}
void Unlock() override
{
k_sem * sem = PigweedLogger::GetSemaphore();
if (sem)
{
k_sem_give(sem);
}
}
};

extern PigweedLoggerMutex logger_mutex;

} // namespace rpc
} // namespace chip
32 changes: 12 additions & 20 deletions examples/lighting-app/efr32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ Silicon Labs platform.

## Building

- Download the [sdk_support](https://github.com/SiliconLabs/sdk_support) from
GitHub and export the path with :

$ export EFR32_SDK_ROOT=<Path to cloned git repo>

- Download the
[Simplicity Commander](https://www.silabs.com/mcu/programming-options)
command line tool, and ensure that `commander` is your shell search path.
Expand All @@ -66,6 +61,7 @@ Silicon Labs platform.
MG12 boards:

- BRD4161A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm
- BRD4164A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm
- BRD4166A / SLTB004A / Thunderboard Sense 2 / 2.4GHz@10dBm
- BRD4170A / SLWSTK6000B / Multiband Wireless Starter Kit / 2.4GHz@19dBm,
915MHz@19dBm
Expand All @@ -77,10 +73,19 @@ Silicon Labs platform.

* Build the example application:

cd ~/connectedhomeip
./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32/ ./out/lighting-app BRD4161A

- To delete generated executable, libraries and object files use:

$ cd ~/connectedhomeip
$ rm -rf ./out/

OR use GN/Ninja directly

$ cd ~/connectedhomeip/examples/lighting-app/efr32
$ git submodule update --init
$ source third_party/connectedhomeip/scripts/activate.sh
$ export EFR32_SDK_ROOT=<path-to-silabs-sdk-v2.7>
$ export EFR32_BOARD=BRD4161A
$ gn gen out/debug --args="efr32_sdk_root=\"${EFR32_SDK_ROOT}\" efr32_board=\"${EFR32_BOARD}\""
$ ninja -C out/debug
Expand All @@ -90,17 +95,6 @@ Silicon Labs platform.
$ cd ~/connectedhomeip/examples/lighting-app/efr32
$ rm -rf out/

OR use the script

cd ~/connectedhomeip
$ export EFR32_SDK_ROOT=<path-to-silabs-sdk-v2.7>
$ export EFR32_BOARD=BRD4161A
./scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/debug/efr32_lighting_app

- To delete generated executable, libraries and object files use:
$ cd ~/connectedhomeip
$ rm -rf out/debug/efr32_lighting_app

<a name="flashing"></a>

## Flashing the Application
Expand Down Expand Up @@ -210,14 +204,12 @@ combination with JLinkRTTClient as follows:
**Push Button 0** - Press and Release : If not commissioned, start thread
with default configurations (DEBUG)


- Pressed and hold for 6 s: Initiates the factory reset of the device.
Releasing the button within the 6-second window cancels the factory reset
procedure. **LEDs** blink in unison when the factory reset procedure is
initiated.

**Push Button 1**
Toggles the light state On/Off
**Push Button 1** Toggles the light state On/Off

- Once the device is provisioned, it will join the Thread network is
established, look for the RTT log
Expand Down
4 changes: 1 addition & 3 deletions examples/lighting-app/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static LEDWidget sLightLED;

static bool sIsThreadProvisioned = false;
static bool sIsThreadEnabled = false;
static bool sIsThreadAttached = false;
static bool sHaveBLEConnections = false;
static bool sHaveServiceConnectivity = false;

Expand Down Expand Up @@ -187,7 +186,6 @@ void AppTask::AppTaskMain(void * pvParameter)
{
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
sIsThreadAttached = ConnectivityMgr().IsThreadAttached();
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
PlatformMgr().UnlockChipStack();
Expand All @@ -213,7 +211,7 @@ void AppTask::AppTaskMain(void * pvParameter)
{
sStatusLED.Set(true);
}
else if (sIsThreadProvisioned && sIsThreadEnabled && (!sIsThreadAttached || !sHaveServiceConnectivity))
else if (sIsThreadProvisioned && sIsThreadEnabled)
{
sStatusLED.Blink(950, 50);
}
Expand Down
4 changes: 3 additions & 1 deletion examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pw_proto_library(pigweed_lighting_protolib
target_sources(app PRIVATE
main/Rpc.cpp
../../common/pigweed/RpcService.cpp
../../common/pigweed/nrfconnect/PigweedLoggerMutex.cpp
${NRFCONNECT_COMMON}/util/PigweedLogger.cpp
)

Expand All @@ -96,7 +97,8 @@ target_include_directories(app PRIVATE
${PIGWEED_ROOT}/pw_sys_io/public
${CHIP_ROOT}/src/lib/support
${CHIP_ROOT}/src/system
../../common)
../../common
../../common/pigweed/nrfconnect)

target_link_libraries(app PRIVATE
pigweed_lighting_protolib.nanopb_rpc
Expand Down
11 changes: 2 additions & 9 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ NFCWidget sNFC;

bool sIsThreadProvisioned = false;
bool sIsThreadEnabled = false;
bool sIsThreadAttached = false;
bool sIsPairedToAccount = false;
bool sHaveBLEConnections = false;
bool sHaveServiceConnectivity = false;

Expand Down Expand Up @@ -164,16 +162,11 @@ int AppTask::StartApp()
{
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
sIsThreadAttached = ConnectivityMgr().IsThreadAttached();
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
PlatformMgr().UnlockChipStack();
}

// Consider the system to be "fully connected" if it has service
// connectivity and it is able to interact with the service on a regular basis.
bool isFullyConnected = sHaveServiceConnectivity;

// Update the status LED if factory reset has not been initiated.
//
// If system has "full connectivity", keep the LED On constantly.
Expand All @@ -188,11 +181,11 @@ int AppTask::StartApp()
// Otherwise, blink the LED ON for a very short time.
if (sAppTask.mFunction != kFunction_FactoryReset)
{
if (isFullyConnected)
if (sHaveServiceConnectivity)
{
sStatusLED.Set(true);
}
else if (sIsThreadProvisioned && sIsThreadEnabled && sIsPairedToAccount && (!sIsThreadAttached || !isFullyConnected))
else if (sIsThreadProvisioned && sIsThreadEnabled)
{
sStatusLED.Blink(950, 50);
}
Expand Down
Loading