Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into bozowski/chef-cd-…
Browse files Browse the repository at this point in the history
…merge
  • Loading branch information
aBozowski committed Jun 22, 2022
2 parents cba902d + c34a08b commit a503442
Show file tree
Hide file tree
Showing 239 changed files with 8,365 additions and 6,483 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
${{ runner.os }}-cirque-
- name: Bootstrap
timeout-minutes: 10
timeout-minutes: 15
run: |
integrations/docker/images/chip-build-cirque/run.sh \
--env GITHUB_ACTION_RUN=1 \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concurrency:
jobs:
test_suites_chip_tool_darwin:
name: Test Suites - Darwin
timeout-minutes: 135
timeout-minutes: 150

strategy:
matrix:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build Apps
timeout-minutes: 45
timeout-minutes: 60
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
matrix:
build_variant: [no-ble-tsan-clang]
chip_tool: ["", -same-event-loop]
chip_tool: [""]
env:
BUILD_VARIANT: ${{matrix.build_variant}}
CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
strategy:
matrix:
build_variant: [no-ble-tsan-clang, no-ble-asan-clang]
chip_tool: ["", -same-event-loop]
chip_tool: [""]
env:
BUILD_VARIANT: ${{matrix.build_variant}}
CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ compile_commands.json

# backup files, usually created by the ZAP tool
*~

# log files
*.log
Original file line number Diff line number Diff line change
Expand Up @@ -4460,7 +4460,7 @@ endpoint 1 {
ram attribute colorLoopTime default = 0x0019;
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue;
ram attribute colorCapabilities;
ram attribute colorCapabilities default = 0x1F;
ram attribute colorTempPhysicalMinMireds;
ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
ram attribute coupleColorTempToLevelMinMireds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16425,7 +16425,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000",
"defaultValue": "0x1F",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
13 changes: 13 additions & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ pw_proto_library(button_service
pw_protobuf.common_proto
)

pw_proto_library(descriptor_service
SOURCES
${chip_dir}/examples/common/pigweed/protos/descriptor_service.proto
PREFIX
descriptor_service
STRIP_PREFIX
${chip_dir}/examples/common/pigweed/protos
DEPS
pw_protobuf.common_proto
)

pw_proto_library(device_service
SOURCES
${chip_dir}/examples/common/pigweed/protos/device_service.proto
Expand Down Expand Up @@ -202,6 +213,7 @@ if (matter_enable_rpc)
target_link_libraries(${chip_main} PUBLIC
attributes_service.nanopb_rpc
button_service.nanopb_rpc
descriptor_service.nanopb_rpc
device_service.nanopb_rpc
lighting_service.nanopb_rpc
locking_service.nanopb_rpc
Expand Down Expand Up @@ -240,6 +252,7 @@ list(

-DPW_RPC_ATTRIBUTE_SERVICE=1
-DPW_RPC_BUTTON_SERVICE=1
-DPW_RPC_DESCRIPTOR_SERVICE=1
-DPW_RPC_DEVICE_SERVICE=1
-DPW_RPC_LIGHTING_SERVICE=1
-DPW_RPC_LOCKING_SERVICE=1
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ target_include_directories(app PRIVATE
target_sources(app PRIVATE
main/AppTask.cpp
main/main.cpp
main/ZclDoorLockCallbacks.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-modes-manager.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp
Expand Down
11 changes: 9 additions & 2 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/ota-requestor/OTATestEventTriggerDelegate.h>
#include <app/util/attribute-storage.h>

#include <credentials/DeviceAttestationCredsProvider.h>
Expand Down Expand Up @@ -58,6 +59,11 @@ K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(Ap

namespace {

// NOTE! This key is for test/certification only and should not be available in production devices.
// Ideally, it should be a part of the factory data set.
constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };

LEDWidget sStatusLED;
UnusedLedsWrapper<3> sUnusedLeds{ { DK_LED2, DK_LED3, DK_LED4 } };
k_timer sFunctionTimer;
Expand Down Expand Up @@ -182,9 +188,10 @@ CHIP_ERROR AppTask::Init()
// Initialize CHIP server
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());

static chip::CommonCaseDeviceServerInitParams initParams;
static CommonCaseDeviceServerInitParams initParams;
static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) };
(void) initParams.InitializeStaticResourcesBeforeServerInit();

initParams.testEventTriggerDelegate = &testEventTriggerDelegate;
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));

gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
Expand Down
57 changes: 57 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
*
* Copyright (c) 2022 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 <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <lib/support/CodeUtils.h>

using namespace ::chip;
using namespace ::chip::app::Clusters;
using namespace ::chip::app::Clusters::DoorLock;

LOG_MODULE_DECLARE(app, CONFIG_MATTER_LOG_LEVEL);

// Provided some empty callbacks and replaced feature map
// to simulate DoorLock endpoint for All-Clusters-App example
// without using kUsersManagement|kAccessSchedules|kRFIDCredentials|kPINCredentials

bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional<ByteSpan> & pinCode, DlOperationError & err)
{
return true;
}

bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional<ByteSpan> & pinCode,
DlOperationError & err)
{
return true;
}

void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
{
DoorLockServer::Instance().InitServer(endpoint);

// Set FeatureMap to 0, default is:
// (kUsersManagement|kAccessSchedules|kRFIDCredentials|kPINCredentials) 0x113
EmberAfStatus status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
LOG_ERR("Updating feature map %x", status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3634,7 +3634,7 @@ endpoint 1 {
ram attribute options;
ram attribute numberOfPrimaries;
ram attribute enhancedColorMode default = 0x01;
ram attribute colorCapabilities;
ram attribute colorCapabilities default = 0x1F;
ram attribute featureMap;
ram attribute clusterRevision default = 5;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16281,7 +16281,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000",
"defaultValue": "0x1F",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
2 changes: 2 additions & 0 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,8 @@ server cluster EthernetNetworkDiagnostics = 55 {
readonly attribute int64u timeSinceReset = 8;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

command ResetCounts(): DefaultSuccess = 0;
}

server cluster Switch = 59 {
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge-app/bridge-common/bridge-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -3833,7 +3833,7 @@
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 0,
"incoming": 1,
"outgoing": 1
}
],
Expand Down Expand Up @@ -7379,4 +7379,4 @@
}
],
"log": []
}
}
21 changes: 21 additions & 0 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from typing import Any, Dict, Sequence

import yaml
import re

import constants
import stateful_shell
Expand Down Expand Up @@ -307,6 +308,8 @@ def main(argv: Sequence[str]) -> None:
metavar="TARGET",
default="esp32")
parser.add_option("-r", "--rpc", help="enables Pigweed RPC interface. Enabling RPC disables the shell interface. Your sdkconfig configurations will be reverted to default. Default is PW RPC off. When enabling or disabling this flag, on the first build force a clean build with -c", action="store_true", dest="do_rpc")
parser.add_option("-a", "--automated_test_stamp", help="provide the additional stamp \"branch:commit_id\" as the software version string for automated tests.",
action="store_true", dest="do_automated_test_stamp")
parser.add_option("-v", "--vid", dest="vid", type=int,
help="specifies the Vendor ID. Default is 0xFFF1", metavar="VID", default=0xFFF1)
parser.add_option("-p", "--pid", dest="pid", type=int,
Expand Down Expand Up @@ -498,6 +501,22 @@ def main(argv: Sequence[str]) -> None:
#

if options.do_build:
if options.do_automated_test_stamp:
branch = ""
for branch_text in shell.run_cmd("git branch", return_cmd_output=True).split("\n"):
match_texts = re.findall("\* (.*)", branch_text)
if match_texts:
branch = match_texts[0]
break
commit_id = shell.run_cmd("git rev-parse HEAD", return_cmd_output=True).replace("\n", "")
sw_ver_string = f"""{branch}:{commit_id}"""
# 64 bytes space could only contain 63 bytes string + 1 byte EOS.
if len(sw_ver_string) >= 64:
truncated_sw_ver_string = f"""{branch[:22]}:{commit_id}"""
flush_print(
f"""Truncate the software version string from \"{sw_ver_string}\" to \"{truncated_sw_ver_string}\" due to 64 bytes limitation""")
sw_ver_string = truncated_sw_ver_string

if options.use_zzz:
flush_print("Using pre-generated ZAP output")
zzz_dir = os.path.join(_REPO_BASE_PATH,
Expand Down Expand Up @@ -573,13 +592,15 @@ def main(argv: Sequence[str]) -> None:
elif options.build_target == "linux":
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/linux")
with open(f"{_CHEF_SCRIPT_PATH}/linux/args.gni", "w") as f:
sw_ver_string_config_text = f"chip_device_config_device_software_version_string = \"{sw_ver_string}\"" if options.do_automated_test_stamp else ""
f.write(textwrap.dedent(f"""\
import("//build_overrides/chip.gni")
import("${{chip_root}}/config/standalone/args.gni")
chip_shell_cmd_server = false
chip_build_libshell = true
chip_config_network_layer_ble = false
target_defines = ["CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID={options.vid}", "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID={options.pid}", "CONFIG_ENABLE_PW_RPC={'1' if options.do_rpc else '0'}"]
{sw_ver_string_config_text}
"""))
with open(f"{_CHEF_SCRIPT_PATH}/linux/sample.gni", "w") as f:
f.write(textwrap.dedent(f"""\
Expand Down
3 changes: 2 additions & 1 deletion examples/common/pigweed/protos/attributes_service.options
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

chip.rpc.AttributeData.data_bytes max_size:128
chip.rpc.AttributeData.data_bytes max_size:128
chip.rpc.AttributeData.tlv_data max_size:256
1 change: 1 addition & 0 deletions examples/common/pigweed/protos/attributes_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ message AttributeData {
int32 data_int16 = 7;
int32 data_int32 = 8;
};
optional bytes tlv_data = 9;
}

message AttributeWrite {
Expand Down
Loading

0 comments on commit a503442

Please sign in to comment.